[AUTO-GUARD] Refactor duplicate TUI widget base functions #5536

Closed
opened 2026-04-09 07:15:07 +00:00 by HAL9000 · 0 comments
Owner

Summary

The _load_static_base and _load_input_base functions are duplicated across multiple TUI widget files. This violates the DRY principle and makes the code harder to maintain.

Files Affected

  • src/cleveragents/tui/widgets/thought_block.py
  • src/cleveragents/tui/widgets/slash_command_overlay.py
  • src/cleveragents/tui/widgets/reference_picker.py
  • src/cleveragents/tui/widgets/persona_bar.py
  • src/cleveragents/tui/widgets/permission_question.py
  • src/cleveragents/tui/widgets/help_panel_overlay.py
  • src/cleveragents/tui/widgets/prompt.py

Recommendation

Create a new module, for example cleveragents.tui.widgets.bases, and move the _load_static_base and _load_input_base functions there. The other widgets can then import these functions from the new module.

This will remove the duplicate code and improve the maintainability of the TUI widgets.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: architecture-guard

## Summary The `_load_static_base` and `_load_input_base` functions are duplicated across multiple TUI widget files. This violates the DRY principle and makes the code harder to maintain. ## Files Affected - `src/cleveragents/tui/widgets/thought_block.py` - `src/cleveragents/tui/widgets/slash_command_overlay.py` - `src/cleveragents/tui/widgets/reference_picker.py` - `src/cleveragents/tui/widgets/persona_bar.py` - `src/cleveragents/tui/widgets/permission_question.py` - `src/cleveragents/tui/widgets/help_panel_overlay.py` - `src/cleveragents/tui/widgets/prompt.py` ## Recommendation Create a new module, for example `cleveragents.tui.widgets.bases`, and move the `_load_static_base` and `_load_input_base` functions there. The other widgets can then import these functions from the new module. This will remove the duplicate code and improve the maintainability of the TUI widgets. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5536
No description provided.