feat(desktop): add batch delete for history panel sessions#2948
feat(desktop): add batch delete for history panel sessions#2948HUQIANTAO wants to merge 1 commit into
Conversation
Add a selection mode to the HistoryPanel that lets users select multiple sessions and delete them in one action. The active session is never selectable (shown with a '—' indicator). Backend: Add DeleteSessions(paths) Go method that iterates paths, skips the active session, and deletes each via deleteSessionFile. Returns the count of successfully deleted sessions. Frontend: Selection mode toggles via a Select/Done button in the drawer header. Each non-current session row shows a checkbox; a footer bar provides select-all toggle and a delete-selected button with two-step confirmation (same pattern as single delete). In selection mode, clicking a row toggles the checkbox instead of resuming the session. Bridge + Controller: Added DeleteSessions binding and deleteSessions callback. Mock implementation for browser dev mode included. i18n: Added 6 keys for selection mode in en.ts and zh.ts (select, done, select all, deselect all, delete selected, confirm delete selected). CSS: Added styles for checkboxes, selected highlight, footer action bar, generic button variants, and active chip state.
20ce306 to
0326531
Compare
|
Thanks for this — the batch-delete feature looks solid (backend DeleteSessions reusing the active-session guard, plus the full frontend selection/confirm flow). Rebasing against the latest main-v2 hits conflicts in 6 files (App.tsx, HistoryPanel.tsx, bridge.ts, useController.ts, locales) because several desktop PRs have since landed in those same files. Could you rebase onto the latest main-v2? Happy to merge once it is green. Thank you! |
|
For the rebase round, one design update is required, not just conflict resolution: this predates the project-tabs work (#2925), so it guards |
Summary
Add a selection mode to the HistoryPanel that lets users select multiple sessions and delete them in one action. The active session is never selectable.
Changes
Backend (
desktop/app.go)DeleteSessions(paths []string) (int, error)method that batch-deletes sessions, skips the active one, returns count of deleted sessionsFrontend
DeleteSessionsbinding + browser mockdeleteSessionscallbackUX