From 6f733a64fa161594309426ec893dc6a36f34ef16 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 1 Jun 2026 22:41:20 -0400 Subject: [PATCH] chore(conductor): Add new track 'context_preservation_and_warnings_20260601' --- conductor/tracks.md | 5 +++++ .../index.md | 5 +++++ .../metadata.json | 8 ++++++++ .../plan.md | 18 ++++++++++++++++++ .../spec.md | 16 ++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 conductor/tracks/context_preservation_and_warnings_20260601/index.md create mode 100644 conductor/tracks/context_preservation_and_warnings_20260601/metadata.json create mode 100644 conductor/tracks/context_preservation_and_warnings_20260601/plan.md create mode 100644 conductor/tracks/context_preservation_and_warnings_20260601/spec.md diff --git a/conductor/tracks.md b/conductor/tracks.md index ebae93d9..e73fe8c5 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -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/)* diff --git a/conductor/tracks/context_preservation_and_warnings_20260601/index.md b/conductor/tracks/context_preservation_and_warnings_20260601/index.md new file mode 100644 index 00000000..4f05b4d1 --- /dev/null +++ b/conductor/tracks/context_preservation_and_warnings_20260601/index.md @@ -0,0 +1,5 @@ +# Track context_preservation_and_warnings_20260601 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) \ No newline at end of file diff --git a/conductor/tracks/context_preservation_and_warnings_20260601/metadata.json b/conductor/tracks/context_preservation_and_warnings_20260601/metadata.json new file mode 100644 index 00000000..68c5a3e9 --- /dev/null +++ b/conductor/tracks/context_preservation_and_warnings_20260601/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" +} \ No newline at end of file diff --git a/conductor/tracks/context_preservation_and_warnings_20260601/plan.md b/conductor/tracks/context_preservation_and_warnings_20260601/plan.md new file mode 100644 index 00000000..4491de1c --- /dev/null +++ b/conductor/tracks/context_preservation_and_warnings_20260601/plan.md @@ -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) \ No newline at end of file diff --git a/conductor/tracks/context_preservation_and_warnings_20260601/spec.md b/conductor/tracks/context_preservation_and_warnings_20260601/spec.md new file mode 100644 index 00000000..f112d425 --- /dev/null +++ b/conductor/tracks/context_preservation_and_warnings_20260601/spec.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. \ No newline at end of file