From bb277cc3ac3cb35fd9255301cfd514a805f8ee5d Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 14 Nov 2026 02:51:47 +0000 Subject: [PATCH] Lints: doc links, ungate the click event helper, api map entry for AppPaint, test allowances --- crates/automation/src/client_tests.rs | 1 + crates/automation/tests/it/screenshot.rs | 2 +- crates/pages/src/ui/mod.rs | 32 +++++++++---------- crates/psd/src/tiff/layered.rs | 10 +++--- crates/time/src/soundcraft/mod.rs | 2 +- crates/time/src/soundcraft/tempo.rs | 2 +- .../ui-contract/src/runtime/egui/injected.rs | 1 - migration/api-map/canvas-core.toml | 9 +++++- 8 files changed, 33 insertions(+), 26 deletions(-) diff --git a/crates/automation/src/client_tests.rs b/crates/automation/src/client_tests.rs index 7980b55e3..252841ea6 100644 --- a/crates/automation/src/client_tests.rs +++ b/crates/automation/src/client_tests.rs @@ -5,6 +5,7 @@ use craft_ui::testing::trial; use serde_json::json; +#[allow(clippy::wildcard_imports, reason = "tests use most of the module under test and its helpers")] use super::*; const TOKEN: &str = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"; diff --git a/crates/automation/tests/it/screenshot.rs b/crates/automation/tests/it/screenshot.rs index 5d513ed10..c7a4f86f2 100644 --- a/crates/automation/tests/it/screenshot.rs +++ b/crates/automation/tests/it/screenshot.rs @@ -257,7 +257,7 @@ fn out_of_order_completions_keep_their_tokens() { admit(&mut captures, 11, now).expect("admitted"); admit(&mut captures, 12, now).expect("admitted"); let (_, callbacks) = settle_and_issue(&mut captures, &ctx, now, None); - let [first, second] = <[ScreenshotCallback; 2]>::try_from(callbacks).ok().expect("two captures"); + let Ok([first, second]) = <[ScreenshotCallback; 2]>::try_from(callbacks) else { panic!("two captures") }; second.complete(filled([800, 600], Color32::RED)); first.complete(filled([800, 600], Color32::BLUE)); let mut finished = captures.drain(now, Some(g), None); diff --git a/crates/pages/src/ui/mod.rs b/crates/pages/src/ui/mod.rs index 6e2849f85..4635178ce 100644 --- a/crates/pages/src/ui/mod.rs +++ b/crates/pages/src/ui/mod.rs @@ -1,22 +1,22 @@ //! The page widgets, on craft-ui (feature `ui`). Every one reads the document through a small trait or plain values //! the app passes, and reports what the user did; none owns pages. //! -//! - [`view`]: [`PageView`] over the app's [`PageSource`]; overlays draw on its [`PlacedPage`]s. -//! - [`thumbnails`]: [`PageThumbnails`], the Pages panel and slide strip. -//! - [`access`]: the AccessKit description of the text on the pages. -//! - [`setup`]: [`PageSetupDialog`] and [`PageLayoutMenus`]. -//! - [`margins`]: [`MarginHandles`] on the rulers. -//! - [`header_footer`]: [`HeaderFooterZones`]. -//! - [`range`]: [`PageRangeField`] and [`PageRangeOptions`]. -//! - [`text_selection`]: [`TextSelectTool`], a canvas tool over the app's [`PageTexts`]. -//! - [`preview`]: [`PagePreview`]. -//! - [`marks`]: [`TextFrameMarks`], hidden characters and frame extras. -//! - [`column_bar`]: [`ColumnBar`]. -//! - [`reading`]: [`ReadingView`]. -//! - [`list`]: [`PageList`], pages and artboards. -//! - [`sync_views`]: [`SyncedViews`]. -//! - [`grid`]: [`PageGrids`], margins, columns and baseline grid. -//! - [`table`]: [`EdgePicker`], [`TableProperties`], [`TableSizePicker`], [`CellSelectionOverlay`]. +//! - `view`: [`PageView`] over the app's [`PageSource`]; overlays draw on its [`PlacedPage`]s. +//! - `thumbnails`: [`PageThumbnails`], the Pages panel and slide strip. +//! - `access`: the AccessKit description of the text on the pages. +//! - `setup`: [`PageSetupDialog`] and [`PageLayoutMenus`]. +//! - `margins`: [`MarginHandles`] on the rulers. +//! - `header_footer`: [`HeaderFooterZones`]. +//! - `range`: [`PageRangeField`] and [`PageRangeOptions`]. +//! - `text_selection`: [`TextSelectTool`], a canvas tool over the app's [`PageTexts`]. +//! - `preview`: [`PagePreview`]. +//! - `marks`: [`TextFrameMarks`], hidden characters and frame extras. +//! - `column_bar`: [`ColumnBar`]. +//! - `reading`: [`ReadingView`]. +//! - `list`: [`PageList`], pages and artboards. +//! - `sync_views`: [`SyncedViews`]. +//! - `grid`: [`PageGrids`], margins, columns and baseline grid. +//! - `table`: [`EdgePicker`], [`TableProperties`], [`TableSizePicker`], [`CellSelectionOverlay`]. pub mod access; pub mod column_bar; diff --git a/crates/psd/src/tiff/layered.rs b/crates/psd/src/tiff/layered.rs index 02c531d64..2ac229ce3 100644 --- a/crates/psd/src/tiff/layered.rs +++ b/crates/psd/src/tiff/layered.rs @@ -1,21 +1,21 @@ //! Photoshop's layered-TIFF conventions, observed from files Photoshop writes and reads. //! //! A layered TIFF is an ordinary TIFF whose IFD holds the flattened composite, plus the two tags -//! [`TAG_IMAGE_SOURCE_DATA`] ([`ImageSourceData`]) and [`TAG_IMAGE_RESOURCES`] (the image +//! `TAG_IMAGE_SOURCE_DATA` ([`ImageSourceData`]) and `TAG_IMAGE_RESOURCES` (the image //! resources). Reading one is: decode the composite, read the two tags, and rebuild a //! [`PsdFile`] with [`ImageSourceData::into_psd`], the composite as its merged image -//! ([`interleaved_to_planar`]). Writing one is the reverse ([`planar_to_interleaved`], -//! [`ImageSourceData::for_tiff`], [`ifd_channel_resources`]). +//! (`interleaved_to_planar`). Writing one is the reverse (`planar_to_interleaved`, +//! [`ImageSourceData::for_tiff`], `ifd_channel_resources`). //! //! Photoshop is strict about a few things a PSD reader would not notice: //! //! - `LMsk` must hold its 14-byte record: a zero-length block makes Photoshop report that the //! layer data cannot be read. //! - It writes an empty `Patt` first and a default `FMsk` (filter mask) last, and a set of -//! blocks on every layer ([`photoshop_layer_blocks`]). +//! blocks on every layer (`photoshop_layer_blocks`). //! - The IFD's extra samples are paired with the channel-name resources in order, ignoring the //! `ExtraSamples` kind. When the composite's transparency is not stored in the IFD, those -//! resources must leave it out too ([`ifd_channel_resources`]). +//! resources must leave it out too (`ifd_channel_resources`). use crate::error::{PsdError, Result}; use crate::file::{GlobalLayerMask, PsdFile}; diff --git a/crates/time/src/soundcraft/mod.rs b/crates/time/src/soundcraft/mod.rs index 075a2ade7..50bb269f1 100644 --- a/crates/time/src/soundcraft/mod.rs +++ b/crates/time/src/soundcraft/mod.rs @@ -2,7 +2,7 @@ //! //! Every position in a session is an absolute sample index (`i64`) at the session sample rate. //! This crate converts those positions to and from the five Pro Tools-style timebases -//! (Bars|Beats, Min:Secs, Timecode, Feet+Frames, Samples) through a [`TempoMap`], and computes +//! (Bars|Beats, Min:Secs, Timecode, Feet+Frames, Samples) through a `TempoMap`, and computes //! grid lines and snapping for the Grid / Nudge values. #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] diff --git a/crates/time/src/soundcraft/tempo.rs b/crates/time/src/soundcraft/tempo.rs index 10f44b8dc..2566883d1 100644 --- a/crates/time/src/soundcraft/tempo.rs +++ b/crates/time/src/soundcraft/tempo.rs @@ -52,7 +52,7 @@ pub struct TempoMap { elapsed: Vec, } -/// The serialized form of [`TempoMap`], without the derived lookup table. +/// The serialized form of `TempoMap`, without the derived lookup table. #[derive(serde::Deserialize)] struct TempoMapData { tempos: Vec, diff --git a/crates/ui-contract/src/runtime/egui/injected.rs b/crates/ui-contract/src/runtime/egui/injected.rs index c1aa91508..b53da5ac3 100644 --- a/crates/ui-contract/src/runtime/egui/injected.rs +++ b/crates/ui-contract/src/runtime/egui/injected.rs @@ -25,7 +25,6 @@ pub(crate) fn pointer_moved(pos: Pos2) -> Event { } /// `button` going down or up at `pos` with `modifiers`. -#[cfg(feature = "testing")] pub(crate) fn button(pos: Pos2, button: egui::PointerButton, pressed: bool, modifiers: Modifiers) -> Event { Event::PointerButton { pos, button, pressed, modifiers } } diff --git a/migration/api-map/canvas-core.toml b/migration/api-map/canvas-core.toml index 3809754fb..434c059cc 100644 --- a/migration/api-map/canvas-core.toml +++ b/migration/api-map/canvas-core.toml @@ -267,9 +267,16 @@ note = "`Texture(CachedTexture)`, `Paint(AppPaint)` or `None`." [[type]] name = "NavigatorPaint" old = "craft_ui::canvas::navigator::preview::NavigatorPaint" +new = "" +status = "removed" +note = "Replaced by `craft_ui::canvas::AppPaint`." + +[[type]] +name = "AppPaint" +old = "" new = "craft_ui::canvas::AppPaint" status = "replaced" -note = "`AppPaint::new(|painter: &ContentPainterCx, rect| ..)`: the one app-paint closure of the navigator and `RasterDisplay::painted`." +note = "Replaces `NavigatorPaint`. `AppPaint::new(|painter: &ContentPainterCx, rect| ..)`: the one app-paint closure of the navigator and `RasterDisplay::painted`." [[type]] name = "NavigatorSettings"