Private
Public Access
0
0

chore(conductor): Add new track 'command_palette_and_performance_20260602'

This commit is contained in:
2026-06-02 17:51:34 -04:00
parent 8f6f47d46b
commit 7eb8f9eed4
9 changed files with 111 additions and 633 deletions
+5
View File
@@ -325,3 +325,8 @@ This file tracks all major tracks for the project. Each track has its own detail
- [x] **Track: Phase 7 Monolithic Stabilization (Final Cleanup)**
*Link: [./tracks/phase7_monolithic_stabilization_20260602/](./tracks/phase7_monolithic_stabilization_20260602/)*
---
- [ ] **Track: Implement Async Context Preview to fix UI hangs and add an 'Everything' Command Palette.**
*Link: [./tracks/command_palette_and_performance_20260602/](./tracks/command_palette_and_performance_20260602/)*
@@ -0,0 +1,5 @@
# Track command_palette_and_performance_20260602 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)
@@ -0,0 +1,8 @@
{
"track_id": "command_palette_and_performance_20260602",
"type": "feature",
"status": "new",
"created_at": "2026-06-02T00:00:00Z",
"updated_at": "2026-06-02T00:00:00Z",
"description": "Implement Async Context Preview to fix UI hangs and add an 'Everything' Command Palette."
}
@@ -0,0 +1,30 @@
# Implementation Plan: Command Palette & UI Performance Fixes
## Phase 1: Offloading Performance Fixes
- [ ] Task: Async Context Preview
- [ ] Add `self._is_generating_preview = False` to `App.__init__`.
- [ ] Modify `_check_auto_refresh_context_preview` in `src/gui_2.py`.
- [ ] Implement a `worker()` function inside it that runs `app.controller._do_generate()` and updates `app.context_preview_text`.
- [ ] Launch this worker via `threading.Thread` only if `not self._is_generating_preview`.
- [ ] Ensure thread-safe state updates using appropriate flags.
## Phase 2: Command Palette Implementation
- [ ] Task: Define Command Registry
- [ ] Create a list of dictionaries in `App` containing `name`, `desc`, and `callback`.
- [ ] Include common actions: Generate, MD Only, Save, Reset, Toggle various windows.
- [ ] Task: Render Command Palette UI
- [ ] Add `self.show_command_palette = False` and `self.ui_command_search = ""` to `App`.
- [ ] In `render_main_interface`, check for `Ctrl+P` (or `Cmd+P`) to toggle `self.show_command_palette`.
- [ ] Create `render_command_palette(app: App)` function.
- [ ] Use `imgui.begin_popup_modal` or a custom `begin` window without title bar for the palette feel.
- [ ] Implement the filter logic using the search string.
- [ ] Task: Keyboard Interactivity
- [ ] Ensure the search field has focus when opened.
- [ ] Handle `imgui.Key.up_arrow` and `imgui.Key.down_arrow` to navigate the list.
- [ ] Execute the selected command on `imgui.Key.enter`.
## Phase 3: Verification
- [ ] Task: Verification
- [ ] Verify no UI hang when toggling AST nodes.
- [ ] Verify Command Palette opens, filters correctly, and executes actions.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Verification' (Protocol in workflow.md)
@@ -0,0 +1,28 @@
# Specification: Command Palette & UI Performance Fixes
## 1. Overview
This track addresses two distinct but critical areas:
1. **UI Performance (Fix):** The application currently hangs when users adjust AST or slice configurations. This is because the context preview is regenerated synchronously on the GUI thread, blocking all interactions.
2. **Command Palette (Feature):** A central, keyboard-driven interface for all application actions, similar to professional editors like VSCode or Sublime Text.
## 2. Functional Requirements
### 2.1 Async Context Preview
* **Background Generation:** The `_do_generate` call within `_check_auto_refresh_context_preview` must be offloaded to an asynchronous worker thread.
* **State Locking:** Prevent multiple concurrent generation threads from running if a preview refresh is already in progress.
* **Incremental Signaling:** (Optional future goal) Investigate ways to only re-parse the affected file, but offloading is the immediate priority.
### 2.2 Everything Command Palette
* **Shortcut Trigger:** Triggered by `Ctrl+P` (global project context).
* **Fuzzy Search:** An input field that filters a global list of available commands.
* **Action Mapping:** Includes actions like "Generate Response", "Clear Discussion", "Toggle Diagnostics", "Add All Files to Context", etc.
* **Keyboard Navigation:** Use Up/Down arrows to navigate results and Enter to select/execute.
* **Modal UX:** A centered, floating popup that dismisses on selection or Escape.
## 3. Non-Functional Requirements
* **Smooth GUI Loop:** Offloading the generation must eliminate the UI hang.
* **Low Latency Palette:** Search and filtering must feel instantaneous.
## 4. Acceptance Criteria
* Toggling "Def", "Sig", or "Hide" on an AST node no longer causes the GUI to stutter or hang.
* Pressing `Ctrl+P` opens the Command Palette.
* Typing "Reset" shows "Reset Session" and executing it successfully resets the discussion.