Skip to content

Confirm before bulk-closing tabs - #30551

Merged
AmethystLiang merged 3 commits into
mainfrom
bug-confirm-bulk-tab-closure-to-prevent-accident
Oct 19, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
bug-confirm-bulk-tab-closure-to-prevent-accident

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​381 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​363
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​222 $\color{#cf222e}{\Huge{\mathbf{−}}}$​83 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139

Problem

The tab right-click menu has Close Tabs To The Left directly above Change Title. A quick misclick while trying to rename a tab closed several tabs at once, with no warning.

Solution

Bulk-close actions now ask for confirmation first. Cancelling leaves every tab open. Pinned tabs are still skipped, and the dialog says so.

ELI5

Before, one wrong click could close a whole row of tabs right away. Now Orca asks first, and nothing closes until you say yes.

What Changed

  • Adds a shared confirmation hook (use-bulk-tab-close-confirmation.ts) used by Close Other Tabs, Close Tabs To The Right, Close Tabs To The Left, and Close All Editor Tabs, across the tab group, terminal tab bar, floating terminal, and the close-all shortcut.
  • Tab selection is re-read from the store when the dialog opens and again on confirm, so tabs that were pinned, moved, or removed while the dialog was open are not closed.
  • Adds the dialog strings to all locales.

Why

The existing close paths already handle dirty files and pinned tabs, so the confirmation is added in front of them instead of rewriting them. This is the smallest change that guards every bulk-close entry point.

Linked Issue

Fixes #30507

Visual Proof

TODO: attach a before/after video or screenshots of the confirmation dialog from the tab context menu.

Testing

  • Added unit tests covering cancel, confirm, pinned tabs, and tabs changing while the dialog is open, for the group close commands, the close-all shortcut, and the floating terminal close actions.

  • TODO: manual testing on macOS, Linux, Windows, or SSH.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

TODO

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Close Others, Close Tabs to the Left/Right, and Close All Editor Tabs now
show a confirmation dialog first, so one misclick or shortcut no longer
closes a group of tabs at once. Pinned tabs are still skipped.

Tabs are selected again after the user confirms. If a tab was pinned, moved,
or removed while the dialog was open, it is left alone. Tabs created after
the request are not closed.

The shared confirmation lives in use-bulk-tab-close-confirmation.ts and is
used by both the tab bar and the tab group. The tab group hook now reads
the store directly instead of taking group and groupTabs as props.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1ee0e7f3-c690-401c-b5e8-2b1a896973b1
📥 Commits

Reviewing files that changed from the base of the PR and between a282409 and 8b695a9.

📒 Files selected for processing: 15
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.ts
  • src/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.test.tsx
  • src/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.ts
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.focus.test.ts
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/terminal-workspace-keydown.test.ts
  • src/renderer/src/components/use-bulk-tab-close-confirmation.ts
  • src/renderer/src/components/use-terminal-bulk-close-actions.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
💤 Files with no reviewable changes: 2
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📝 Walkthrough

Bulk tab-close actions now show a localized confirmation before closing tabs or editor files. After confirmation, the actions reselect eligible targets and close only those that remain eligible. Pinned tabs are excluded. The changes add shared confirmation handling, update terminal and tab-group close actions, and add tests for confirmation, cancellation, and target changes while a request is pending.

Priority: ➖ Normal

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 8b695

Bulk-close actions retain the tabs selected for confirmation while excluding tabs that become ineligible. No actionable merge-blocking risk was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (6 skipped: 6 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately describes the main change: adding confirmation before bulk-closing tabs.
Description check Passed The description is mostly complete and clearly explains the problem, solution, scope, linked issue, implementation, and automated tests. Visual proof, manual testing, AI disclosure, and command result…
Linked Issues check Passed Issue #30507 requires a confirmation before Close Tabs To The Left can close multiple tabs. The PR adds the shared useBulkTabCloseConfirmation hook and applies it to the left-close action. The hook …
Out of Scope Changes check Passed The changed production files support the bulk-close confirmation behavior from issue #30507. The hook, selection changes, locale strings, and call-site updates implement or support that behavior. The …
Full details: Description check

Explanation

The description is mostly complete and clearly explains the problem, solution, scope, linked issue, implementation, and automated tests. Visual proof, manual testing, AI disclosure, and command results remain marked TODO or incomplete, but the description is not largely incomplete.

Full details: Linked Issues check

Explanation

Issue #30507 requires a confirmation before Close Tabs To The Left can close multiple tabs. The PR adds the shared useBulkTabCloseConfirmation hook and applies it to the left-close action. The hook selects eligible tabs, opens a localized confirmation dialog, closes tabs only after confirmation, and closes nothing after cancellation. Tests cover confirmation, cancellation, pinned tabs, and tab changes while the dialog is open. The PR also applies the safeguard to other bulk-close actions, which the issue suggests considering.

Full details: Out of Scope Changes check

Explanation

The changed production files support the bulk-close confirmation behavior from issue #30507. The hook, selection changes, locale strings, and call-site updates implement or support that behavior. The added tests verify the required close, cancel, pinned-tab, and pending-dialog cases. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Close Others, Close Tabs to the Left/Right, and Close All Editor Tabs now
show a confirmation dialog first, so one misclick or shortcut no longer
closes a group of tabs at once. Pinned tabs are still skipped.

Tabs are selected again after the user confirms. If a tab was pinned, moved,
or removed while the dialog was open, it is left alone. Tabs created after
the request are not closed.

The shared confirmation lives in use-bulk-tab-close-confirmation.ts and is
used by both the tab bar and the tab group. The tab group hook now reads
the store directly instead of taking group and groupTabs as props.
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.

[Bug]: Confirm bulk tab closure to prevent accidental clicks while renaming

1 participant