From cbf63c694532b8b459222ae1ba9a0c87960693f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 8 Oct 2026 20:17:09 -0400 Subject: [PATCH] cargo fmt: the Retired, F6 and appearance commits left four files unformatted, failing CI's crate job --- src/feedback/toast.rs | 4 ++-- src/primitives/retired.rs | 5 ++++- src/primitives/tests.rs | 34 +++++++++++++++++++++++++++------- src/settings/appearance.rs | 4 +++- tasks/github.md | 11 +++++++++++ 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/feedback/toast.rs b/src/feedback/toast.rs index 185ffe3..722f983 100644 --- a/src/feedback/toast.rs +++ b/src/feedback/toast.rs @@ -3,8 +3,8 @@ use std::{rc::Rc, time::Duration}; use gpui::{ Anchor, Animation, AnimationExt, AnyElement, App, ClickEvent, Context, ElementId, Entity, FontWeight, HoverListenerMode, InteractiveElement, IntoElement, ParentElement, Pixels, - RenderOnce, Role, SharedString, StatefulInteractiveElement, Styled, Task, Window, anchored, canvas, - div, point, prelude::*, relative, + RenderOnce, Role, SharedString, StatefulInteractiveElement, Styled, Task, Window, anchored, + canvas, div, point, prelude::*, relative, }; use web_time::Instant; diff --git a/src/primitives/retired.rs b/src/primitives/retired.rs index c249d65..1b5943a 100644 --- a/src/primitives/retired.rs +++ b/src/primitives/retired.rs @@ -22,7 +22,10 @@ impl Retired { /// Frees images no one else holds; call while painting. pub fn release(&mut self, window: &mut Window) { // A shared image may still be drawn; it waits. - let (free, held): (Vec<_>, Vec<_>) = self.0.drain(..).partition(|image| Arc::strong_count(image) == 1); + let (free, held): (Vec<_>, Vec<_>) = self + .0 + .drain(..) + .partition(|image| Arc::strong_count(image) == 1); self.0 = held; for image in free { if let Err(error) = window.drop_image(image) { diff --git a/src/primitives/tests.rs b/src/primitives/tests.rs index 3bf58aa..5c25b4c 100644 --- a/src/primitives/tests.rs +++ b/src/primitives/tests.rs @@ -191,7 +191,9 @@ impl Render for Kept { .key_context("HostField") .track_focus(&self.field) .size(px(100.0)) - .on_action(move |_: &Indent, _, cx| view.update(cx, |kept, _| kept.indents += 1)), + .on_action(move |_: &Indent, _, cx| { + view.update(cx, |kept, _| kept.indents += 1) + }), ) .child(div().track_focus(&self.after).size(px(100.0))) } @@ -216,7 +218,11 @@ fn f6_leaves_a_field_that_keeps_tab(cx: &mut TestAppContext) { cx.simulate_keystrokes("tab"); let after = view.read_with(cx, |kept, _| kept.after.clone()); cx.simulate_keystrokes("f6"); - assert_eq!(view.read_with(cx, |kept, _| kept.indents), 1, "Tab stayed in the field"); + assert_eq!( + view.read_with(cx, |kept, _| kept.indents), + 1, + "Tab stayed in the field" + ); cx.update(|window, _| assert!(after.is_focused(window), "F6 moved on")); cx.simulate_keystrokes("shift-f6"); let field = view.read_with(cx, |kept, _| kept.field.clone()); @@ -238,7 +244,9 @@ impl Render for Painted { view.update(cx, |painted, _| { painted.retired.release(window); if let Some(image) = painted.image.clone() { - window.paint_image(bounds, bounds, Default::default(), image, 0, false).expect("paints"); + window + .paint_image(bounds, bounds, Default::default(), image, 0, false) + .expect("paints"); } }) }, @@ -252,7 +260,10 @@ fn a_retired_image_is_freed_at_the_next_paint(cx: &mut TestAppContext) { cx.update(Theme::init); let pixels = image::RgbaImage::from_pixel(2, 2, image::Rgba([1, 2, 3, 255])); let image = std::sync::Arc::new(gpui::RenderImage::new([image::Frame::new(pixels)])); - let (view, cx) = cx.add_window_view(|_, _| Painted { image: Some(image), retired: super::Retired::default() }); + let (view, cx) = cx.add_window_view(|_, _| Painted { + image: Some(image), + retired: super::Retired::default(), + }); cx.run_until_parked(); view.update(cx, |painted, cx| { let old = painted.image.take().expect("painted"); @@ -260,7 +271,10 @@ fn a_retired_image_is_freed_at_the_next_paint(cx: &mut TestAppContext) { cx.notify(); }); cx.run_until_parked(); - assert!(view.read_with(cx, |painted, _| painted.retired.is_empty()), "the old image was freed"); + assert!( + view.read_with(cx, |painted, _| painted.retired.is_empty()), + "the old image was freed" + ); // One still held elsewhere waits until it is let go. let pixels = image::RgbaImage::from_pixel(2, 2, image::Rgba([4, 5, 6, 255])); let shared = std::sync::Arc::new(gpui::RenderImage::new([image::Frame::new(pixels)])); @@ -269,9 +283,15 @@ fn a_retired_image_is_freed_at_the_next_paint(cx: &mut TestAppContext) { cx.notify(); }); cx.run_until_parked(); - assert!(!view.read_with(cx, |painted, _| painted.retired.is_empty()), "a held image waits"); + assert!( + !view.read_with(cx, |painted, _| painted.retired.is_empty()), + "a held image waits" + ); drop(shared); view.update(cx, |_, cx| cx.notify()); cx.run_until_parked(); - assert!(view.read_with(cx, |painted, _| painted.retired.is_empty()), "then it is freed"); + assert!( + view.read_with(cx, |painted, _| painted.retired.is_empty()), + "then it is freed" + ); } diff --git a/src/settings/appearance.rs b/src/settings/appearance.rs index e4c778d..f7b74b9 100644 --- a/src/settings/appearance.rs +++ b/src/settings/appearance.rs @@ -75,7 +75,9 @@ impl RenderOnce for ThemeSelector { .iter() .fold( SegmentedControl::new(self.id, *words), - |control, (_, words, icon)| control.segment(*words, i18n::text(cx, words, &[]), Some(*icon)), + |control, (_, words, icon)| { + control.segment(*words, i18n::text(cx, words, &[]), Some(*icon)) + }, ) .on_change(move |value, window, cx| { let (chosen, _, _) = Appearance::ALL diff --git a/tasks/github.md b/tasks/github.md index c883dd4..8f3d577 100644 --- a/tasks/github.md +++ b/tasks/github.md @@ -12,3 +12,14 @@ - [x] G7 Issue #6: `shell::ColumnShell`, a sidebar that runs to the window's top with the traffic lights, beside one or two panes that bring their own headers; tested - [x] G8 Issue #6: a Layout story, `stories.json`, AGENTS.md and the PRD line; the story runs live on the site - [x] G9 Push, deploy, reply on #6 and #7, close #6 + +# GitHub round, 2026-10-08 + +- [x] G10 CI: `cargo fmt` on the files the last commits left unformatted +- [ ] G11 Issue #7: a caret is a whole number of device pixels wide at a device pixel, so it never shows thin then thick; tested +- [ ] G12 Issue #7: an IME asks for its candidate box past the laid-out text; the box clamps to the last layout, as `bounds_for` does; tested +- [ ] G13 Issue #12: a floating option list occludes, so the wheel scrolls the list and not the page under it; tested +- [ ] G14 Issue #7: BlockEditor scrolls in its own `ScrollArea` with its scrollbar and keeps the caret in view as blocks are added; tested +- [ ] G15 Issue #7: BlockEditor turns into Markdown and back; tested +- [ ] G16 Issue #7: a selection across blocks: drag or Shift-press selects, copy, cut, delete and typing act on it, undo restores; tested +- [ ] G17 Push, reply on #7 and #12