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:
1 parent
5b0a8443a7
commit
9abab5f2ba
20 files changed
+405
-49
No files matched your search
@@ -3,13 +3,15 @@ use std::{cell::Cell, rc::Rc};
|
||||
use gpui::{
|
||||
AnyElement, App, DragMoveEvent, ElementId, EmptyView, EntityId, FontWeight, InteractiveElement,
|
||||
IntoElement, ParentElement, Pixels, Point, RenderOnce, SharedString,
|
||||
StatefulInteractiveElement, StyleRefinement, Styled, Window, anchored, deferred, div, point,
|
||||
prelude::*,
|
||||
StatefulInteractiveElement, StyleRefinement, Styled, Window, anchored, div, point, prelude::*,
|
||||
};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use super::seeded::use_seeded;
|
||||
use crate::theme::{ActiveTheme, ControlSize, Elevation, Radius, TextSize};
|
||||
use crate::{
|
||||
primitives::raise,
|
||||
theme::{ActiveTheme, ControlSize, Elevation, Radius, TextSize},
|
||||
};
|
||||
|
||||
struct Carry {
|
||||
owner: EntityId,
|
||||
@@ -147,7 +149,7 @@ impl RenderOnce for FloatingPanel {
|
||||
.child(self.title),
|
||||
)
|
||||
.child(div().p_3().children(self.body));
|
||||
deferred(anchored().position(at).child(panel))
|
||||
raise(anchored().position(at).child(panel))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user