feat(desktop): add "Delete all chats" button to the chat sidebar - #55957
feat(desktop): add "Delete all chats" button to the chat sidebar#55957MaxFreedomPollard wants to merge 1 commit into
Conversation
|
Thanks for building this on the existing explicit-ID bulk-delete endpoint. The requested affordance is still absent on current main: the recents header currently has only the new-chat and folder/list controls ( Problems
Suggested changes
This is an automated hermes-sweeper review. |
121a682 to
6c81c9a
Compare
80c79a9 to
2c566f2
Compare
Re-ported onto the contribution shell after desktop-controller was retired. Bulk delete now routes through the same remote-profile split as single-session mutations (body scope stripped for per-profile remote overrides, global-remote scoping preserved), and clearAllSessions reconciles the session list in a finally so a failed later batch cannot strand optimistic removals. Includes partial-success/later-failure regression coverage.
2c566f2 to
7d1b4ce
Compare
|
Rebased onto current main at 7d1b4ce. This one needed more than a mechanical conflict resolution, so noting what changed. Main has removed the per-profile session totals that this branch leaned on. The store comment explains why: rendering The confirm dialog used
The test file used Separately, The i18n side is a straight both-sides merge: main's
|
Re-ported onto the contribution shell (desktop-controller was retired in 369d0ee) and extended per the sweeper review:
Feature: a hover-revealed destructive trash action in the recents header opens a ConfirmDialog; on confirm,
clearAllSessionspages the active scope in ≤500-id chunks through the existing explicit-IDPOST /api/sessions/bulk-deleteendpoint until empty (bounded, with a zero-progress bail), grouping ids by owning profile. The open chat is torn down to a fresh draft first and the orphaned runtime is closed in afinally— the same teardownremoveSessiondoes for a single chat, lifted to the whole list. Wiring lives inContribWiring, published through theWiringActionsbag like every other sidebar verb.Review ask 1 — remote-profile mutation contract:
interceptSessionRequestForRemotenow has an explicitPOST /api/sessions/bulk-deletebranch mirroring the single-session mutation split: per-profile remote override → body scope stripped (delete body.profile) and posted to that profile's remote (native-db contract); global remote → profile scoping kept in query + body; local → generic routing. Declared explicitly rather than trusting the{id}-segment regex to keep matching the literalbulk-deletepath.Review ask 2 — failure-path reconciliation: the page-and-delete loop is wrapped so the session-list refresh runs in
finally; a batch that rejects after earlier optimistic removals still reconciles against the authoritative list while the rejection propagates to the dialog. New regression: page 1 succeeds, page 2 rejects → rejection surfaces, refresh ran, store equals the authoritative survivor set.Tests: upstream's existing
use-session-list-actionscases kept verbatim; the PR's cases re-ported to the currentrenderHookstyle + the partial-failure case; hermes bridge tests included. Touched files 33/33 pass; renderer/electron/e2e typechecks and eslint clean; full desktop vitest matches the upstream baseline (no attributable regressions).