From 007ed30d4a34b7f5a3a899ae7748c6423584bc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Tue, 29 Sep 2026 18:18:05 -0400 Subject: [PATCH] =?UTF-8?q?Port=20=C2=B7=20Parity:=20dark=20shots=20judged?= =?UTF-8?q?;=20the=20status=20shot=20waits=20out=20the=20tooltip;=20commen?= =?UTF-8?q?ts=20one=20short=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- examples/gallery/pages/editor/mod.rs | 2 +- examples/gallery/script.rs | 6 +++--- src/data_display/avatar.rs | 2 +- src/data_display/tests.rs | 2 +- src/finance/tests.rs | 2 +- src/forms/input.rs | 2 +- src/interaction/rotatable.rs | 2 +- src/layout/tests.rs | 2 +- src/motion/tests.rs | 2 +- src/motion/transition.rs | 2 +- src/navigation/palette/mod.rs | 2 +- src/overlays/dialog.rs | 2 +- src/overlays/tests/mod.rs | 2 +- src/primitives/image.rs | 2 +- src/primitives/layer.rs | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ee07385..f8bd819 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -137,7 +137,7 @@ Ely GPUI Component. A component library for GPUI, in light and dark. - Paths with `/` between folders become a tree through `lists::Folder::of`, for `FileTree` and `files::ArchiveViewer` alike. - A folder's path over its entries is `lists::path_bar`, and its first order is `lists::listed`, folders first by name: DirectoryListing and FileExplorer share both, so every view shows one path and one order. - A file's icon comes from `primitives::file_icon`, one map from name to icon for every chapter, under the owner's `primitives::IconTheme`, whose rules by name and extension come first; `files::FileIcon` draws it. What fits across a width comes from `layout::columns_for`, and `layout::fit` adds the inset that centers it. -- Badges, tags and avatars live in `data_display`; forms and shell draw theirs from there, and `data_display` imports neither. A hue worn in a row, a label's or an event's, is `data_display::color_mark`, and `Palette::hue` gives the chart color by index. Avatars take square pictures. A tag is never wider than its container; a long label ends in an ellipsis beside its remove mark. +- Badges, tags and avatars live in `data_display`; forms and shell draw theirs from there, and `data_display` imports neither. A hue worn in a row, a label's or an event's, is `data_display::color_mark`, and `Palette::hue` gives the chart color by index. A tag is never wider than its container; a long label ends in an ellipsis beside its remove mark. - A picture drawn in code reaches gpui as a `RenderImage`. A host that replaces one frees the old through `App::drop_image`, or every frame stays in the sprite atlas (the gallery's model). - `img()` keeps loading state, and moves an animated picture's frames, only with an id; the frames hold still while its window is inactive or gpui's own `reduce_motion` is on, which the theme's reduced motion does not set. Content masks are rectangles, but `img()` draws only the part of its picture inside its box and rounds that part with its own radius, so a `Cover` crop keeps its corners. - gpui reads a `&str` picture source with a scheme as a web address, and any other as an embedded asset. A file goes through `Path` (`documents::source` in the crate, `Path::new` in the gallery). diff --git a/examples/gallery/pages/editor/mod.rs b/examples/gallery/pages/editor/mod.rs index 00a72a9..cf4a55a 100644 --- a/examples/gallery/pages/editor/mod.rs +++ b/examples/gallery/pages/editor/mod.rs @@ -36,7 +36,7 @@ const SCRIPT: &[Step] = &[ Step::Wait(300), Step::DownAt("status", 249.0, 11.0), Step::UpAt("status", 249.0, 11.0), - Step::Wait(300), + Step::Wait(900), Step::Shot("status"), Step::Rest, ]; diff --git a/examples/gallery/script.rs b/examples/gallery/script.rs index 20feda0..4b05969 100644 --- a/examples/gallery/script.rs +++ b/examples/gallery/script.rs @@ -54,7 +54,7 @@ pub enum Step { } const FRAME: Duration = Duration::from_millis(120); -/// How long a shot waits for each frame of the window it shoots. +/// How long a shot waits for each frame. const SHOWN: Duration = Duration::from_secs(5); /// How long an out-of-process file panel may take to open. const PANEL: Duration = Duration::from_secs(10); @@ -151,7 +151,7 @@ pub async fn play( last.x + (goal.x - last.x) * t, last.y + (goal.y - last.y) * t, ); - // Each move twice, as gpui 0.2.2 replayed a held drag; gpui_macos replays only under a real button. + // Each move twice: gpui_macos replays no posted drag. for _ in 0..2 { send(window, Mouse::Drag, at, cx)?; cx.background_executor() @@ -255,7 +255,7 @@ pub async fn play( Ok(()) } -/// Waits three frames: the first draws what the steps left, and AppKit shows it by the third, since gpui presents without waiting on the GPU. +/// Waits three frames, until AppKit shows what the steps left. pub async fn shown(window: gpui::AnyWindowHandle, cx: &mut AsyncApp) -> Result<()> { for _ in 0..3 { let (drawn, frame) = futures::channel::oneshot::channel(); diff --git a/src/data_display/avatar.rs b/src/data_display/avatar.rs index 575e88e..3bd8459 100644 --- a/src/data_display/avatar.rs +++ b/src/data_display/avatar.rs @@ -86,7 +86,7 @@ impl Avatar { } } - /// A square picture: gpui clips pictures to rectangles, so a cropped one keeps square corners. + /// A picture, cropped to fill the avatar. pub fn image(mut self, source: impl Into) -> Self { self.image = Some(source.into()); self diff --git a/src/data_display/tests.rs b/src/data_display/tests.rs index df74a34..8d2889a 100644 --- a/src/data_display/tests.rs +++ b/src/data_display/tests.rs @@ -177,7 +177,7 @@ fn units_rest_on_the_bottom_of_a_statistics_number(cx: &mut TestAppContext) { } } -/// A lone digit in extra-small text, whose line is no whole number of device pixels. +/// A lone digit whose line is no whole device pixel. struct Nine; impl Render for Nine { diff --git a/src/finance/tests.rs b/src/finance/tests.rs index 5c47444..bd6217e 100644 --- a/src/finance/tests.rs +++ b/src/finance/tests.rs @@ -148,7 +148,7 @@ fn every_chart_fills_a_column_its_block_measures_by_content(cx: &mut TestAppCont ); } -/// A converter in a 460px box beside a card 260 wide, in a 280px row. +/// A converter squeezed beside a card in a 280px row. struct Squeezed; impl Render for Squeezed { diff --git a/src/forms/input.rs b/src/forms/input.rs index eb1e399..1fc1ee8 100644 --- a/src/forms/input.rs +++ b/src/forms/input.rs @@ -125,7 +125,7 @@ impl RenderOnce for Input { .flex_1() .min_w_0() .child(self.state) - // An empty strut keeps the frame's inset to type in; squeezed, it spills unseen. + // An empty strut keeps the frame's inset to type in. .child(div().px(theme.control_padding(self.size)).border_x_1()), ) .when(self.clearable && !empty && !disabled, |frame| { diff --git a/src/interaction/rotatable.rs b/src/interaction/rotatable.rs index 1b95217..d6aa963 100644 --- a/src/interaction/rotatable.rs +++ b/src/interaction/rotatable.rs @@ -28,7 +28,7 @@ fn angle_at(bounds: Bounds, at: Point, snap: bool) -> f32 { type OnTurn = Rc; -/// An svg turned to its angle, in degrees clockwise from straight up, inside a ring with a knob at that angle. A drag on the knob turns it, Shift snapping to 15°; with focus, Left and Right turn it by 15°. gpui turns svgs alone, so the picture is an svg path. +/// An svg turned clockwise by degrees, with a knob to drag. #[derive(IntoElement)] pub struct Rotatable { id: ElementId, diff --git a/src/layout/tests.rs b/src/layout/tests.rs index b0be8bd..0edfcb3 100644 --- a/src/layout/tests.rs +++ b/src/layout/tests.rs @@ -68,7 +68,7 @@ fn opened(cx: &mut TestAppContext, reduced: bool) -> &mut VisualTestContext { cx } -/// Presses on the grab and drags it down by `dy`, past gpui's drag threshold. +/// Presses the grab and drags it down by `dy`. fn pull(cx: &mut VisualTestContext, dy: f32) -> Point { let rest = body(cx).origin; let grab = point(rest.x + px(10.0), rest.y - px(28.0)); diff --git a/src/motion/tests.rs b/src/motion/tests.rs index d876b1d..4e255d4 100644 --- a/src/motion/tests.rs +++ b/src/motion/tests.rs @@ -403,7 +403,7 @@ fn effects_keep_their_content_and_let_presses_through(cx: &mut TestAppContext) { assert_eq!(view.read_with(cx, |effects, _| effects.presses), 1); } -/// Rows rising in, in a sized box down a column that fills a row. +/// Rows rising in a sized box. struct Rising; impl Render for Rising { diff --git a/src/motion/transition.rs b/src/motion/transition.rs index 3cdcbfb..3fef196 100644 --- a/src/motion/transition.rs +++ b/src/motion/transition.rs @@ -63,7 +63,7 @@ pub(super) fn arrive(element: E, entrance: Entrance, t: f32) -> E { let t = ease_out_cubic(t); match entrance { Entrance::Fade => element.opacity(t), - // Padding, as taffy's size cache drops a margin that collapses through a block. + // Padding: taffy's size cache drops a collapsed margin. Entrance::Rise => element.opacity(t).pt(NUDGE * 2.0 * (1.0 - t)), Entrance::Slide => element.opacity(t).ml(NUDGE * -4.0 * (1.0 - t)), } diff --git a/src/navigation/palette/mod.rs b/src/navigation/palette/mod.rs index 9346c41..a5eb7ea 100644 --- a/src/navigation/palette/mod.rs +++ b/src/navigation/palette/mod.rs @@ -383,7 +383,7 @@ impl Palette { ) }), ); - // Padding grows the box a scrim centers, as a margin taffy kept would. + // Padding grows the box the scrim centers. div().child(card).with_animation( (self.id, "in"), Animation::new(motion::duration(motion::BASE, cx)).with_easing(motion::ease_out_cubic), diff --git a/src/overlays/dialog.rs b/src/overlays/dialog.rs index 4405009..b533227 100644 --- a/src/overlays/dialog.rs +++ b/src/overlays/dialog.rs @@ -237,7 +237,7 @@ impl RenderOnce for Dialog { }) .into_any_element() } else { - // Padding grows the box the scrim centers, as a margin taffy kept would. + // Padding grows the box the scrim centers. div() .child(card) .with_animation((self.id.clone(), "in"), arrive, |card, t| { diff --git a/src/overlays/tests/mod.rs b/src/overlays/tests/mod.rs index c9940a5..8f60f71 100644 --- a/src/overlays/tests/mod.rs +++ b/src/overlays/tests/mod.rs @@ -433,7 +433,7 @@ fn a_popover_opened_by_its_owner_takes_no_icon() { let _ = Popover::with_opener("own", |_| div(), |_, _, _| div()).icon(IconName::Clock); } -/// A dialog open from the first frame, with a body the test can find. +/// A dialog open from the first frame. struct Rising; impl Render for Rising { diff --git a/src/primitives/image.rs b/src/primitives/image.rs index 589216e..6193a90 100644 --- a/src/primitives/image.rs +++ b/src/primitives/image.rs @@ -33,7 +33,7 @@ pub(crate) fn framed(ratio: f32, cx: &App) -> Div { frame } -/// Themed `img()` that fills the box it is given; a `Cover` crop keeps its rounded corners. +/// Themed `img()` that fills the box it is given. #[derive(IntoElement)] pub struct Image { id: ElementId, diff --git a/src/primitives/layer.rs b/src/primitives/layer.rs index 78deb1e..950891c 100644 --- a/src/primitives/layer.rs +++ b/src/primitives/layer.rs @@ -16,7 +16,7 @@ fn nested() -> bool { LAYERS.with_borrow(|layers| !layers.is_empty()) } -/// Draws `child` over the page, as gpui's `deferred` does. gpui paints deferred draws by priority alone, so what is raised inside something raised is laid out and drawn last within it, under `id`: a list opened in a dialog lies over the dialog and keeps its state. +/// Draws `child` over the page; inside a raise, last within it. pub fn raise(id: impl Into, child: impl IntoElement) -> Raised { let layer = Layer { child: child.into_any_element(),