Private
Public Access
0
0

Refactor gui_2.py docstrings to use concise SSDL shape annotations

Remove verbose Threading & Safety sections and simplify DAG descriptions using composable shapes SSDL.
This commit is contained in:
2026-06-12 21:33:37 -04:00
parent 56e1950b4b
commit 58a62a3824
+10 -49
View File
@@ -989,15 +989,8 @@ class App:
Reverts the application UI state to the previous snapshot in the history stack.
State Mutations:
self.history (mutated to record index changes)
Modifies active UI variables via _apply_snapshot()
DAG Render Context:
Called by: _gui_func() (via hotkey Ctrl+Z) or undo button click.
Calls: _take_snapshot(), _apply_snapshot(), HistoryManager.undo()
Threading & Safety:
Must run synchronously on the Main Thread.
Reverts state via history stack.
Shape: `[I:snapshot] -> [B:history] => [I:state]`
"""
sys.stderr.write(f"[DEBUG History] _handle_undo called. can_undo={self.history.can_undo}\n")
sys.stderr.flush()
@@ -1845,18 +1838,8 @@ def render_usage_analytics_panel(app: App) -> None:
def render_diagnostics_panel(app: App) -> None:
"""
Renders the Diagnostics panel, displaying performance telemetry metrics.
Shows frame time, FPS, event queue throughput, and memory usage.
State Mutations:
Updates app.perf_profiling_enabled and visibility in app.show_windows["Diagnostics"].
DAG Context / Render Flow:
Called by: render_main_interface()
Calls: app.perf_monitor.get_metrics()
Threading & Safety:
Must run synchronously on the Main Thread.
Renders the Diagnostics panel.
Shape: `[I] -> [B:perf_metrics] => [I:detailed_timings]`
"""
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_diagnostics_panel")
with imscope.window("Diagnostics", app.show_windows.get("Diagnostics", False)) as (exp, opened):
@@ -2354,21 +2337,9 @@ def render_path_field(label: str, attr: str, key: str, tooltip: str):
def render_ai_settings_hub(app: App) -> None:
"""
Groups and renders all AI-related configuration panels in a unified hub sidebar.
Includes persona selection, LLM provider settings, system prompts, RAG switches, and tools.
State Mutations:
None directly (delegated to child panels).
DAG Context / Render Flow:
Called by: render_main_interface()
Calls: render_persona_selector_panel(), render_provider_panel(),
render_system_prompts_panel(), render_rag_panel(),
render_agent_tools_panel()
Threading & Safety:
Must run synchronously on the Main Thread.
"""
Groups/renders all AI config panels (personas, models, prompts, RAG, tools).
Shape: `[I] -> [B:headers] => [I:sub-panels]`
"""
render_persona_selector_panel(app)
if imgui.collapsing_header("Provider & Model"): render_provider_panel(app)
if imgui.collapsing_header("System Prompts"): render_system_prompts_panel(app)
@@ -2466,19 +2437,9 @@ def render_system_prompts_panel(app: App) -> None:
def render_agent_tools_panel(app: App) -> None:
"""
Renders active tool presets and configuration options.
Allows selecting tool presets, toggling individual capability flags, and showing bias managers.
State Mutations:
Modifies app.ui_active_tool_preset and local UI flags.
DAG Context / Render Flow:
Called by: render_ai_settings_hub()
Calls: app._get_active_capabilities()
Threading & Safety:
Must run synchronously on the Main Thread.
"""
Renders active tool presets and configuration options.
Shape: `[Q:caps] -> [B:tool_calling] => [S:preset]`
"""
caps = app._get_active_capabilities()
if not caps.tool_calling:
if imgui.collapsing_header("Active Tool Presets & Biases", imgui.TreeNodeFlags_.default_open):