feat(gui): Replace single strategy box with 4-tier collapsible stream panels
This commit is contained in:
48
scripts/tasks/gui_ux_1_1_tests.toml
Normal file
48
scripts/tasks/gui_ux_1_1_tests.toml
Normal file
@@ -0,0 +1,48 @@
|
||||
role = "tier3-worker"
|
||||
docs = ["conductor/workflow.md"]
|
||||
prompt = """
|
||||
Create tests/test_mma_dashboard_streams.py — failing tests for Task 1.1 of comprehensive_gui_ux track.
|
||||
|
||||
CONTEXT: _render_mma_dashboard in @gui_2.py currently has a single input_text_multiline for "Strategy (Tier 1)" (around line 2729). Task 1.1 replaces it with four collapsible sections using imgui.collapsing_header(), one per tier.
|
||||
|
||||
TESTS TO WRITE (all should FAIL against current code — they test the NEW behavior):
|
||||
|
||||
1. test_all_four_tier_headers_rendered:
|
||||
- Create a mock App with mma_streams = {"Tier 1": "strat", "Tier 2 (Tech Lead)": "lead", "Tier 3 (Worker): T-001": "work", "Tier 4 (QA)": "qa"}
|
||||
- Patch imgui.collapsing_header to record calls, patch imgui.begin_child to return True, patch imgui.end_child, patch imgui.input_text_multiline
|
||||
- Call app._render_mma_dashboard()
|
||||
- Assert collapsing_header was called with a string containing "Tier 1" AND "Tier 2" AND "Tier 3" AND "Tier 4"
|
||||
|
||||
2. test_tier3_aggregates_multiple_worker_streams:
|
||||
- mma_streams = {"Tier 3 (Worker): T-001": "output1", "Tier 3 (Worker): T-002": "output2"}
|
||||
- Patch imgui.collapsing_header to return True, patch begin_child/end_child/text
|
||||
- Call _render_mma_dashboard()
|
||||
- Assert imgui.text was called with content containing "T-001" and "T-002" (sub-headers shown)
|
||||
|
||||
3. test_old_single_strategy_box_removed:
|
||||
- With any mma_streams, call _render_mma_dashboard()
|
||||
- Assert imgui.input_text_multiline was NOT called with "##mma_strategy" as first arg
|
||||
- (The old box should be gone, replaced by collapsing_header sections)
|
||||
|
||||
IMPLEMENTATION DETAILS:
|
||||
- Import: import pytest, unittest.mock (patch, MagicMock, call)
|
||||
- The App class needs minimal init to avoid full GUI startup. Use a MagicMock for the app instance and manually attach method:
|
||||
app = MagicMock(spec=App)
|
||||
app.mma_streams = {...}
|
||||
app.mma_tier_usage = {}
|
||||
app.tracks = []
|
||||
app.active_track = None
|
||||
app.active_tickets = []
|
||||
app.mma_status = "idle"
|
||||
app.active_tier = None
|
||||
app.mma_step_mode = False
|
||||
app._pending_mma_spawn = None
|
||||
app._pending_mma_approval = None
|
||||
app._pending_ask_dialog = False
|
||||
# Then call the unbound method:
|
||||
from gui_2 import App
|
||||
App._render_mma_dashboard(app)
|
||||
- Patch target: 'gui_2.imgui' module-level
|
||||
- Use 1-space indentation throughout.
|
||||
- All 3 tests should FAIL against the current code (which still has the old single text box).
|
||||
"""
|
||||
Reference in New Issue
Block a user