feat(desktop): hover X close button on zone tabs - #69392
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.
૮ >ﻌ< ა ci reviewrunning on b281134 CI timingsCI timings · View jobWall time 7m21s vs 8m32s (-13.9%). 3 job(s) slower, 4 faster,
|
5b3265b to
b281134
Compare
|
Real-world user here: I hit this today on v0.20.0 — the preview rail opens and there's no visible way to close it. I literally had to read the source to find the middle-click/Ctrl-click gestures. A hover X (or any visible close affordance) on preview tabs would save a lot of confusion. This PR would have fixed my exact complaint — hoping it gets merged soon. 🙏 |
|
This was generated by AI during triage. Summary: Problems:
Solution: Checked against |
|
Confirmed this exact UX failure on Hermes v0.20.3 for a macOS artifact preview: the visible toolbar offered Copy and Download but no discoverable close action. Because this branch is now unmergeable against |
What
Adds a hover-to-close X button to
PaneTab— the shared tab shell used by the fancy-zones layout, the file-preview rail, and collapsed vertical rails.Why
Closing a tab required middle-click or ⌘-click — discoverable only by reading the code. A hover X is the standard IDE affordance and makes the feature self-evident.
How
shrink-0 size-4 mr-1.5) whenonCloseis set on a horizontal tab. The X isopacity-0by default andopacity-100ongroup-hover/tab. Because the slot is always present, the tab width never shifts when the X appears.onCloseanddirtyare present, the X renders (visible on hover) and the dirty dot is suppressed. WithoutonClose, the dirty dot still renders as before.writing-mode: vertical-rlmakes an inline button awkward. The absolute-positioned dirty dot still works there.onPointerDownon the button is stopped so the tab's drag/activate pointerdown handlers never fire — the X is a leaf close action, not a drag start.Files
apps/desktop/src/components/ui/pane-tab.tsx— the close button + dirty-dot coordinationapps/desktop/src/components/ui/pane-tab.test.tsx— tests for the new button (render, click, vertical skip, no-onClose skip)Verification