Skip to content

Add a one-click Archive button to hovered sidebar thread rows - #1965

Merged
SawyerHood merged 2 commits into
mainfrom
bb/convert-text-into-feature-requests-thr_sbzuy42jh2
Aug 19, 2026
Merged

SawyerHood merged 2 commits into
mainfrom
bb/convert-text-into-feature-requests-thr_sbzuy42jh2

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

What was wrong

Archiving a thread from the sidebar took two or three actions: open the … menu or the right-click menu, then pick Archive. Users who clean up many threads a day asked for a one-click hover button like Cursor has (#1958, which supersedes #1159; the keyboard shortcut from #1172 is opt-in and not discoverable from the list).

What changed

  • apps/app/src/components/thread/ThreadActionsMenu.tsx: new ThreadArchiveQuickAction, an icon button with a tooltip that calls the same archiveThreadAndChildren / unarchiveThread actions as the menu entry. It uses the existing Archive / ArchiveRestore icons and stops propagation so the row link does not navigate.
  • apps/app/src/components/sidebar/ThreadRow.tsx: the hover overlay is anchored inset-y-0 right-0 so it can hold two actions; the archive button sits left of the MoreHorizontal trigger with a 2px gap.
  • apps/app/src/components/ui/theme.css + sidebar-hover-actions.ts: new bb-sidebar-hover-actions-inset class reserves one action width on the title under the same row states that reveal the overlay (hover, focus-visible, open menu), so long titles truncate instead of running under the button. Reset to 0 on coarse phones where the overlay is hidden. Not applied when the row shows a shortcut pill instead of hover actions.

No wire, CLI, or doc changes; no new icon registered.

How you verified

  • New ThreadArchiveQuickAction.test.tsx: one click archives without bubbling to the row; an archived thread unarchives instead.
  • Updated ThreadRow.test.tsx mock and wrapped ProjectRow.interactions.test.tsx renders in TooltipProvider.
  • pnpm exec turbo run typecheck lint test --filter=@bb/app: 404 files, 3100 tests pass.
  • Manual: dev app in headless Chromium — hover shows the button left of …, click removed the row and set archived_at in the dev DB; long title truncates before the button.

Fixes #1958

AGENT GENERATED: by Claude Opus 5

@bb-slop-cop bb-slop-cop 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.

🚨 SLOP COP 🚨 · review

I am the Slop Cop. I am now reviewing this pull request for security, code quality, performance, architecture, and user behavior.

I will post one final review after the independent checks finish.

unarchiveThread(thread);
return;
}
archiveThreadAndChildren(thread);

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.

🚨 slopcop/review — Rapid archives can lose the first result callbacks.

All rows call one shared TanStack mutation. A second call removes the observer from the first call. The first request continues, but its per-call success or error callbacks do not run. The user can lose the first Undo toast, pane closure, navigation update, or error message. This button removes the row immediately, so the next archive button moves under the cursor and makes rapid calls likely. Move the result effects into mutation-level callbacks, or serialize archive actions.

SIDEBAR_MORE_ACTION_TRIGGER_CLASS,
// Tighter than two full margins: a half step between the
// two glyphs reads as one control group.
"-mr-0.5",

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.

🚨 slopcop/review — The two expanded click targets overlap.

Each action has a 28-pixel pseudo-element target. This negative margin puts the target centers 22 pixels apart. The targets overlap by 6 pixels. The later menu target can receive a click aimed at the Archive button. Remove the negative margin, or clip each pseudo-element at the midpoint. Add a browser pointer test for this geometry.

@bb-slop-cop bb-slop-cop 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.

🚨 SLOP COP 🚨 · review

This pull request adds an Archive icon beside the thread menu on hover. It uses the existing archive action and reserves title space.

I found two issues that need fixes:

  1. Rapid clicks can start two archives through one shared TanStack mutation. The first request can lose its Undo and completion effects.
  2. The Archive and menu click targets overlap by 6 pixels. The menu can receive a click intended for Archive.

I left inline comments with causes and suggested fixes.

The security, code quality, architecture, and performance reviews found no other actionable defect. The architecture scan found no useful larger refactor.

All GitHub checks passed. I also ran 82 focused tests from the exact pull request head, and all tests passed.

The browser worker started the pull request app and loaded it in Chromium. It did not complete the hover and click flow.

@SawyerHood

Copy link
Copy Markdown
Collaborator Author

Addressed both SlopCop findings in 569c22f:

  1. Rapid archives lose first callbacks — archiveThreadAndChildren now uses mutateAsync and handles the per-call promise, so each archive keeps its own Undo toast, pane closure, navigation, and error toast even when a second archive starts before the first settles.
  2. Overlapping click targets — added SIDEBAR_PAIRED_ACTION_LEADING/TRAILING_TARGET_CLASS that re-anchor each button's pseudo-target to stop 1px short of the shared edge. Verified in headless Chromium with elementFromPoint across the pair: Archive owns x 261–285, the menu owns 286–310, with no shared pixel. The repo has no browser pointer test harness in CI, so I did not add one.

AGENT GENERATED: by Claude Opus 5

SawyerHood and others added 2 commits August 19, 2026 23:08
Hovering a thread row now reveals an Archive button left of the "..." menu
trigger. It reuses the ThreadActionsProvider archive/unarchive lifecycle, so
the child cascade, navigation, and undo behave like the menu entry.

The hover overlay is anchored to the row's right edge so it can hold two
actions, and a new bb-sidebar-hover-actions-inset class reserves one action
width on the title while the row is hovered, focused, or has an open menu, so
long titles truncate instead of running under the button. The overlay stays
hidden on coarse phones, where no room is reserved.

Fixes #1958

Co-Authored-By: Claude <[email protected]>
Archive now uses mutateAsync so each call keeps its own Undo toast, pane
closure, and error report; per-call mutate callbacks only fire for the latest
call on the shared observer, which rapid one-click archives make likely.

The archive and menu buttons' 28px pseudo-targets overlapped, so the later
menu could take a click aimed at Archive. New paired-target classes stop each
target at the midpoint of the 2px gap.

Co-Authored-By: Claude <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/convert-text-into-feature-requests-thr_sbzuy42jh2 branch from 569c22f to c04de55 Compare August 19, 2026 23:09
@SawyerHood
SawyerHood merged commit c381ddc into main Aug 19, 2026
12 checks passed
@SawyerHood
SawyerHood deleted the bb/convert-text-into-feature-requests-thr_sbzuy42jh2 branch August 19, 2026 23:14
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.

One-click Archive button on hover for each thread in the sidebar

1 participant