Skip to content

feat(desktop): add "Delete all chats" button to the chat sidebar - #63

Open
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-55957
Open

feat(desktop): add "Delete all chats" button to the chat sidebar#63
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-55957

Conversation

@hashbender

Copy link
Copy Markdown
Owner

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 exposes POST /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: clearAllSessions pages 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 own state.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

  • ✨ New feature (non-breaking change that adds functionality)

Changes Made

  • apps/desktop/src/hermes.tsbulkDeleteSessions(ids, profile) bridge call to POST /api/sessions/bulk-delete, plus the BULK_DELETE_MAX_IDS (500) cap constant.
  • apps/desktop/src/app/session/hooks/use-session-list-actions.tsclearAllSessions(): page-and-delete loop, optimistic row + pin removal, authoritative refresh.
  • apps/desktop/src/app/desktop-controller.tsxclearAllChats wrapper that drops the open chat to a fresh draft and closes its runtime first (mirroring removeSession), wired to the sidebar.
  • apps/desktop/src/app/chat/sidebar/index.tsx — the trash button (hover-revealed, destructive-red on hover) and the ConfirmDialog. 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}.tssidebar.deleteAll strings.
  • Tests: hermes.test.ts (bridge call shape + profile routing) and use-session-list-actions.test.tsx (pages & deletes, groups by profile, no-op when empty).

How to Test

  1. Open Hermes Desktop with a few chats in the sidebar.
  2. Hover the recents header — a trash icon appears to the right of + and the folder toggle.
  3. Click it → a confirmation dialog shows the chat count. Confirm.
  4. The list empties; archived chats (Settings → Sessions) and the new-chat draft are unaffected. Cancelling leaves everything in place.

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

  • My commit messages follow Conventional Commits (feat(desktop):)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this feature
  • I've added tests for my changes
  • I've tested on my platform: macOS 15 (Apple Silicon)

Verified locally: tsc -p . --noEmit clean, eslint clean, and vitest green for the new/changed specs and the i18n suites. (Python pytest tests/ is unaffected — this is a renderer-only change with no backend edits.)

Documentation & Housekeeping

  • Documentation — N/A (no user-facing docs cover per-button sidebar affordances)
  • cli-config.yaml.example — N/A (no config keys)
  • CONTRIBUTING.md / AGENTS.md — N/A (no architecture/workflow change)
  • Cross-platform impact — renderer-only React/TS; no OS-specific code paths
  • Tool descriptions/schemas — N/A

Mirror-of: NousResearch#55957
NousResearch#55957

@tenki-reviewer

tenki-reviewer Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Complete
No issues found!

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)
apps/desktop/src/app/chat/sidebar/index.tsx
apps/desktop/src/app/desktop-controller.tsx
apps/desktop/src/app/session/hooks/use-session-list-actions.test.tsx
apps/desktop/src/app/session/hooks/use-session-list-actions.ts
apps/desktop/src/hermes.test.ts
apps/desktop/src/hermes.ts
apps/desktop/src/i18n/en.ts
apps/desktop/src/i18n/ja.ts
apps/desktop/src/i18n/types.ts
apps/desktop/src/i18n/zh-hant.ts
apps/desktop/src/i18n/zh.ts

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.

1 participant