From 1feb9102f4bac16f8086eb45fc64f460b7f0f974 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 12 Jun 2026 22:10:40 -0400 Subject: [PATCH] Add SSDL-style docstrings to base prompt diff modal, add context files modal, save workspace profile modal, context modals, and context preview window --- project_history.toml | 2 +- src/gui_2.py | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/project_history.toml b/project_history.toml index a257b754..5e65c9cc 100644 --- a/project_history.toml +++ b/project_history.toml @@ -9,5 +9,5 @@ active = "main" [discussions.main] git_commit = "" -last_updated = "2026-06-12T22:01:30" +last_updated = "2026-06-12T22:10:33" history = [] diff --git a/src/gui_2.py b/src/gui_2.py index 2b977057..245047bb 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -2785,6 +2785,16 @@ def render_persona_selector_panel(app: App) -> None: if app.perf_profiling_enabled: app.perf_monitor.end_component("_render_persona_selector_panel") def render_base_prompt_diff_modal(app: App) -> None: + """ + Renders a popup modal showing a unified diff between the default system prompt + and the current custom base prompt. + + State Mutations: + app.controller._show_base_prompt_diff_modal (closes/hides modal) + + SSDL Shape: + `[I:unified_diff] -> [I:diff_view_box] => [B:close]` + """ if not getattr(app.controller, "_show_base_prompt_diff_modal", False): return imgui.open_popup("Base Prompt Diff") @@ -3528,6 +3538,17 @@ def render_context_batch_actions(app: App, total_lines: int, total_ast: int) -> imgui.text(f" | Total: {len(app.context_files)} files, {total_lines} lines, {total_ast} AST elements") def render_add_context_files_modal(app: App) -> None: + """ + Renders a modal popup listing files in the project inventory that can be batch-added + to the active context. + + State Mutations: + app._ui_picker_selected (maintains/clears temporary select set) + app.context_files (appends selected file items) + + SSDL Shape: + `[I:picker_list] -> [B:checkboxes] -> [B:add_selected_button] => [B:cancel_button]` + """ if imgui.begin_popup_modal("Select Context Files", None, imgui.WindowFlags_.always_auto_resize)[0]: imgui.text("Select files from project to add to context:") imgui.begin_child("ctx_picker_list", imgui.ImVec2(600, 300), True) @@ -3825,6 +3846,16 @@ def render_ast_inspector_modal(app: App) -> None: app.ui_inspecting_ast_file = None def render_save_workspace_profile_modal(app: App) -> None: + """ + Renders a popup modal for saving the current workspace profile (projects, layout, configuration). + + State Mutations: + app._new_workspace_profile_name, app._new_workspace_profile_scope + app._show_save_workspace_profile_modal (toggles visibility) + + SSDL Shape: + `[I:name_input] -> [B:scope_radio] -> [B:save_button] => [B:cancel_button]` + """ if app._show_save_workspace_profile_modal: imgui.open_popup("Save Workspace Profile") @@ -4179,6 +4210,18 @@ def render_empty_context_modal(app: App) -> None: imgui.end_popup() def render_context_modals(app: App) -> None: + """ + Dispatches rendering calls to sub-modals relating to context management + (empty context warning, file picker, missing files warning, and AST inspector). + + State Mutations: + app.show_missing_files_modal (hides/closes missing files modal) + app.ui_new_context_preset_name (resets name on save) + app.controller (saves preset) + + SSDL Shape: + `[I] -> [I:modals_dispatch]` + """ render_empty_context_modal(app) render_add_context_files_modal(app) @@ -4266,6 +4309,18 @@ def _check_auto_refresh_context_preview(app: App) -> None: app.controller.submit_io(worker) def render_context_preview_window(app: App) -> None: + """ + Renders the Context Preview window. Automatically refreshes aggregated context previews in the background + and renders formatted markdown text. + + State Mutations: + app.show_windows["Context Preview"], app.ui_separate_context_preview + app._last_context_preview_state (caches last previewed state to avoid redundant refresh) + app.context_preview_text (updates aggregation result text) + + SSDL Shape: + `[I:preview_text] -> [B:clipboard_button] => [I:preview_box]` + """ _check_auto_refresh_context_preview(app) with imscope.window("Context Preview", app.show_windows["Context Preview"]) as (exp, opened): app.show_windows["Context Preview"] = bool(opened)