checkpoint: track complete
This commit is contained in:
130
src/gui_2.py
130
src/gui_2.py
@@ -26,6 +26,7 @@ from src import log_pruner
|
||||
from src import models
|
||||
from src import app_controller
|
||||
from src import mcp_client
|
||||
from src import aggregate
|
||||
from src import markdown_helper
|
||||
from src import bg_shader
|
||||
from src import thinking_parser
|
||||
@@ -236,6 +237,7 @@ class App:
|
||||
self.shader_uniforms = {'crt': 1.0, 'scanline': 0.5, 'bloom': 0.8}
|
||||
self.shader_uniforms = {'crt': 1.0, 'scanline': 0.5, 'bloom': 0.8}
|
||||
self.ui_new_context_preset_name = ""
|
||||
self._focus_md_cache: dict[str, str] = {}
|
||||
"""UI-level wrapper for approving a pending tool execution ask."""
|
||||
self._handle_approve_ask()
|
||||
|
||||
@@ -774,52 +776,37 @@ class App:
|
||||
exp, opened = imgui.begin("Operations Hub", self.show_windows["Operations Hub"])
|
||||
self.show_windows["Operations Hub"] = bool(opened)
|
||||
if exp:
|
||||
imgui.text("Focus Agent:")
|
||||
imgui.push_style_var(imgui.StyleVar_.item_spacing, imgui.ImVec2(10, 4))
|
||||
ch1, self.ui_separate_tool_calls_panel = imgui.checkbox("Pop Out Tool Calls", self.ui_separate_tool_calls_panel)
|
||||
if ch1: self.show_windows["Tool Calls"] = self.ui_separate_tool_calls_panel
|
||||
imgui.same_line()
|
||||
focus_label = self.ui_focus_agent or "All"
|
||||
if imgui.begin_combo("##focus_agent", focus_label, imgui.ComboFlags_.width_fit_preview):
|
||||
if imgui.selectable("All", self.ui_focus_agent is None)[0]:
|
||||
self.ui_focus_agent = None
|
||||
for tier in ["Tier 2", "Tier 3", "Tier 4"]:
|
||||
if imgui.selectable(tier, self.ui_focus_agent == tier)[0]:
|
||||
self.ui_focus_agent = tier
|
||||
imgui.end_combo()
|
||||
ch2, self.ui_separate_usage_analytics = imgui.checkbox("Pop Out Usage Analytics", self.ui_separate_usage_analytics)
|
||||
if ch2: self.show_windows["Usage Analytics"] = self.ui_separate_usage_analytics
|
||||
imgui.same_line()
|
||||
if self.ui_focus_agent:
|
||||
if imgui.button("x##clear_focus"):
|
||||
self.ui_focus_agent = None
|
||||
if exp:
|
||||
imgui.push_style_var(imgui.StyleVar_.item_spacing, imgui.ImVec2(10, 4))
|
||||
ch1, self.ui_separate_tool_calls_panel = imgui.checkbox("Pop Out Tool Calls", self.ui_separate_tool_calls_panel)
|
||||
if ch1: self.show_windows["Tool Calls"] = self.ui_separate_tool_calls_panel
|
||||
imgui.same_line()
|
||||
ch2, self.ui_separate_usage_analytics = imgui.checkbox("Pop Out Usage Analytics", self.ui_separate_usage_analytics)
|
||||
if ch2: self.show_windows["Usage Analytics"] = self.ui_separate_usage_analytics
|
||||
imgui.same_line()
|
||||
ch3, self.ui_separate_external_tools = imgui.checkbox('Pop Out External Tools', self.ui_separate_external_tools)
|
||||
if ch3: self.show_windows['External Tools'] = self.ui_separate_external_tools
|
||||
imgui.pop_style_var()
|
||||
ch3, self.ui_separate_external_tools = imgui.checkbox('Pop Out External Tools', self.ui_separate_external_tools)
|
||||
if ch3: self.show_windows['External Tools'] = self.ui_separate_external_tools
|
||||
imgui.pop_style_var()
|
||||
|
||||
show_tc_tab = not self.ui_separate_tool_calls_panel
|
||||
show_usage_tab = not self.ui_separate_usage_analytics
|
||||
show_tc_tab = not self.ui_separate_tool_calls_panel
|
||||
show_usage_tab = not self.ui_separate_usage_analytics
|
||||
|
||||
if imgui.begin_tab_bar("ops_tabs"):
|
||||
if imgui.begin_tab_item("Comms History")[0]:
|
||||
self._render_comms_history_panel()
|
||||
if imgui.begin_tab_bar("ops_tabs"):
|
||||
if imgui.begin_tab_item("Comms History")[0]:
|
||||
self._render_comms_history_panel()
|
||||
imgui.end_tab_item()
|
||||
if show_tc_tab:
|
||||
if imgui.begin_tab_item("Tool Calls")[0]:
|
||||
self._render_tool_calls_panel()
|
||||
imgui.end_tab_item()
|
||||
if show_tc_tab:
|
||||
if imgui.begin_tab_item("Tool Calls")[0]:
|
||||
self._render_tool_calls_panel()
|
||||
imgui.end_tab_item()
|
||||
if show_usage_tab:
|
||||
if imgui.begin_tab_item("Usage Analytics")[0]:
|
||||
self._render_usage_analytics_panel()
|
||||
imgui.end_tab_item()
|
||||
if not self.ui_separate_external_tools:
|
||||
if imgui.begin_tab_item("External Tools")[0]:
|
||||
self._render_external_tools_panel()
|
||||
imgui.end_tab_item()
|
||||
imgui.end_tab_bar()
|
||||
if show_usage_tab:
|
||||
if imgui.begin_tab_item("Usage Analytics")[0]:
|
||||
self._render_usage_analytics_panel()
|
||||
imgui.end_tab_item()
|
||||
if not self.ui_separate_external_tools:
|
||||
if imgui.begin_tab_item("External Tools")[0]:
|
||||
self._render_external_tools_panel()
|
||||
imgui.end_tab_item()
|
||||
imgui.end_tab_bar()
|
||||
imgui.end()
|
||||
|
||||
if self.ui_separate_message_panel and self.show_windows.get("Message", False):
|
||||
@@ -2105,10 +2092,31 @@ class App:
|
||||
if exp:
|
||||
if imgui.begin_tab_bar('session_hub_tabs'):
|
||||
if imgui.begin_tab_item('Aggregate MD')[0]:
|
||||
display_md = self.last_aggregate_markdown
|
||||
if self.ui_focus_agent:
|
||||
tier_usage = self.mma_tier_usage.get(self.ui_focus_agent)
|
||||
if tier_usage:
|
||||
persona_name = tier_usage.get("persona")
|
||||
if persona_name:
|
||||
persona = self.controller.personas.get(persona_name)
|
||||
if persona and persona.context_preset:
|
||||
cp_name = persona.context_preset
|
||||
if cp_name in self._focus_md_cache:
|
||||
display_md = self._focus_md_cache[cp_name]
|
||||
else:
|
||||
# Generate focused aggregate
|
||||
flat = src.project_manager.flat_config(self.controller.project, self.active_discussion)
|
||||
cp = self.controller.project.get('context_presets', {}).get(cp_name)
|
||||
if cp:
|
||||
flat["files"]["paths"] = cp.get("files", [])
|
||||
flat["screenshots"]["paths"] = cp.get("screenshots", [])
|
||||
full_md, _, _ = src.aggregate.run(flat)
|
||||
self._focus_md_cache[cp_name] = full_md
|
||||
display_md = full_md
|
||||
if imgui.button("Copy"):
|
||||
imgui.set_clipboard_text(self.last_aggregate_markdown)
|
||||
imgui.set_clipboard_text(display_md)
|
||||
imgui.begin_child("last_agg_md", imgui.ImVec2(0, 0), True)
|
||||
markdown_helper.render(self.last_aggregate_markdown, context_id="session_hub_agg")
|
||||
markdown_helper.render(display_md, context_id="session_hub_agg")
|
||||
imgui.end_child()
|
||||
imgui.end_tab_item()
|
||||
if imgui.begin_tab_item('System Prompt')[0]:
|
||||
@@ -2404,12 +2412,24 @@ def hello():
|
||||
self.ui_disc_new_role_input = ""
|
||||
imgui.separator()
|
||||
imgui.begin_child("disc_scroll", imgui.ImVec2(0, 0), False)
|
||||
|
||||
# Filter entries based on focused agent persona
|
||||
display_entries = self.disc_entries
|
||||
if self.ui_focus_agent:
|
||||
tier_usage = self.mma_tier_usage.get(self.ui_focus_agent)
|
||||
if tier_usage:
|
||||
persona_name = tier_usage.get("persona")
|
||||
if persona_name:
|
||||
# Show User messages and the focused agent's responses
|
||||
display_entries = [e for e in self.disc_entries if e.get("role") == persona_name or e.get("role") == "User"]
|
||||
|
||||
clipper = imgui.ListClipper()
|
||||
clipper.begin(len(self.disc_entries))
|
||||
clipper.begin(len(display_entries))
|
||||
while clipper.step():
|
||||
for i in range(clipper.display_start, clipper.display_end):
|
||||
entry = self.disc_entries[i]
|
||||
imgui.push_id(str(i))
|
||||
entry = display_entries[i]
|
||||
# Use the index in the original list for ID if possible, but here i is index in display_entries
|
||||
imgui.push_id(f"disc_{i}")
|
||||
collapsed = entry.get("collapsed", False)
|
||||
read_mode = entry.get("read_mode", False)
|
||||
if imgui.button("+" if collapsed else "-"):
|
||||
@@ -3435,6 +3455,24 @@ def hello():
|
||||
|
||||
def _render_mma_dashboard(self) -> None:
|
||||
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_mma_dashboard")
|
||||
|
||||
# Focus Agent dropdown
|
||||
imgui.text("Focus Agent:")
|
||||
imgui.same_line()
|
||||
focus_label = self.ui_focus_agent or "All"
|
||||
if imgui.begin_combo("##focus_agent", focus_label, imgui.ComboFlags_.width_fit_preview):
|
||||
if imgui.selectable("All", self.ui_focus_agent is None)[0]:
|
||||
self.ui_focus_agent = None
|
||||
for tier in ["Tier 2", "Tier 3", "Tier 4"]:
|
||||
if imgui.selectable(tier, self.ui_focus_agent == tier)[0]:
|
||||
self.ui_focus_agent = tier
|
||||
imgui.end_combo()
|
||||
imgui.same_line()
|
||||
if self.ui_focus_agent:
|
||||
if imgui.button("x##clear_focus"):
|
||||
self.ui_focus_agent = None
|
||||
imgui.separator()
|
||||
|
||||
is_nerv = theme.is_nerv_active()
|
||||
if self.is_viewing_prior_session:
|
||||
c = vec4(255, 200, 100)
|
||||
|
||||
Reference in New Issue
Block a user