Port · Calendar: a real exit clears the preview after a key

The calendar's grid clears its preview on leave, and ignores a leave
that follows a key. gpui records the exit a key makes before the
handler runs, so the guard swallowed it and a real exit afterwards
had no change left to report: the stale day stayed the preview. The
grid now listens independently of input, while its days keep the
default, so a key is no leave and a real exit is. A test leaves the
grid after an arrow, a letter and a month key.

shaped()'s doc goes back to its one line; AGENTS.md keeps the why.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-28 20:54:25 -04:00
1 parent 4c3ed1bbb9
commit 05bd22b7f0
5 files changed
+28 -5

No files matched your search

+4 -3
View File
@@ -1,9 +1,9 @@
use std::rc::Rc;
use gpui::{
Animation, AnimationExt, App, ElementId, FocusHandle, FontWeight, InteractiveElement,
IntoElement, ParentElement, RenderOnce, StatefulInteractiveElement, Styled, Window, div,
prelude::*, transparent_black,
Animation, AnimationExt, App, ElementId, FocusHandle, FontWeight, HoverListenerMode,
InteractiveElement, IntoElement, ParentElement, RenderOnce, StatefulInteractiveElement, Styled,
Window, div, prelude::*, transparent_black,
};
use jiff::{ToSpan, civil::Date};
@@ -328,6 +328,7 @@ impl RenderOnce for Calendar {
.grid()
.grid_cols(7)
.gap_0p5()
.hover_listener_mode(HoverListenerMode::InputModalityIndependent)
.on_hover(move |over, window, cx| {
if !*over && !window.last_input_was_keyboard() {
leave.update(cx, |hover, cx| {