Skip to content

Settings: delete every archived session at once - #861

Merged
wingleeio merged 2 commits into
zeronsh:mainfrom
jdrly:archived-delete-all
Oct 14, 2026
Merged

wingleeio merged 2 commits into
zeronsh:mainfrom
jdrly:archived-delete-all

Conversation

@jdrly

@jdrly jdrly commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Archived sessions only go away one at a time, through the sidebar's context menu. Once Settings > Archived holds a hundred-plus of them, clearing the list means a hundred-plus rounds of right-click, Delete, confirm.

This adds a Delete all button to the Archived page. It asks once, with the count, then deletes every archived session.

Summary

  • Red Delete all button on Settings > Archived, bottom-aligned with the subtitle. Hidden when nothing is archived.
  • The confirmation reuses the single-session "Delete session?" card. It deletes exactly the sessions that were archived when you clicked, so anything archived while the dialog is open survives.
  • Each session goes through the existing deleteChat mutation, the same call the sidebar's Delete makes. No new RPC or wire change. Rows leave the page and the sidebar's Archived shelf as each delete lands.
  • Failed deletes are counted into one toast: "Couldn't delete N archived sessions. Try again."
  • widgets::ActionTone gains Danger: the dialogs' destructive fill at the standard settings button size.

Worth a look: the deletes run one mutation per session in a detached task, the same pattern as the sidebar's section archive. With 146 sessions that's 146 sequential calls. I kept it that way to avoid a new batch op, but I've only run it with 8.

Test plan

  • cargo test --locked -p zeron-ui --lib -- --test-threads=1 (1675 passed)
  • New delete_all_deletes_the_confirmed_archived_chats_and_reports_failures: only the confirmed archived chats get deleteChat, a chat archived after the dialog opened survives, and a rejected delete produces the toast
  • cargo clippy -p zeron-ui --lib --tests: no new warnings in touched code
  • Manual on macOS, dev build against an isolated mock engine: Delete all with 6 and 8 archived sessions, Cancel, rows leave the page and the sidebar's Archived shelf, the live session stays. Light and dark.
  • Not checked: Windows, Linux, and a synced profile with archived sessions hosted on another device

Screenshots

Screenshots and a recording follow.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Archived sessions can only be removed one at a time from the sidebar's
context menu, which is slow once the list runs into the hundreds.

- Settings > Archived gets a red Delete all button beside the subtitle.
- It opens the same confirmation as deleting a single session, naming the
  count. Confirming deletes exactly the sessions that were archived when
  the button was clicked, one deleteChat mutation each, so rows leave this
  page and the sidebar's Archived shelf as each delete lands.
- Failed deletes are counted and reported in one toast.
- Settings buttons gain a Danger tone using the dialogs' destructive fill.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jdrly

jdrly commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
delete-all.mp4
dialog-dark dialog-light page-dark page-light

…e dialog

The confirmed id list was deleted as captured, so a chat unarchived after
the confirmation (on another device, or via Unarchive while the run is in
flight) was still deleted. Each id is now rechecked against the live list
before its deleteChat.

Escape on the Archived page also closed Settings under the dialog; the page
outlives Settings, so the stale dialog reopened with it. Route Escape to
the page first, like Devices/Harnesses/Appearance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wingleeio wingleeio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Capturing the id list when the dialog opens, one deleteChat per chat through the existing mutation, the count in the confirmation, and the in-flight guard all look right.

I pushed one commit (1276c60):

  • Each captured id is rechecked against the live list right before its delete, so a chat unarchived after confirming (via Unarchive here or on another device) is spared.
  • Escape closed Settings underneath the dialog, and since the page outlives Settings the stale dialog reopened with it. Escape now dismisses the dialog first, like Devices/Harnesses/Appearance.

Ran cargo check -p zeron-ui --all-targets and cargo test -p zeron-ui --lib merged with main — green.

@wingleeio
wingleeio merged commit 4141c76 into zeronsh:main Oct 14, 2026
20 checks passed
kopeng-mi added a commit to kopeng-mi/zeron that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants