Private
Public Access
0
0

chore(conductor): Add new track 'context_preservation_and_warnings_20260601'

This commit is contained in:
2026-06-01 22:41:20 -04:00
parent 8cd6e7ed55
commit 6f733a64fa
5 changed files with 52 additions and 0 deletions
+5
View File
@@ -285,3 +285,8 @@ This file tracks all major tracks for the project. Each track has its own detail
- [x] **Track: Fix MiniMax history sequencing and truncation**
*Link: [./tracks/minimax_history_fix_20260601/](./tracks/minimax_history_fix_20260601/)*
---
- [ ] **Track: Preserve context selection on discussion switch and add empty context warning**
*Link: [./tracks/context_preservation_and_warnings_20260601/](./tracks/context_preservation_and_warnings_20260601/)*
@@ -0,0 +1,5 @@
# Track context_preservation_and_warnings_20260601 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)
@@ -0,0 +1,8 @@
{
"track_id": "context_preservation_and_warnings_20260601",
"type": "bug",
"status": "new",
"created_at": "2026-06-01T00:00:00Z",
"updated_at": "2026-06-01T00:00:00Z",
"description": "Preserve context selection on discussion switch and add empty context warning"
}
@@ -0,0 +1,18 @@
# Implementation Plan: Context Preservation and Empty Warning
## Phase 1: Context State Synchronization
- [ ] Task: Sync UI state on discussion switch
- [ ] Add a `_sync_context_selection_from_controller()` method to `App` in `src/gui_2.py`. This method should clear `self.ui_selected_context_files` and repopulate it with the paths of all `FileItem`s in `self.context_files` that have `auto_aggregate == True`.
- [ ] Wrap the `AppController._switch_discussion` call in `App._switch_discussion` within `src/gui_2.py`. Update all GUI call sites to use `app._switch_discussion` instead of `app.controller._switch_discussion`.
## Phase 2: Empty Context Warning
- [ ] Task: Implement warning on generate
- [ ] In `src/gui_2.py`, within `_handle_generate_send`, add a check: if `len(self.ui_selected_context_files) == 0`, set a new flag `self.show_empty_context_warning_modal = True` and return early instead of calling `self.controller._handle_generate_send()`.
- [ ] Create a `render_empty_context_warning_modal(app: App)` function that displays an ImGui popup warning the user. It should offer "Proceed Anyway" (which then calls `app.controller._handle_generate_send()`) and "Cancel" buttons.
- [ ] Add the modal render call to `render_context_modals` (or similar modal rendering loop).
## Phase 3: Verification
- [ ] Task: Verification
- [ ] Create a discussion, select some files, create a new discussion, and verify the selection is preserved.
- [ ] Attempt to generate a response with no files selected and verify the warning modal appears.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Verification' (Protocol in workflow.md)
@@ -0,0 +1,16 @@
# Specification: Context Preservation and Empty Warning
## 1. Overview
When a user creates a new discussion or switches to an existing one, the selection state of the context files (which files are checked) is lost. This happens because the GUI's `ui_selected_context_files` set is not synchronized with the newly loaded `context_files` from the discussion snapshot. Additionally, the user requested a warning if they attempt to generate an AI response when no context files are selected.
## 2. Functional Requirements
* **State Synchronization:** When `_switch_discussion` is called in `AppController`, it must signal the GUI to reconstruct its `ui_selected_context_files` set based on the `auto_aggregate` flag of the newly loaded `FileItem` objects.
* **Empty Context Warning:** When the user clicks "Generate Response" (via `_handle_generate_send` or similar trigger), the system should check if any files are selected for aggregation. If not, it should display a warning or confirmation modal alerting the user that the context is empty.
## 3. Non-Functional Requirements
* **Performance:** The state sync should be a lightweight operation during the discussion switch lifecycle.
## 4. Acceptance Criteria
* Creating a new discussion correctly copies over the checked/unchecked state of all files in the Context Composition panel.
* Switching between past discussions restores their specific checked/unchecked file states.
* Attempting to generate a response with 0 selected files displays a clear warning in the GUI.