Add SSDL-style docstrings to base prompt diff modal, add context files modal, save workspace profile modal, context modals, and context preview window
This commit is contained in:
@@ -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 = []
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user