Primitives · raise: what opens inside a dialog lies over it

gpui 0.2.2 asserts on a deferred draw inside another, and every dialog,
sheet and popover draws inside one, so opening a date field in the
snooze or schedule dialog panicked, as would any list, menu or picker
opened in an overlay. primitives::raise replaces each deferred draw:
at the top it defers as before; inside something raised it leaves a
placeholder in the tree, and its layer lays it out on its own, then
draws it last. check.sh refuses gpui's deferred anywhere else.

The time dialog's rule is now times::ahead, tested for a moment
behind, now itself, a moment ahead and another zone; a gpui test picks
yesterday in the snooze dialog, sees that it has passed and that
nothing is sent, then picks two days ahead and hears that moment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-27 01:51:51 -04:00
1 parent 5b0a8443a7
commit 9abab5f2ba
20 files changed
+405 -49

No files matched your search

+4 -4
View File
@@ -6,15 +6,15 @@ use std::{
use gpui::{
Animation, AnimationExt, AnyElement, App, ClickEvent, Context, Corner, ElementId, Entity,
FontWeight, InteractiveElement, IntoElement, ParentElement, Pixels, RenderOnce, SharedString,
StatefulInteractiveElement, Styled, Task, Window, anchored, canvas, deferred, div, point,
prelude::*, relative,
StatefulInteractiveElement, Styled, Task, Window, anchored, canvas, div, point, prelude::*,
relative,
};
use crate::{
buttons::{Button, ButtonVariant, IconButton},
forms::Run,
motion,
primitives::{Icon, IconName, Severity},
primitives::{Icon, IconName, Severity, raise},
theme::{ActiveTheme, ControlSize, Elevation, IconSize, Radius, TextSize},
};
@@ -234,7 +234,7 @@ impl RenderOnce for ToastViewport {
hold.update(cx, |toaster, cx| toaster.hold(*hovered, cx))
})
.children(cards);
deferred(
raise(
anchored()
.position(point(viewport.width - margin, viewport.height - margin))
.anchor(Corner::BottomRight)