feat(desktop): add tab close controls with focus recovery - #83051
feat(desktop): add tab close controls with focus recovery#83051nicolasdmolina wants to merge 11 commits into
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.
Route pane, session, and terminal close operations through a shared focus-recovery lifecycle. Keep terminal rail focus stable across global close and delayed terminal initialization, and add interaction regressions for split, minimized, hidden-successor, and confirmation paths.
|
Correction: PR mergeability is CONFLICTING and mergeStateStatus is DIRTY. Latest branch workflows are action_required with zero jobs, so automation hasn’t produced substantive check output yet. Please resolve merge conflicts locally before CI can run to completion. |
|
Closing this broad replacement PR. The primary visible hover-close affordance has since landed in #89428 and was refined in #91777. This branch is now merge-conflicted, and its 37-file expansion combines several independent focus, pane, and terminal lifecycle changes that should not be reviewed as one stale PR. Any remaining behavior that still reproduces on current main should be filed and fixed as a small issue-linked change. The branch and history remain available, including Austin Pickett’s original commits and attribution. |
Summary
Motivation
Tab closing has several asynchronous entry points. Without a shared completion lifecycle, focus can remain on disappearing controls, jump to the wrong split group, target an invisible raw active pane, or be stolen by a delayed terminal mount. This change makes direct close controls durable and keyboard-accessible across those paths.
Changes
Test Plan
act()failures, and every implicated file passed when isolated with adequate timeouteb7b0865cb93with no dirty-tree warningnpx playwright test e2e/pane-tab-close.spec.ts e2e/right-pane.spec.ts --reporter=list --timeout=180000 --workers=1— 6/6 real macOS Electron tests, including close-glyph context menu, focused real-xterm close, survivor rail focus, and a second global close that removes the surviving nested terminal rather than the outer panegit diff --check origin/main...HEADclean; added-line credential/unsafe-execution/debug scan found no matchesmain; conflict resolution preservesContribRender, split-share memory, deferred close results, and tab-panel semanticsSHIPon exact commiteb7b0865cb930bfcc62e25544e420ff7c24ca36fwith zero blocking, nonblocking, or security findingsReview History
Two strict reviewers of the previous snapshot independently identified three reachable interaction defects:
falseresult.Each issue now has a red-before/green-after regression, including two-gesture and back-to-back real Electron assertions plus separate stale-owner helper/dispatcher contracts. Two fresh hash-bound semantic and interaction/accessibility/security reviews returned
SHIPon the exact final snapshot with no findings.Notes for Reviewers
main.