Skip to content

feat: Add Close Others/Left/Right to chat tab context menu#2112

Merged
mabry1985 merged 1 commit into
mainfrom
feat/bd-3vh
Jul 21, 2026
Merged

feat: Add Close Others/Left/Right to chat tab context menu#2112
mabry1985 merged 1 commit into
mainfrom
feat/bd-3vh

Conversation

@mabry1985

Copy link
Copy Markdown
Member

Summary

Adds Close others, Close left, and Close right to the chat tab right-click context menu.

  • apps/web/src/chat/bulkClose.ts (new): a pure, host-free sessionsToClose(sessions, anchorId, mode) helper that resolves the target tab ids for each mode in tab order. It always excludes the right-clicked anchor and any pinned tab (the pinned field is optional/forward-looking, so a current ChatSession is structurally accepted and never matches — pinned tabs are respected once pinning exists).
  • ChatSurface.tsx: onTabContextMenu computes the three target sets and passes onCloseOthers/onCloseLeft/onCloseRight callbacks only when that direction has tabs to close. A small closeQueue state feeds each targeted session through the existing setPendingCloseConfirmDialog flow one at a time — the next id promotes into the dialog as each resolves. This means goal-driving tabs still get their per-tab Stop/Detach confirmation, only ever one dialog is open (no dialog storm), and cancel aborts the remaining batch.
  • contextMenu/registrations.tsx: the chat-tab menu renders the three bulk-close entries beneath Close chat, each shown only when its closure is supplied (so "Close left" never appears on the leftmost tab).

Tests: bulkClose.test.ts covers the targeting logic (others/left/right, anchor exclusion, edges, pinned exclusion, missing anchor, bare sessions); registrations.test.ts gains a suite asserting the menu shows/hides each entry by closure presence and that each entry invokes its own callback. Existing New chat / Rename / single Close behavior is untouched.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mabry1985, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8c9fcad1-7302-4cb6-8d4a-285821a99967

📥 Commits

Reviewing files that changed from the base of the PR and between dffaba5 and 2c4f749.

📒 Files selected for processing (5)
  • apps/web/src/chat/ChatSurface.tsx
  • apps/web/src/chat/bulkClose.test.ts
  • apps/web/src/chat/bulkClose.ts
  • apps/web/src/contextMenu/registrations.test.ts
  • apps/web/src/contextMenu/registrations.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bd-3vh

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.

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

QA panel review — PASS

code-review-structural · head 837667d0d042 · formal

[review-synthesizer completed: workflow code-review-structural:report]

The PR contains no findings from the review panel or the structural analysis pass. No defects were identified, and no findings were refuted or marked uncertain by the verifier.

Overall risk is low as no issues were surfaced. There is no "fix-first" item. The panel was in unanimous agreement. No gaps were reported other than the absence of findings.

[]

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Promoting the PASS verdict for head 837667d0d042: all checks terminal-green, zero unresolved review threads. (approve-on-green)

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

QA panel review — PASS

code-review-structural · head 2c4f749e64d9 · formal

[review-synthesizer completed: workflow code-review-structural:report]

The change appears to be low-risk as no defects were identified by the review panel or the structural analysis pass. There are no priority fixes required, and there was no disagreement among the finders. The verification pass confirmed the absence of findings. No coverage gaps were noted.

[]

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Promoting the PASS verdict for head 2c4f749e64d9: all checks terminal-green, zero unresolved review threads. (approve-on-green)

@mabry1985
mabry1985 merged commit 4a77725 into main Jul 21, 2026
9 of 10 checks passed
@mabry1985
mabry1985 deleted the feat/bd-3vh branch July 21, 2026 11:05
mabry1985 added a commit that referenced this pull request Jul 22, 2026
…rtifacts, fleet inputs/secrets (#2130)

Bump 0.106.0 → 0.107.0 and roll the changelog for the release. Highlights:
- Versioned file artifacts + save_file_artifact (ADR 0092 D2, #2126)
- Document-generation stack baked into the desktop bundle (ADR 0092 D1, #2123)
- Fleet agents accept operator inputs + secrets at create time (#2121/#2122/#2125/#2127)
- Deterministic persona-drift detection (#2116)
- Chat tab context menu Close Others/Left/Right (#2112)
- Fixes: archetype-catalog bundling (#2115), PyPI publishes on tag push (#2113)

Backfilled [Unreleased] entries for the feature PRs that lacked them, rolled to
[0.107.0], scaffolded + polished the marketing changelog. uv.lock: project version
line only (surgical — avoids uv 0.11.13-vs-pinned-0.11.29 marker drift).


Claude-Session: https://claude.ai/code/session_01EVmWoy2TdXdMshNn5WBR2Z

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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