feat(sidebar): support multi-select conversation deletion#225
feat(sidebar): support multi-select conversation deletion#225NotToday1024 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds multi-select conversation deletion to the chat history sidebar in both the Tauri GUI frontend and the Gateway WebUI, including keyboard range/toggle selection and a shared serial batch-delete helper.
Changes:
- Introduces shared sidebar helpers for selection state (
selection.ts) and serial batch deletion (batchDelete.ts), mirrored across GUI/WebUI. - Updates both ChatHistorySidebar implementations to support selection mode UI, Shift/Ctrl/Command selection gestures, and a single batch confirmation flow with retry-on-failure behavior.
- Adds focused tests in both frontends to cover selection reconciliation and batch delete continuation behavior, plus new i18n strings for the selection/delete UI.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/mirror-manifest.json | Adds the new mirrored sidebar helper modules to the mirror manifest. |
| crates/agent-gui/test/chat/sidebar-selection.test.mjs | Adds GUI tests for multi-select selection behavior and serial batch delete continuation. |
| crates/agent-gui/src/pages/chat/sidebar/ChatSidebarContainer.tsx | Wires bulk deletion handler into the GUI sidebar container using the new batch-delete helper. |
| crates/agent-gui/src/lib/sidebar/selection.ts | Implements sidebar selection updates (toggle, range, additive range) and reconciliation. |
| crates/agent-gui/src/lib/sidebar/batchDelete.ts | Implements serial deletion with per-item success/failure aggregation. |
| crates/agent-gui/src/i18n/config.ts | Adds GUI i18n strings for selection mode and bulk delete confirmation text. |
| crates/agent-gui/src/components/chat/ChatHistorySidebar.tsx | Adds selection mode UI/UX, keyboard handling, and batch-delete confirmation + retry selection behavior in the GUI sidebar. |
| crates/agent-gateway/web/test/sidebar-selection.test.mjs | Adds WebUI tests for selection behavior and serial batch delete continuation. |
| crates/agent-gateway/web/src/lib/sidebar/selection.ts | Adds the mirrored selection helper to the WebUI codebase. |
| crates/agent-gateway/web/src/lib/sidebar/batchDelete.ts | Adds the mirrored batch-delete helper to the WebUI codebase. |
| crates/agent-gateway/web/src/i18n/config.ts | Adds WebUI i18n strings for selection mode and bulk delete confirmation text. |
| crates/agent-gateway/web/src/components/chat/ChatHistorySidebar.tsx | Adds selection mode UI/UX, mobile handling, and batch-delete confirmation + retry selection behavior in the WebUI sidebar. |
| crates/agent-gateway/web/src/app/sidebar/GatewaySidebarContainer.tsx | Wires bulk deletion handler into the Gateway sidebar container, including local-draft handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const result = await handleDeleteConversations(ids); | ||
| const failedIds = result.failedIds.filter((id) => orderedConversationIds.includes(id)); | ||
| setSelectedConversationIds(new Set(failedIds)); |
| const result = await handleDeleteConversations(ids); | ||
| const failedIds = result.failedIds.filter((id) => orderedConversationIds.includes(id)); | ||
| setSelectedConversationIds(new Set(failedIds)); |
|
Pushed 455ad5a addressing two review follow-ups on both frontends: Escape scoping — the selection-mode Cancellable bulk delete — previously the X button and Escape were disabled during
Added a |
The selection-mode Escape listener now ignores events from INPUT/TEXTAREA/ contentEditable targets and already-handled (defaultPrevented) events, so Escape in the composer or a closing popup no longer exits selection mode. Bulk deletion is cancellable mid-batch: deleteSidebarConversations accepts a shouldStop callback (unattempted ids surface as skippedIds), and the sidebar keeps the cancel button and Escape enabled while deleting. Exiting selection mode bumps a run token that stops the serial loop between items and marks the in-flight continuation stale, so a hung delete can no longer lock the selection UI.
455ad5a to
0c716be
Compare
Closes #211
Summary
Select multipleentry to the conversation sidebar, with a tooltip that advertises the supported shortcuts.Shiftrange selection,Ctrl/Commandtoggle selection, andCtrl/Command+Shiftadditive ranges.Design Notes
Verification
pnpm buildincrates/agent-guipnpm lintincrates/agent-gui(exit 0; existing repository warnings only)pnpm test:frontendincrates/agent-gui(1147 passed)pnpm buildincrates/agent-gateway/webpnpm lintincrates/agent-gateway/web(exit 0; existing repository warnings only)pnpm testincrates/agent-gateway/web(380 passed)go test ./...incrates/agent-gatewaywith Go 1.25.12 (passed)node scripts/check-mirror.mjs(97 mirrored files passed)git diff origin/main...HEAD --checkcargo check --manifest-path crates/agent-gui/src-tauri/Cargo.toml --testswas not run locally because this environment does not have Cargo or the required WebKit/AppIndicator development packages; the repository Tauri CI job will run it.No protobuf files were changed, so
make protois not required.