Repository navigation
Close confirmations: one tab defaults to Close, more than one to Cancel - #489
Conversation
Since close safety (#469) every destructive close card started on Cancel, so closing a single tab took an arrow key or a click. That is the most common close, and the extra step costs more than it saves. Now Return closes whenever the close takes one tab: - Close tab? (pane card, Ghostty's runtime close, and the legacy alert) - closing an area that holds one tab - Close other tabs when it closes one tab - Close workspace? for an unpinned workspace holding one tab (Cmd+W on a last tab goes through this) - Close window? for a window holding one such workspace Anything that closes more than one tab, and a pinned workspace, still starts on Cancel. Cmd+D still never accepts a destructive card. ConfirmContent gains defaultSelection (nil keeps the role-derived default), and the workspace-close runtime honours it on present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The NSAlert paths (Close window?, Close other tabs, the legacy close-tab fallback) keep their existing Cancel default; AppKit re-assigns alert key equivalents at present time, so the default belongs on the cards only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deep review — #489 "Close confirmations: one tab defaults to Close, more than one to Cancel"Thanks for this — it's a tight, well-scoped follow-up to #469, and the PR description's enumeration of exactly which flows change (and which deliberately stay on Cancel) made the review fast. The mechanism is small and the invariant that actually matters — destructive cards can't be accepted by a reflexive Cmd+D — is preserved. SummaryThe PR threads an optional AlignmentIn scope. This is a UX-correctness fix on c11's own overlay surfaces implementing the maintainer's explicit ask — no tenant-config writes, no upstream-shared code, no typing-latency hot paths, no new user-facing strings, no CLI/socket/skill surface touched. It belongs here. What I verified in context
Findings1. (minor — your call) Single-tab area close is 2. (nit) New non-overlay behaviour has no unit coverage. The only added test exercises RecommendationMerge as-is. The logic is correct and the destructive-accept invariant holds across every path I traced; finding 1 is an optional UX-polish judgment the maintainer can weigh against the explicit "one tab → Close" directive, and finding 2 is a cheap-but-optional coverage add. Nice, careful work. 🌉 Drawbridge deep review (lane 3) — an automated pass; a maintainer has been notified and makes the final call. 🌉 Drawbridge deep review (lane 3) — an automated pass; a maintainer has been notified and makes the final call. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atin's ask: closing one tab should default to Close; closing more than one tab should default to Cancel. Since #469 every destructive close card started on Cancel, which made the most common close take an extra keystroke.
Return now closes on c11's close card when the close takes one tab
Unchanged: closes of more than one tab and pinned workspaces start on Cancel. Cmd+D never accepts a destructive card. The NSAlert dialogs (Close window?, Close other tabs, the legacy fallback alert) keep their existing default.
Mechanism:
ConfirmContent.defaultSelection(nil keeps the role-derived default);WorkspaceCloseInteractionRuntimehonours it on present.Tests: one unit test: a single-tab close card starts on Close and Return confirms it.
🤖 Generated with Claude Code