style(ops): Refine Usage Analytics layout with section titles and separators

This commit is contained in:
2026-03-09 23:34:08 -04:00
parent 8a83d22967
commit 322f42db74
3 changed files with 63 additions and 56 deletions

View File

@@ -1788,7 +1788,7 @@ def hello():
def _render_token_budget_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_token_budget_panel")
imgui.text("Session Telemetry")
imgui.text_colored(C_LBL, 'Prompt Utilization')
usage = self.session_usage
total = usage["input_tokens"] + usage["output_tokens"]
if total == 0 and usage.get("total_tokens", 0) > 0:
@@ -1929,9 +1929,8 @@ def hello():
def _render_tool_analytics_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_tool_analytics_panel")
if not imgui.collapsing_header("Tool Usage Analytics"):
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_tool_analytics_panel")
return
imgui.text_colored(C_LBL, 'Tool Usage')
imgui.separator()
now = time.time()
if not hasattr(self, '_tool_stats_cache_time') or now - self._tool_stats_cache_time > 1.0:
self._cached_tool_stats = getattr(self.controller, '_tool_stats', {})
@@ -1970,9 +1969,8 @@ def hello():
def _render_session_insights_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_session_insights_panel")
if not imgui.collapsing_header("Session Insights"):
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_session_insights_panel")
return
imgui.text_colored(C_LBL, 'Session Insights')
imgui.separator()
insights = self.controller.get_session_insights()
imgui.text(f"Total Tokens: {insights.get('total_tokens', 0):,}")
imgui.text(f"API Calls: {insights.get('call_count', 0)}")
@@ -1987,7 +1985,9 @@ def hello():
def _render_usage_analytics_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_usage_analytics_panel")
self._render_token_budget_panel()
imgui.separator()
self._render_tool_analytics_panel()
imgui.separator()
self._render_session_insights_panel()
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_usage_analytics_panel")