feat(gui): Replace single strategy box with 4-tier collapsible stream panels
This commit is contained in:
59
gui_2.py
59
gui_2.py
@@ -282,6 +282,7 @@ class App:
|
||||
self.ui_agent_tools: dict[str, bool] = {t: agent_tools_cfg.get(t, True) for t in AGENT_TOOL_NAMES}
|
||||
self.tracks: list[dict[str, Any]] = []
|
||||
self.mma_streams: dict[str, str] = {}
|
||||
self._tier_stream_last_len: dict[str, int] = {}
|
||||
self.is_viewing_prior_session = False
|
||||
self.prior_session_entries: list[dict[str, Any]] = []
|
||||
self.test_hooks_enabled = ("--enable-test-hooks" in sys.argv) or (os.environ.get("SLOP_TEST_HOOKS") == "1")
|
||||
@@ -2716,10 +2717,60 @@ class App:
|
||||
imgui.text(f"{stats.get('output', 0):,}")
|
||||
imgui.end_table()
|
||||
imgui.separator()
|
||||
imgui.separator()
|
||||
imgui.text("Strategy (Tier 1)")
|
||||
strategy_text = self.mma_streams.get("Tier 1", "")
|
||||
imgui.input_text_multiline("##mma_strategy", strategy_text, imgui.ImVec2(-1, 150), imgui.InputTextFlags_.read_only)
|
||||
if imgui.collapsing_header("Tier 1: Strategy"):
|
||||
content = self.mma_streams.get("Tier 1", "")
|
||||
if imgui.begin_child("##tier1_scroll", imgui.ImVec2(-1, 200), True):
|
||||
imgui.text_wrapped(content)
|
||||
try:
|
||||
at_bottom = imgui.get_scroll_y() >= imgui.get_scroll_max_y() - 10
|
||||
if at_bottom and len(content) != self._tier_stream_last_len.get("Tier 1", -1):
|
||||
imgui.set_scroll_here_y(1.0)
|
||||
self._tier_stream_last_len["Tier 1"] = len(content)
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
imgui.end_child()
|
||||
if imgui.collapsing_header("Tier 2: Tech Lead"):
|
||||
content = self.mma_streams.get("Tier 2 (Tech Lead)", "")
|
||||
if imgui.begin_child("##tier2_scroll", imgui.ImVec2(-1, 200), True):
|
||||
imgui.text_wrapped(content)
|
||||
try:
|
||||
at_bottom = imgui.get_scroll_y() >= imgui.get_scroll_max_y() - 10
|
||||
if at_bottom and len(content) != self._tier_stream_last_len.get("Tier 2 (Tech Lead)", -1):
|
||||
imgui.set_scroll_here_y(1.0)
|
||||
self._tier_stream_last_len["Tier 2 (Tech Lead)"] = len(content)
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
imgui.end_child()
|
||||
if imgui.collapsing_header("Tier 3: Workers"):
|
||||
tier3_keys = [k for k in self.mma_streams if "Tier 3" in k]
|
||||
if not tier3_keys:
|
||||
imgui.text_disabled("No worker output yet.")
|
||||
else:
|
||||
for key in tier3_keys:
|
||||
ticket_id = key.split(": ", 1)[-1] if ": " in key else key
|
||||
imgui.text(ticket_id)
|
||||
if imgui.begin_child(f"##tier3_{ticket_id}_scroll", imgui.ImVec2(-1, 150), True):
|
||||
imgui.text_wrapped(self.mma_streams[key])
|
||||
try:
|
||||
at_bottom = imgui.get_scroll_y() >= imgui.get_scroll_max_y() - 10
|
||||
if at_bottom and len(self.mma_streams[key]) != self._tier_stream_last_len.get(key, -1):
|
||||
imgui.set_scroll_here_y(1.0)
|
||||
self._tier_stream_last_len[key] = len(self.mma_streams[key])
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
imgui.end_child()
|
||||
if imgui.collapsing_header("Tier 4: QA"):
|
||||
content = self.mma_streams.get("Tier 4 (QA)", "")
|
||||
if imgui.begin_child("##tier4_scroll", imgui.ImVec2(-1, 200), True):
|
||||
imgui.text_wrapped(content)
|
||||
try:
|
||||
at_bottom = imgui.get_scroll_y() >= imgui.get_scroll_max_y() - 10
|
||||
if at_bottom and len(content) != self._tier_stream_last_len.get("Tier 4 (QA)", -1):
|
||||
imgui.set_scroll_here_y(1.0)
|
||||
self._tier_stream_last_len["Tier 4 (QA)"] = len(content)
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
imgui.end_child()
|
||||
# 4. Task DAG Visualizer
|
||||
imgui.text("Task DAG")
|
||||
if self.active_track:
|
||||
|
||||
Reference in New Issue
Block a user