Skip to content

feat(desktop): add batch delete for history panel sessions#2948

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/batch-delete-clean
Open

feat(desktop): add batch delete for history panel sessions#2948
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/batch-delete-clean

Conversation

@HUQIANTAO

Copy link
Copy Markdown
Contributor

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)

  • Add DeleteSessions(paths []string) (int, error) method that batch-deletes sessions, skips the active one, returns count of deleted sessions

Frontend

  • HistoryPanel: Selection mode with checkboxes, select-all toggle, batch delete button with two-step confirmation
  • Bridge: DeleteSessions binding + browser mock
  • Controller: deleteSessions callback
  • i18n: 6 new keys in en.ts and zh.ts
  • CSS: Styles for checkboxes, selected highlight, footer action bar, button variants

UX

  1. Click Select in the drawer header → checkboxes appear on each row
  2. Toggle individual sessions or Select all
  3. Click Delete selected (N) → confirmation prompt → batch delete
  4. Click Done to exit selection mode

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 3, 2026
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.
@HUQIANTAO HUQIANTAO force-pushed the feat/batch-delete-clean branch from 20ce306 to 0326531 Compare June 3, 2026 14:08
@esengine

esengine commented Jun 6, 2026

Copy link
Copy Markdown
Owner

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!

@esengine

Copy link
Copy Markdown
Owner

For the rebase round, one design update is required, not just conflict resolution: this predates the project-tabs work (#2925), so it guards a.ctrl's single active session — the app now holds a tab map, and batch delete must skip the active session of every open tab, not one. Also worth surfacing which paths failed when the fail-fast path returns a partial count. The frontend selection mode and the bridge contract sync both looked good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants