Skip to content

fix(web): restore the Archive action in the default sidebar thread menu - #6526

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
lnieuwenhuis:dev/fix/sidebar-thread-archive-action
Aug 15, 2026
Merged

fix(web): restore the Archive action in the default sidebar thread menu#6526
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
lnieuwenhuis:dev/fix/sidebar-thread-archive-action

Conversation

@lnieuwenhuis

@lnieuwenhuis lnieuwenhuis commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What Changed

Adds an "Archive thread" item back to the per-thread action menu (buildThreadActionMenuItems in apps/web/src/components/threadActionMenu.logic.ts), which is the single source that both the default sidebar's right-click row menu (Sidebar.tsx) and the chat header menu (useThreadActionMenu.ts) render. Wired both surfaces to dispatch the new "archive" id to the existing archiveThread mutation from useThreadActions, reusing the same confirmThreadArchive client setting the legacy sidebar and the existing bulk-archive flow already use for an optional confirm dialog.

Archive sits directly before Delete in the list (after Copy thread ID), without the destructive styling Delete uses — archiving hides a thread from the sidebar but keeps it under Settings > Archived threads, so it isn't a destructive action.

No new capability gate was added: archiveThread/unarchiveThread are already dispatched unconditionally everywhere else in the codebase (the legacy sidebar's row button and bulk-select menu never check a readEnvironmentSupports* flag for archive), so gating it here would be inventing a capability the backend doesn't expose.

Why

Closes #6511. PR #5672 made the new (non-legacy) sidebar the default and its per-thread menu never got an Archive item, even though:

  • Settings > Archived threads still lists archived conversations.
  • The legacy sidebar (still selectable via Settings > General > Legacy features) still exposes a dedicated Archive button per thread, using the same archiveThread mutation this PR now reuses.
  • Delete is the only remaining way to remove a thread from the default sidebar, but Delete permanently clears history, and Settle isn't equivalent (the thread stays visible in the Settled shelf and can be settled automatically).

This restores parity with the legacy sidebar. If the removal was actually intentional, the maintainers may prefer to close #6511 instead of merging this — I'm not aware of any discussion establishing that, so I'm treating it as an unintentional regression per the issue.

UI Changes

The menu renders through the native context-menu bridge (api.contextMenu.show), so on the desktop app it's an OS-native menu a browser screenshot can't capture. However, apps/web/src/localApi.ts falls back to a DOM-rendered menu (showContextMenuFallback in apps/web/src/contextMenuFallback.ts) whenever window.desktopBridge isn't present (i.e. the web app running in a plain browser). I exercised that real fallback renderer with the real buildThreadActionMenuItems output via a throwaway demo page served by the app's own Vite dev server (not committed — deleted after capturing evidence), and captured real screenshots with a headless Chromium:

Before (pre-fix code, reproduced verbatim from the prior buildThreadActionMenuItems output):
Settle thread → Snooze › → Rename thread → Mark unread → Copy path → Copy thread ID → Delete

After (current code):
Settle thread → Snooze › → Rename thread → Mark unread → Copy path → Copy thread ID → Archive thread → Delete

Before After
Thread menu before: Copy thread ID then Delete, no Archive Thread menu after: Archive thread between Copy thread ID and Delete

Please read these two images for what they are: the DOM fallback menu rendered by the real
showContextMenuFallback from the real buildThreadActionMenuItems output, in an isolated demo
page rather than inside the running app. They are evidence of item presence and ordering, not of
final visual styling — the icon sizing and label wrapping you see are artifacts of the bare demo
page's lack of app CSS, and are not introduced by this PR. On the desktop app this menu is an
OS-native menu, which no browser screenshot can capture; I could not produce a native-menu
screenshot and am not going to imply otherwise.

The before/after item ordering is additionally pinned by the two new tests in
apps/web/src/components/threadActionMenu.logic.test.ts ("offers archive as a non-destructive
action right before delete" and the updated capability-gating test), which fail if Archive's
presence or position regresses.

Verification

  • cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/components/threadActionMenu.logic.test.ts — 8 passed (6 pre-existing + 2 new).
  • cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/hooks/useThreadActions.test.ts — 1 passed (unaffected, ran as a sanity check since archiveThread is reused here).
  • cd apps/web && pnpm exec tsgo --noEmit — no errors.
  • pnpm exec vp lint --report-unused-disable-directives on the changed files — no findings.
  • pnpm exec vp format --check on the changed files — all correctly formatted.
  • Manual: rendered the real DOM-fallback context menu with the actual builder/renderer code in a throwaway Vite-served demo page and confirmed the before/after item list and ordering by screenshot (see UI Changes).

I did not run the full test suite or a repo-wide typecheck, per the smallest-relevant-scope guidance.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (DOM-fallback renderer; see the caveat in UI Changes)
  • I included a video for animation/interaction changes (not applicable — no animation)

Closes #6511


Note

Low Risk
UI-only wiring to an existing archiveThread mutation and settings; no new server paths or auth changes.

Overview
Restores Archive thread to the default sidebar and chat header per-thread menus, which regressed when the new sidebar became default (#6511).

buildThreadActionMenuItems now includes a non-destructive Archive thread item immediately before Delete, always shown (not capability-gated). Archive is disabled while a thread has an active running turn (isRunning), matching server rejection in archiveThread.

Sidebar and useThreadActionMenu both handle the "archive" action: optional confirm via confirmThreadArchive, then archiveThread with error toasts (including archive-succeeded-but-navigation-failed). Tests cover ordering, non-destructive styling, capability-off availability, and the running disable.

Reviewed by Cursor Bugbot for commit 1524c5e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Restore the Archive action in the sidebar and chat header thread menus

  • Adds an 'Archive thread' item to menus built by buildThreadActionMenuItems, positioned just before 'Delete' with no destructive styling.
  • Wires up archive handling in both Sidebar.tsx and useThreadActionMenu.ts, using archiveThread from useThreadActions and respecting the confirmThreadArchive setting.
  • The action is disabled while the thread is running (active turn); on failure, an error toast distinguishes between archive success with navigation failure and outright failure.

Macroscope summarized 1524c5e.

Archive was dropped from the new sidebar's per-thread menu when it became
the default, leaving Delete as the only way to remove a thread from the
sidebar even though Delete permanently clears history. Add Archive back to
buildThreadActionMenuItems (the shared source for the sidebar row menu and
chat header menu) and wire it through both surfaces, reusing the existing
archiveThread mutation and confirmThreadArchive setting the legacy sidebar
already relies on.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f402e036-a150-46a3-8256-e91c997fc9bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 13, 2026
Comment thread apps/web/src/hooks/useThreadActionMenu.ts Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e2cc16e. Configure here.

Comment thread apps/web/src/components/threadActionMenu.logic.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 1524c5e

This PR restores the Archive action to the sidebar thread menu using existing archiveThread functionality. The changes are self-contained to menu UI logic, follow established patterns, and include tests. The author has prior history with this file.

You can customize Macroscope's approvability policy. Learn more.

…re toast

Macroscope and Cursor Bugbot flagged two real issues in the single-thread
archive path (sidebar row menu and chat header menu): the menu item stayed
enabled while a thread had an active turn, so it always failed against
archiveThread's ThreadArchiveBlockedError guard, and any failure after a
successful archive (e.g. the post-archive navigation to a new thread) was
reported as "Failed to archive thread" even though the thread had already
been archived. Both are already handled correctly in the bulk-archive path
(buildMultiSelectThreadContextMenuItems disables on hasRunningThread, and
archiveSelectedThreadEntries distinguishes a post-archive navigation
failure); this brings the single-thread path in line with that pattern.
@juliusmarminge
juliusmarminge enabled auto-merge (squash) August 15, 2026 10:44
@juliusmarminge
juliusmarminge merged commit 48cba7d into pingdotgg:main Aug 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Archive action is missing from the default sidebar thread menu

2 participants