Repository navigation
Show close button for single terminal panes - #22770
Conversation
Single-pane terminals previously had no close affordance; now display "Close tab" button while multi-pane terminals show "Close Pane". Pinned tabs omit the close button. Refactored terminal-unified-tab-lookup to include tab pinned state alongside chat view fields.
There was a problem hiding this comment.
ℹ️ No critical issues — one design question inline, plus two nitpicks.
Reviewed changes
- Single-pane close control —
TerminalPaneHeaderOverlaynow renders a close button for an untitled, unpinned single pane, labelled "Close tab"; multi-pane headers keep "Close Pane". - Pinned guard — the single-pane branch requires
!isTabPinned, so pinned single panes keep no close button. - Ephemeral suppression — the same branch requires
showSplitButton, so one-off command terminals (showSplitButton={false}) still get no close. - Pin plumbed through —
selectUnifiedTerminalTabChatFieldsbecameselectUnifiedTerminalTabFieldsand now returnsisTabPinned, threaded throughuseTerminalPaneChatState→ controller →TerminalPaneSurface→ overlay. - Tests — added single-pane close, pinned, and ephemeral cases, plus a pin-invalidation test for the lookup.
ℹ️ Nitpicks
showSplitButtonis named for the split control, but it now also decides whether a single pane gets a close button. A caller that hides split for a real, non-ephemeral pane would silently lose the close affordance; a one-line note on the prop would make the second job explicit.- In the pinned
it.each, thetitledcase assertsbutton[aria-label="Close tab"]is absent, but titled panes never take the close branch regardless ofisTabPinned, so only theuntitledcase actually exercises the new guard.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe unified terminal tab selector now returns the selected tab’s pinned status. The hook and terminal surface pass that status to the header overlay. The overlay updates close-control visibility based on pane count, split-control visibility, and pin status. Its close button and tooltip use “Close Pane” for multiple panes and “Close tab” for a single pane. Tests cover the updated single-pane, pinned-tab, and hidden-control cases. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The close control behaves as intended for pinned tabs, single panes, and split panes. No issue identified here prevents merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new button uses the existing guarded tab-close path, and no security bypass was identified. Repeated-click behavior and some downstream cleanup effects remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, user-facing behavior, pinned-tab handling, multi-pane behavior, implementation changes, and test coverage. However, it omits most required template sections, including ELI5, Why, Linked Issue, Visual Proof, Testing details and checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Complete the required template sections. Add the issue link after “Fixes #”, attach before-and-after visual proof or write “N/A” with a reason, document manual and automated testing with tested platforms, complete the applicable checkboxes, and address AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 00eb8401-f5a3-43c4-a89f-7267633072dc
📒 Files selected for processing (6)
src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneSurface.tsxsrc/renderer/src/components/terminal-pane/terminal-unified-tab-lookup.test.tssrc/renderer/src/components/terminal-pane/terminal-unified-tab-lookup.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-chat-state.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
For split panes, the X button remains remove-title only. For single panes with titles (including agent terminals that acquire runtime titles), a close tab button is needed to close the pane.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior Pullfrog review (c8acce9 → 5b1e4b4), which extends the close affordance to titled single panes.
- Extended the close control to titled single panes —
showCloseButtonnow renders beside the remove-title X for a titled single pane, so agent terminals (which receive runtime titles) are no longer the one shape without a visible close affordance. - Extracted the close label —
closeLabelresolves once toClose tabfor a single pane andClose Panefor multi-pane, replacing the two inline translations. - Realigned the tests — the titled single-pane case now asserts both controls and a working close, the pinned
it.eachexercises the!isTabPinnedguard for titled panes too, and titled split panes assert remove-title only.
Verification: the two changed test files pass (12 tests) and pnpm tc:web is clean.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
* Show close button for single terminal panes Single-pane terminals previously had no close affordance; now display "Close tab" button while multi-pane terminals show "Close Pane". Pinned tabs omit the close button. Refactored terminal-unified-tab-lookup to include tab pinned state alongside chat view fields. * Show close button for titled single terminal panes For split panes, the X button remains remove-title only. For single panes with titles (including agent terminals that acquire runtime titles), a close tab button is needed to close the pane. (cherry picked from commit 56dfddc)

Problem
Single terminal panes lacked a visible close affordance, making them harder to close without using context menus or keyboard shortcuts.
Solution
Added a close button ("Close tab") to the header overlay for single terminal panes. The button respects the pinned state—pinned single panes don't show a close button. Multi-pane scenarios continue to show "Close Pane" for clarity.
Implementation:
selectUnifiedTerminalTabFields(renamed fromselectUnifiedTerminalTabChatFields)