Port · Parity: every page matches gpui 0.2.2's; the rules re-tested
Every page and scripted state was shot with gpui 0.2.2 and with the port, light and dark, full width and at 280px, judged pair by pair by agents with skeptics, and every page's log diffed. What differed is fixed, each with a test that fails without it where the test platform can show it: - The gallery's harness takes posted mouse moves (gpui_macos listens to a tracking area), posts each drag move twice (it no longer replays a held drag), and waits three frames before each shot. - Rolling digits: a block column, so taffy 0.13 lends the cell no baseline, and a line of whole device pixels, since gpui snaps each length on its own. DescriptionList's row aligns ends. - Margins that taffy 0.13 collapses through a plain block: the drawer's pull and snap, the stagger and transition rise, the dialog and palette rises, the fullscreen dialog's slide. - An Input keeps room to type in a squeezed row; the field rows drop w_full, whose reason was taffy 0.9's. AGENTS.md's rules that named gpui 0.2.2 or taffy 0.9 were re-tested against both sources and rewritten, and new ones say what the port changed. TASKS.md's tags follow: what the new gpui makes possible is prove. Captions, doc comments and README say what holds now.
This commit is contained in:
1 parent
3189df013f
commit
3f1597fa28
44 files changed
+535
-138
No files matched your search
@@ -111,7 +111,7 @@ fn offset(align: TextAlign, free: Pixels) -> Pixels {
|
||||
}
|
||||
}
|
||||
|
||||
/// One line in the text style around it, cut by `fit` to its box and set by its alignment. gpui 0.2.2 keeps a line's first measure, so its own `truncate` clips instead in flex boxes.
|
||||
/// One line in the text style around it, cut by `fit` to its box and set by its alignment.
|
||||
fn cut_line(text: SharedString, fit: fn(&str, Pixels, &mut Window) -> String) -> Div {
|
||||
let line = text.clone();
|
||||
div()
|
||||
|
||||
@@ -124,8 +124,11 @@ impl RenderOnce for AnimatedNumber {
|
||||
let duration = motion::duration(motion::SLOW * 2, cx);
|
||||
let theme = cx.theme();
|
||||
let size = theme.text_size(self.size);
|
||||
let line = size.to_pixels(window.rem_size()) * LEADING;
|
||||
let scale = window.scale_factor();
|
||||
// gpui snaps rows and margin apart; keep whole device pixels.
|
||||
let line = (size.to_pixels(window.rem_size()) * LEADING * scale).round() / scale;
|
||||
let row = tabular(div())
|
||||
.debug_selector(|| format!("animated-number {}", self.id))
|
||||
.id(self.id)
|
||||
.flex()
|
||||
.h(line)
|
||||
@@ -157,11 +160,15 @@ impl RenderOnce for AnimatedNumber {
|
||||
.into_any_element();
|
||||
};
|
||||
let start = old.to_digit(10).unwrap_or(0);
|
||||
let stack =
|
||||
div().flex().flex_col().children((0..10).map(|digit| {
|
||||
div().h(line).child(SharedString::from(digit.to_string()))
|
||||
}));
|
||||
// A block column lends the cell no baseline.
|
||||
let stack = div().children((0..10).map(|digit| {
|
||||
div()
|
||||
.debug_selector(move || format!("rolling-{digit}"))
|
||||
.h(line)
|
||||
.child(SharedString::from(digit.to_string()))
|
||||
}));
|
||||
div()
|
||||
.debug_selector(|| "rolling-cell".into())
|
||||
.h(line)
|
||||
.overflow_hidden()
|
||||
.child(stack.with_animation(
|
||||
|
||||
Reference in new issue
Block a user