From 4406340974e452599d3b36ab8aaa3d2f3ae5a52d Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 05:15:07 +0800 Subject: [PATCH] fix(ui): make the two card overlays look as modal as they behave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The worktree prompt and the SSH auth prompt each cover the window with a full-bleed layer that swallows every click — and drew nothing, so the app simply stopped responding with no sign of why. The palette and the switcher already answer this with presets::scrim_fill; these two just never used it. Both now dim what is behind them. The worktree prompt also cancels on a click outside, the same gesture the palette and switcher take. The auth prompt deliberately does not: a mis-aimed click would abandon a handshake mid-flight, so Escape stays its only way out. --- src/ui/ssh_prompt.rs | 5 +++++ src/ui/worktree_prompt.rs | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ui/ssh_prompt.rs b/src/ui/ssh_prompt.rs index c1a5c685..45fa4bd1 100644 --- a/src/ui/ssh_prompt.rs +++ b/src/ui/ssh_prompt.rs @@ -555,6 +555,11 @@ impl Tty7App { div() .absolute() .inset_0() + // This is the one modal that must not be dismissed by a stray + // click — a mis-aimed click would abandon an authentication + // attempt mid-handshake. It gets the scrim, so it reads as + // modal, and Escape stays the only way out. + .bg(crate::ui::presets::scrim_fill(cx)) .flex() .flex_col() .items_center() diff --git a/src/ui/worktree_prompt.rs b/src/ui/worktree_prompt.rs index 0db27ae6..bdf5157d 100644 --- a/src/ui/worktree_prompt.rs +++ b/src/ui/worktree_prompt.rs @@ -209,6 +209,17 @@ impl Tty7App { div() .absolute() .inset_0() + // The backdrop already swallowed every click in the window; it + // just did not look like it did. A scrim says the app is + // waiting, and clicking it backs out — the same gesture the + // palette and the switcher already answer to. + .bg(crate::ui::presets::scrim_fill(cx)) + .on_mouse_down( + gpui::MouseButton::Left, + cx.listener(|this, _: &gpui::MouseDownEvent, window, cx| { + this.cancel_worktree_prompt(window, cx) + }), + ) .flex() .flex_col() .items_center()