6.3 KiB
Implementation Plan: Feature Bleed Cleanup
Architecture reference: docs/guide_architecture.md
Phase 1: Dead Code Removal
Focus: Delete the two confirmed dead code blocks — no behavior change, pure deletion.
-
Task 1.1: In
gui_2.py, delete the first_render_comms_history_paneldefinition.- Location: Lines 3041-3073 (use
py_get_code_outlineto confirm current line numbers before editing). - What: The entire method body from
def _render_comms_history_panel(self) -> None:throughimgui.end_child()and the following blank line. The live version begins at ~line 3435 after this deletion shifts lines. - How: Use
set_file_sliceto delete lines 3041-3073 (replace with empty string). Then runpy_get_code_outlineto confirm only one_render_comms_history_panelremains. - Verify:
grep -n "_render_comms_history_panel" gui_2.pyshould show exactly 2 hits: thedefline and the call site in_gui_func.
- Location: Lines 3041-3073 (use
-
Task 1.2: In
gui_2.py__init__, delete the duplicate state variable assignments.- Location: Second occurrences of
ui_conductor_setup_summary,ui_new_track_name,ui_new_track_desc,ui_new_track_type. Currently at lines 308-311 (grep to confirm exact lines before editing:grep -n "ui_conductor_setup_summary" gui_2.py). - What: Delete these 4 lines. The first correct assignments remain at lines 218-221.
- How: Use
set_file_sliceto remove lines 308-311 (replace with empty string). - Verify: Each variable should appear exactly once in
__init__(grep to confirm).
- Location: Second occurrences of
-
Task 1.3: Write/run tests to confirm no regressions.
- Run
uv run pytest tests/ -x -qand confirm all tests pass. - Run
uv run python -c "from gui_2 import App; print('import ok')"to confirm no syntax errors.
- Run
-
Task 1.4: Conductor — User Manual Verification
- Start the app with
uv run python gui_2.pyand confirm it launches without error. - Open "Operations Hub" → "Comms History" tab and confirm the comms panel renders (color legend visible).
- Start the app with
Phase 2: Menu Bar Consolidation
Focus: Remove the dead inline menubar block and add a working Quit item to _show_menus.
-
Task 2.1: Delete the dead
begin_main_menu_bar()block from_gui_func.- Location:
gui_2.pylines 1679-1705 (the comment# ---- Menubarthroughimgui.end_main_menu_bar()). Useget_file_slice(1676, 1712)to confirm exact boundaries before editing. - What: Delete the
# ---- Menubarcomment line and the entireif imgui.begin_main_menu_bar(): ... imgui.end_main_menu_bar()block (~27 lines total). The# --- Hubs ---comment and hub rendering that follows must be preserved. - How: Use
set_file_sliceto replace lines 1679-1705 with a single blank line. - Verify:
grep -n "begin_main_menu_bar" gui_2.pyreturns 0 hits.
- Location:
-
Task 2.2: Add working "Quit" to
_show_menus.- Location:
gui_2.py_show_menusmethod (lines 1620-1647 — confirm withpy_get_definition). - What: Before the existing
if imgui.begin_menu("Windows"):line, insert:if imgui.begin_menu("manual slop"): if imgui.menu_item("Quit", "Ctrl+Q", False)[0]: self.runner_params.app_shall_exit = True imgui.end_menu() - Note:
self.runner_paramsis set inrun()beforeimmapp.run()is called, so it is valid here. - How: Use
set_file_sliceorEditto insert the block before the "Windows" menu. - Verify: Launch app, confirm "manual slop" > "Quit" appears in menubar and clicking it closes the app cleanly.
- Location:
-
Task 2.3: Write/run tests.
- Run
uv run pytest tests/ -x -q.
- Run
-
Task 2.4: Conductor — User Manual Verification
- Launch app. Confirm menubar has: "manual slop" (with Quit), "Windows", "Project".
- Confirm "View" menu is gone (was dead duplicate of "Windows").
- Confirm Quit closes the app.
Phase 3: Token Budget Layout Fix
Focus: Give the token budget panel its own collapsing header in AI Settings; remove the double label from the provider panel.
-
Task 3.1: Remove the double label + embedded call from
_render_provider_panel.- Location:
gui_2.py_render_provider_panel(lines ~2687-2746 — usepy_get_definitionto confirm). The block to remove is:These are 4 consecutive lines at the end of the method (beforeimgui.text("Token Budget:") imgui.separator() imgui.text("Token Budget") self._render_token_budget_panel()if self._gemini_cache_text:). - What: Delete those 4 lines. The
if self._gemini_cache_text:block that follows them must be preserved in place. - How: Use
Editwithold_stringset to those exact 4 lines. - Verify:
_render_provider_panelends with theif self._gemini_cache_text:block and no "Token Budget" text labels.
- Location:
-
Task 3.2: Add
collapsing_header("Token Budget")to AI Settings in_gui_func.- Location:
gui_2.py_gui_func, AI Settings window block (currently lines ~1719-1723 —get_file_slice(1715, 1730)to confirm). Current content:if imgui.collapsing_header("Provider & Model"): self._render_provider_panel() if imgui.collapsing_header("System Prompts"): self._render_system_prompts_panel() - What: Add after the System Prompts header:
if imgui.collapsing_header("Token Budget"): self._render_token_budget_panel() - How: Use
Editto insert after the_render_system_prompts_panel()call. - Verify: AI Settings window now shows three collapsing sections: "Provider & Model", "System Prompts", "Token Budget".
- Location:
-
Task 3.3: Write/run tests.
- Run
uv run pytest tests/ -x -q.
- Run
-
Task 3.4: Conductor — User Manual Verification
- Launch app. Open "AI Settings" window.
- Confirm "Token Budget" appears as a collapsing header (expand it — panel renders correctly).
- Confirm "Provider & Model" section no longer shows any "Token Budget" label.
Phase Completion Checkpoint
After all phases pass manual verification:
- Run
uv run pytest tests/ -x -qone final time. - Commit:
fix(bleed): remove dead comms panel dup, consolidate menubar, fix token budget layout - Update TASKS.md to mark this track complete.
- Update JOURNAL.md with What/Why/How/Issues/Result.