feat(desktop): add visible close button to pane tabs - #89243
Closed
angel12 wants to merge 2 commits into
Closed
Conversation
Add a hover-to-close X button to PaneTab (the fancy-zones tab shell). The button slot is always reserved inline (shrink-0) so the tab width stays stable whether the X is visible or not — no layout shift on hover. Visible on group-hover/tab, hidden by default via opacity transition. The dirty dot yields to the X when both are present (closeable + dirty): the X wins on hover, the dot shows otherwise. Vertical tabs skip the X (writing-mode:vertical-rl makes an inline button awkward) and keep the absolute-positioned dirty dot. Pointerdown on the X is stopped so the tab's drag/activate handlers never fire — the X is a leaf close action, not a drag start.
angel12
force-pushed
the
fix/visible-preview-close
branch
from
August 18, 2026 15:11
70ee807 to
28d9f54
Compare
Contributor
Author
|
Post-submission independent review found one real interaction bug: the parent tab capture handler swallowed ⌘-clicks when the pointer was directly over the new ×. Added a differential regression test (0 closes before the fix, 1 after), exempted the close-button target from that parent suppression, and added keyboard-style activation coverage. Focused suite is now 14/14; typecheck, targeted lint, and formatting pass. CI has restarted on |
19 tasks
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a conventional hover/focus × to closeable horizontal pane tabs, including file, artifact, and Browser previews.
Today these tabs can be closed through a context menu, middle-click, ⌘-click, or the focused-zone shortcut, but none of those paths is visible in the UI. In a preview such as an artifact source view, the visible toolbar only exposes actions like Copy and Download, so users reasonably conclude that the pane cannot be closed.
Implementation
common.closelabel for the accessible name and tooltip.Prior work / duplicate handling
This deliberately preserves Austin Pickett's original commit and authorship from #69392 by cherry-picking it rather than reimplementing the feature. That PR is currently unmergeable against
main(mergeable_state: dirty) and hasmaintainer_can_modify: false, so it cannot be refreshed upstream. The follow-up commit resolves the outstanding keyboard-focus review note, preserves the dirty indicator, and includes the post-submission independent-review fix for meta-clicks over the new button.This is complementary to #80958 / #86191, which address a separate persisted-hidden-header trap. This PR supplies the missing visible close affordance whenever the pane tab strip is present.
Supersedes #69392 while retaining its author credit.
Verification
npx vitest run --project ui src/components/ui/pane-tab.test.tsx— 14 passednpm run test:ui— 513 files / 4,779 tests passednpm run check:lint— passed (typecheck clean; 0 lint errors, existing warnings only)npx prettier --check src/components/ui/pane-tab.tsx src/components/ui/pane-tab.test.tsx— passedgit diff origin/main...HEAD --check— passedRegression-test sabotage
With the new tests retained and
PaneTabtemporarily restored toorigin/main, the focused test fails in four relevant cases: no accessible close button, no focus-visible close path, no retained dirty marker, and no clickable close action. Restoring the implementation returns the original suite to passing. A separate reviewer-discovered meta-click regression test failed against the first submitted revision (0closes) and passes after the event-routing fix (1close).