feat(desktop): add "Delete all chats" button to the chat sidebar - #63
Open
hashbender wants to merge 1 commit into
Open
feat(desktop): add "Delete all chats" button to the chat sidebar#63hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
|
Review Complete Risk: 🟢 Low (15/100) — no findings · 371 LOC across 11 files PR adds i18n localization support to the desktop app with translations for English, Japanese, Simplified Chinese, and Traditional Chinese, along with a new session-list refactor and improved desktop controller reactivity. Files Reviewed (11 files) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a "Delete all chats" button to the desktop chat sidebar. It sits to the right of the existing new-chat (
+) and folder-toggle controls in the recents header and permanently deletes every chat in the active profile, behind a destructive confirmation dialog that shows how many will be removed.Before this, the only way to clear history was deleting chats one at a time (right-click → Delete, or the per-row trash in Settings → Sessions). There was no bulk affordance on the desktop, even though the backend and the web dashboard already had one.
Why this approach: the desktop's REST backend (
hermes_cli/web_server.py) already exposesPOST /api/sessions/bulk-delete— the same endpoint the web dashboard's bulk-select-then-delete flow uses. So this is a pure-renderer feature with no backend change:clearAllSessionspages the active-profile scope (the same rows the recents list shows) in≤500-id chunks and deletes each page until the scope is empty, grouping ids by owning profile so each profile is cleared against its ownstate.db. It mirrors the maintainers' existing explicit-id bulk-delete design rather than introducing a new blanket endpoint.Related Issue
No existing issue or PR — searched the tracker and open PRs first. Happy to open a tracking issue if preferred.
Fixes #
Type of Change
Changes Made
apps/desktop/src/hermes.ts—bulkDeleteSessions(ids, profile)bridge call toPOST /api/sessions/bulk-delete, plus theBULK_DELETE_MAX_IDS(500) cap constant.apps/desktop/src/app/session/hooks/use-session-list-actions.ts—clearAllSessions(): page-and-delete loop, optimistic row + pin removal, authoritative refresh.apps/desktop/src/app/desktop-controller.tsx—clearAllChatswrapper that drops the open chat to a fresh draft and closes its runtime first (mirroringremoveSession), wired to the sidebar.apps/desktop/src/app/chat/sidebar/index.tsx— the trash button (hover-revealed, destructive-red on hover) and theConfirmDialog. Hidden in all-profiles and project-grouped views; only shown when the active scope has chats.apps/desktop/src/i18n/{types,en,ja,zh,zh-hant}.ts—sidebar.deleteAllstrings.hermes.test.ts(bridge call shape + profile routing) anduse-session-list-actions.test.tsx(pages & deletes, groups by profile, no-op when empty).How to Test
+and the folder toggle.Scope notes: deletes the non-archived chats of the active profile (pinned included; cron/messaging excluded, matching the recents list). The button hides in the all-profiles and project-grouped views.
Checklist
Code
feat(desktop):)Verified locally:
tsc -p . --noEmitclean,eslintclean, andvitestgreen for the new/changed specs and the i18n suites. (Pythonpytest tests/is unaffected — this is a renderer-only change with no backend edits.)Documentation & Housekeeping
cli-config.yaml.example— N/A (no config keys)CONTRIBUTING.md/AGENTS.md— N/A (no architecture/workflow change)Mirror-of: NousResearch#55957
NousResearch#55957