Private
Public Access
0
0

more ascii (gemini ran out already...)v

This commit is contained in:
2026-06-12 22:26:07 -04:00
parent fc2171a40f
commit 443f02a744
+92 -51
View File
@@ -3377,13 +3377,23 @@ def render_files_and_media(app: App) -> None:
Renders the inventory of files and screenshots. Allows adding files or directories to the inventory
and attaching files or screenshots to the active context.
State Mutations:
app.files (updates inventory)
app.context_files (appends new files)
app.screenshots (appends or removes screenshot image paths)
SSDL Shape:
`[I:inventory] -> [B:add_files_folders] -> [I:screenshots] => [B:add_screenshots]`
ASCII Layout Map:
+---------------------------------------------------------+
| Files collapsing header |
| +---------------------------------------------------+ |
| | [Act] [Path] [Status] | |
| | [+] src/gui_2.py Active | |
| +---------------------------------------------------+ |
| [Add Files to Inventory] [Add Directory] |
| Screenshots collapsing header |
| +---------------------------------------------------+ |
| | [x] /path/to/screenshot1.png | |
| +---------------------------------------------------+ |
| [Add Screenshots] |
+---------------------------------------------------------+
"""
if imgui.collapsing_header("Files", imgui.TreeNodeFlags_.default_open):
with imscope.group():
@@ -3476,15 +3486,15 @@ def render_context_batch_actions(app: App, total_lines: int, total_ast: int) ->
Renders a batch actions control bar. Allows batch-changing view modes of selected files,
selecting/deselecting all, adding files, and generating context preview markdown.
State Mutations:
app.context_files[index].view_mode (batch sets view modes)
app.ui_selected_context_files (selects or clears selection set)
app.context_files (updates context files list)
app.context_preview_text (stores preview markdown)
app.show_windows["Context Preview"]
SSDL Shape:
`[I:context_files] -> [B:mode_batch_buttons] -> [B:selection_buttons] -> [B:all_add_del] => [B:preview]`
ASCII Layout Map:
+---------------------------------------------------------+
| Batch: [Full] [Summary] [Skeleton] [Outline] [Masked] |
| [Sel All] [Unsel All] [Add Files] [Add All] [Del] |
| [Preview] | Total: X files, Y lines, Z AST elements |
+---------------------------------------------------------+
"""
imgui.text("Batch:")
for mode in ["full", "summary", "skeleton", "outline", "masked", "none"]:
@@ -3539,12 +3549,20 @@ 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]`
ASCII Layout Map:
+---------------------------------------------------------+
| Select Context Files [X] |
+---------------------------------------------------------+
| Select files from project to add to context: |
| +-----------------------------------------------------+ |
| | [ ] src/gui_2.py | |
| | [x] src/models.py | |
| +-----------------------------------------------------+ |
| [Add Selected] [Cancel] |
+---------------------------------------------------------+
"""
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:")
@@ -3587,14 +3605,10 @@ def render_context_composition_panel(app: App) -> None:
Renders the Context Composition panel containing loaded project files, presets,
and visual screenshot files. Displays token stats, batch files actions, and collapsible trees.
State Mutations:
app.context_files (adds/removes file records)
app.screenshots (adds/removes screen image attachments)
SSDL Shape:
`[I:stats] -> [I:batch_actions] -> [I:files_table] -> [I:presets] -> [I:screenshots]`
ASCII Layout Preview:
ASCII Layout Map:
+-------------------------------------------------------------+
| > Context Composition |
| [Presets v] [Add Files] [Batch Actions] |
@@ -3623,15 +3637,10 @@ def render_ast_inspector_modal(app: App) -> None:
Provides an interactive tree-sitter AST inspector to mask classes, methods, or
functions and extract custom annotated slices (Definition, Signature, Hide).
State Mutations:
app.show_structural_editor_modal (set to False when opened)
app.ui_editing_slices_file.ast_mask (mutated on node click)
app.ui_editing_slices_file.custom_slices (mutated on slice modification)
SSDL Shape:
`[B:open_modal?] -> [Q:outline] -> [I:render_ast_tree]`
ASCII Layout Preview:
ASCII Layout Map:
+-------------------------------------------------------------+
| Structural File Editor: src/gui_2.py [X] |
+-------------------------------------------------------------+
@@ -3846,12 +3855,17 @@ 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]`
ASCII Layout Map:
+---------------------------------------------------------+
| Save Workspace Profile [X] |
+---------------------------------------------------------+
| Name: [ ] |
| Scope: (o) Project ( ) Global |
| [Save] [Cancel] |
+---------------------------------------------------------+
"""
if app._show_save_workspace_profile_modal:
imgui.open_popup("Save Workspace Profile")
@@ -3884,12 +3898,16 @@ def render_context_presets_panel(app: App) -> None:
Renders the Context Presets configuration panel. Enables naming, saving, loading,
and deleting context presets.
State Mutations:
app.ui_new_context_preset_name (stores input preset name)
app.controller.project['context_presets'] (saves new presets)
SSDL Shape:
`[I:presets_list] -> [B:save_new_preset] => [B:presets_action_buttons]`
ASCII Layout Map:
+---------------------------------------------------------+
| Context Presets |
| Preset Name: [ ] [Save Current] |
| ------------------------------------------------------- |
| my-preset (2 files, 0 shots) [Load] [Delete]|
+---------------------------------------------------------+
"""
imgui.text_colored(C_IN(), "Context Presets")
imgui.separator()
@@ -3916,11 +3934,14 @@ def render_context_screenshots(app: App) -> None:
"""
Renders a list of the currently attached screenshot image files.
State Mutations:
None directly.
SSDL Shape:
`[I:screenshots]`
ASCII Layout Map:
+---------------------------------------------------------+
| /path/to/screenshot_1.png |
| /path/to/screenshot_2.png |
+---------------------------------------------------------+
"""
for i, s in enumerate(app.screenshots): imgui.text(s)
@@ -3929,14 +3950,10 @@ def render_context_files_table(app: App) -> None:
Renders a two-column table mapping active context files to their AST view modes
(Definition, Signature, Hide) and slice indicators. Grouped by directories.
State Mutations:
app.context_files[index].view_mode (Def/Sig/Hide)
app.context_files (elements removed via delete action)
SSDL Shape:
`[I:group_by_dir] -> o-> [I:dir_node] -> o-> [I:file_row]`
ASCII Layout Preview:
ASCII Layout Map:
+-------------------------------------------------------------+
| File | Flags |
+--------------------------------------+----------------------+
@@ -4049,13 +4066,15 @@ def render_context_presets(app: App) -> None:
"""
Renders context preset management controls (combobox selector, update button, save-as, and delete active).
State Mutations:
app.ui_active_context_preset (updates active context preset name)
app.ui_new_context_preset_name (stores input name)
app.controller (saves or deletes presets)
SSDL Shape:
`[I:presets] -> [B:presets_combo] -> [B:save_as_button] => [B:delete_active]`
ASCII Layout Map:
+---------------------------------------------------------+
| [Presets Combo v] | [Update] |
| [New Preset Input ] | [Save As] |
| | [Delete Active] |
+---------------------------------------------------------+
"""
presets = app.controller.project.get('context_presets', {})
preset_names = [""] + sorted(presets.keys())
@@ -4148,11 +4167,18 @@ def render_snapshot_tab(app: App) -> None:
"""
Renders the Snapshot tab-bar, containing the resolved aggregate markdown and active system prompts.
State Mutations:
app._focus_md_cache (caches aggregated markdown per persona)
SSDL Shape:
`[I:aggregate_text] -> [B:copy_buttons] => [I:preview_panes]`
ASCII Layout Map:
+---------------------------------------------------------+
| [Aggregate MD] [System Prompt] |
| ------------------------------------------------------- |
| [Copy] |
| +-----------------------------------------------------+ |
| | Resolved Markdown Content... | |
| +-----------------------------------------------------+ |
+---------------------------------------------------------+
"""
with imscope.tab_bar("snapshot_tabs"):
with imscope.tab_item("Aggregate MD") as (exp, _):
@@ -4187,6 +4213,21 @@ def render_snapshot_tab(app: App) -> None:
markdown_helper.render(app.last_resolved_system_prompt, context_id="snapshot_sys")
def render_empty_context_modal(app: App) -> None:
"""
Renders a popup modal warning the user when the context composition is empty.
SSDL Shape:
`[I:warning_text] -> [B:proceed_button] => [B:cancel_button]`
ASCII Layout Map:
+---------------------------------------------------------+
| Empty Context Warning [X] |
+---------------------------------------------------------+
| WARNING: Empty Context Composition |
| You are attempting to generate a response... |
| [Proceed Anyway] [Cancel] |
+---------------------------------------------------------+
"""
if app.show_empty_context_modal:
imgui.open_popup("Empty Context Warning")
app.show_empty_context_modal = False