Add SSDL-style docstrings to RAG, System Prompts, Provider, and Persona selector panels
This commit is contained in:
+77
-2
@@ -310,8 +310,6 @@ class App:
|
||||
|
||||
SSDL Shape:
|
||||
`[I:init_controller] -> [I:init_workspace] -> [I:load_profiles]`
|
||||
|
||||
[C: src/mcp_client.py:_DDGParser.__init__, src/mcp_client.py:_TextExtractor.__init__]
|
||||
"""
|
||||
# --- Core Dependencies & State ---
|
||||
from src.startup_profiler import startup_profiler
|
||||
@@ -2174,6 +2172,15 @@ def render_log_management(app: App) -> None:
|
||||
#region: Project Management
|
||||
|
||||
def render_project_settings_hub(app: App) -> None:
|
||||
"""
|
||||
Renders the Project Settings Hub containing tabs for project lists and paths.
|
||||
|
||||
State Mutations:
|
||||
None directly (delegated to sub-panels).
|
||||
|
||||
SSDL Shape:
|
||||
`[I] -> [B:tabs] => [I:sub-panel]`
|
||||
"""
|
||||
with imscope.tab_bar('context_hub_tabs'):
|
||||
with imscope.tab_item('Projects') as (exp, _):
|
||||
if exp: render_projects_panel(app)
|
||||
@@ -2181,6 +2188,23 @@ def render_project_settings_hub(app: App) -> None:
|
||||
if exp: render_paths_panel(app)
|
||||
|
||||
def render_projects_panel(app: App) -> None:
|
||||
"""
|
||||
Renders the project configuration panel. Allows setting execution mode,
|
||||
repository path, output directory, managing projects, and layout wrapping/scrolling behavior.
|
||||
|
||||
State Mutations:
|
||||
app.ui_project_execution_mode
|
||||
app.ui_project_git_dir
|
||||
app.ui_output_dir
|
||||
app.ui_project_conductor_dir
|
||||
app.project_paths
|
||||
app.ui_word_wrap
|
||||
app.ui_auto_scroll_comms
|
||||
app.ui_auto_scroll_tool_calls
|
||||
|
||||
SSDL Shape:
|
||||
`[I:active_project] -> [B:execution_mode] -> [B:directories] -> [I:project_files] -> [B:project_actions] -> [B:toggles]`
|
||||
"""
|
||||
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_projects_panel")
|
||||
proj_name = app.project.get("project", {}).get("name", Path(app.active_project_path).stem)
|
||||
imgui.text_colored(C_IN(), f"Active: {proj_name}")
|
||||
@@ -2334,6 +2358,16 @@ def render_ai_settings_hub(app: App) -> None:
|
||||
render_agent_tools_panel(app)
|
||||
|
||||
def render_rag_panel(app: App) -> None:
|
||||
"""
|
||||
Renders RAG configuration panel, exposing switches, provider selection, chunking parameters,
|
||||
and index rebuild triggers.
|
||||
|
||||
State Mutations:
|
||||
app.controller.rag_config (provider, embedding, chunk size, overlap)
|
||||
|
||||
SSDL Shape:
|
||||
`[I:config] -> [B:rag_switch] -> [B:combo_selectors] -> [B:chunking_inputs] => [B:rebuild_index]`
|
||||
"""
|
||||
conf = app.controller.rag_config
|
||||
if not conf: return
|
||||
ch, conf.enabled = imgui.checkbox("Enable RAG", conf.enabled)
|
||||
@@ -2371,6 +2405,19 @@ def render_rag_panel(app: App) -> None:
|
||||
if imgui.button("Rebuild Index"): app.controller.event_queue.put('click', 'btn_rebuild_rag_index')
|
||||
|
||||
def render_system_prompts_panel(app: App) -> None:
|
||||
"""
|
||||
Renders the System Prompts panel, exposing global and project-specific prompt selection,
|
||||
editing boxes, base prompt defaults, and diff comparisons.
|
||||
|
||||
State Mutations:
|
||||
app.controller.ui_global_preset_name, app.controller.ui_project_preset_name
|
||||
app.ui_global_system_prompt, app.ui_project_system_prompt
|
||||
app.ui_base_system_prompt, app.ui_use_default_base_prompt
|
||||
app.show_preset_manager_window (to open modal)
|
||||
|
||||
SSDL Shape:
|
||||
`[I:presets] -> [B:global_preset] -> [B:base_preset_customizer] -> [B:project_preset]`
|
||||
"""
|
||||
imgui.text("Global System Prompt (all projects)")
|
||||
preset_names = sorted(app.controller.presets.keys())
|
||||
current_global = app.controller.ui_global_preset_name or "Select Preset..."
|
||||
@@ -2503,6 +2550,18 @@ def render_agent_tools_panel(app: App) -> None:
|
||||
imgui.tree_pop()
|
||||
|
||||
def render_provider_panel(app: App) -> None:
|
||||
"""
|
||||
Renders the LLM provider configuration panel. Allows selection of API providers,
|
||||
active models, hyper-parameters (temperature, max tokens, Top-P), history limits, and Gemini CLI binaries.
|
||||
|
||||
State Mutations:
|
||||
app.current_provider, app.current_model
|
||||
app.temperature, app.max_tokens, app.top_p, app.history_trunc_limit
|
||||
app.ui_gemini_cli_path
|
||||
|
||||
SSDL Shape:
|
||||
`[I:providers] -> [B:provider_combo] -> [B:model_listbox] -> [B:parameters_sliders] => [B:cli_path_browse]`
|
||||
"""
|
||||
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_provider_panel")
|
||||
imgui.text("Provider")
|
||||
if imgui.begin_combo("##prov", app.current_provider):
|
||||
@@ -2581,6 +2640,22 @@ def render_provider_panel(app: App) -> None:
|
||||
if app.perf_profiling_enabled: app.perf_monitor.end_component("_render_provider_panel")
|
||||
|
||||
def render_persona_selector_panel(app: App) -> None:
|
||||
"""
|
||||
Renders the Persona Selection panel. Allows selecting profiles, editing persona definitions,
|
||||
overriding system parameters (models, presets, prompts, bias profiles) and loading preset contexts.
|
||||
|
||||
State Mutations:
|
||||
app.ui_active_persona, app._editing_persona_name, app._editing_persona_system_prompt,
|
||||
app._editing_persona_tool_preset_id, app._editing_persona_bias_profile_id,
|
||||
app._editing_persona_context_preset_id, app._editing_persona_aggregation_strategy,
|
||||
app._editing_persona_preferred_models_list, app._editing_persona_is_new,
|
||||
app.current_provider, app.current_model, app.temperature, app.max_tokens,
|
||||
app.history_trunc_limit, app.ui_project_system_prompt, app.ui_active_tool_preset,
|
||||
app.ui_active_bias_profile, app.ui_active_context_preset, app.show_persona_editor_window
|
||||
|
||||
SSDL Shape:
|
||||
`[I:personas] -> [B:persona_combo] => [B:manage_personas]`
|
||||
"""
|
||||
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_persona_selector_panel")
|
||||
imgui.text("Persona")
|
||||
if not hasattr(app, 'ui_active_persona'): app.ui_active_persona = ""
|
||||
|
||||
Reference in New Issue
Block a user