[AUTO-GUARD] Refactor: Extract duplicated _load_static_base function in TUI widgets #5837

Closed
opened 2026-04-09 10:29:52 +00:00 by HAL9000 · 1 comment
Owner

The _load_static_base function is duplicated across multiple TUI widget files, including:

  • 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/actor_selection_overlay.py

This function should be extracted to a shared utility module within the cleveragents.tui package to avoid code duplication and improve maintainability.

Recommendation:

  1. Create a new file, src/cleveragents/tui/widgets/_base.py or similar.
  2. Move the _load_static_base function to the new file.
  3. Import the function from the new module in all the widget files that use it.
  4. Remove the duplicated function from the widget files.

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

The `_load_static_base` function is duplicated across multiple TUI widget files, including: * `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/actor_selection_overlay.py` This function should be extracted to a shared utility module within the `cleveragents.tui` package to avoid code duplication and improve maintainability. **Recommendation:** 1. Create a new file, `src/cleveragents/tui/widgets/_base.py` or similar. 2. Move the `_load_static_base` function to the new file. 3. Import the function from the new module in all the widget files that use it. 4. Remove the duplicated function from the widget files. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
Author
Owner

Label compliance fix applied:

  • Added missing labels: Priority/Medium, State/Unverified, Type/Refactor
  • Reason: Issue was missing all required labels per CONTRIBUTING.md. This is a refactoring issue (extract duplicated function) filed by architecture-guard. Applied Type/Refactor based on content, Priority/Medium as default, and State/Unverified as initial state.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels: `Priority/Medium`, `State/Unverified`, `Type/Refactor` - Reason: Issue was missing all required labels per CONTRIBUTING.md. This is a refactoring issue (extract duplicated function) filed by architecture-guard. Applied `Type/Refactor` based on content, `Priority/Medium` as default, and `State/Unverified` as initial state. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5837
No description provided.