diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 02cdf71c8..30584ba48 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -40,6 +40,10 @@ workflows: - 'actions/checkout@v7.0.1' - 'step-security/dtolnay-rust-toolchain@v1.0.0' - 'step-security/harden-runner@v2.22.4' + '.github/workflows/docs.yml': + - 'actions/checkout@v7' + - 'dtolnay/rust-toolchain@stable' + - 'swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0' '.github/workflows/ecproj-format.yml': - 'actions/checkout@v7.0.1' - 'step-security/dtolnay-rust-toolchain@v1.0.0' @@ -101,6 +105,9 @@ workflows: - 'step-security/harden-runner@v2.22.4' - 'step-security/rust-cache@v2.9.2' '.github/workflows/sonarcloud.yml': [] + '.github/workflows/theme.yml': + - 'actions/checkout@v7' + - 'dtolnay/rust-toolchain@stable' '.github/workflows/ui.yml': - 'actions/checkout@v7.0.1' - 'step-security/dtolnay-rust-toolchain@v1.0.0' @@ -146,6 +153,11 @@ dependencies: commit: 'sha1-11d5960a326750d5838078e36cf38b85af677262' owner_id: 44036562 repo_id: 197814629 + 'actions/checkout@v7': + ref: 'v7' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 'actions/checkout@v7.0.1': ref: 'v7.0.1' commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' @@ -181,6 +193,11 @@ dependencies: commit: 'sha1-76747d22a7567cc4438546a84f11bdf18e670ab8' owner_id: 88700172 repo_id: 1382753260 + 'swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0': + ref: 'v2.9.3' + commit: 'sha1-d1527c8f67ef9af357290475d4af4b0fab8f12e0' + owner_id: 580492 + repo_id: 298565987 'swatinem/rust-cache@v2.9.3': ref: 'v2.9.3' commit: 'sha1-d1527c8f67ef9af357290475d4af4b0fab8f12e0' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5bd990d93..c42cc0df8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,7 +25,7 @@ jobs: # The token isn't needed after checkout; cargo runs build scripts and proc macros from # dependencies, so don't leave it in .git/config for that third-party code to read. persist-credentials: false - - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable + - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: Docs (links and missing docs) run: cargo doc --workspace --no-deps --locked --keep-going diff --git a/.github/workflows/theme.yml b/.github/workflows/theme.yml index b61e9efcf..ee831e156 100644 --- a/.github/workflows/theme.yml +++ b/.github/workflows/theme.yml @@ -22,7 +22,7 @@ jobs: # The token isn't needed after checkout; cargo runs build scripts and proc macros from # dependencies, so don't leave it in .git/config for that third-party code to read. persist-credentials: false - - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable + - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy targets: wasm32-unknown-unknown diff --git a/crates/craft/src/lib.rs b/crates/craft/src/lib.rs index 1dd312466..9bd4ad021 100644 --- a/crates/craft/src/lib.rs +++ b/crates/craft/src/lib.rs @@ -12,7 +12,7 @@ pub use craft_aaf as aaf; pub use craft_aep as aep; #[cfg(feature = "affinity")] pub use craft_affinity as affinity; -#[cfg(feature = "ai-agents")] +#[cfg(feature = "craft-ai-agents")] pub use craft_ai_agents as ai_agents; #[cfg(feature = "ai-core")] pub use craft_ai_core as ai_core; diff --git a/crates/keymap/src/import/kys.rs b/crates/keymap/src/import/kys.rs index 4f29bc8a0..c26987e85 100644 --- a/crates/keymap/src/import/kys.rs +++ b/crates/keymap/src/import/kys.rs @@ -88,8 +88,8 @@ fn attribute(attrs: &[(String, String)], name: &str) -> Option { /// command row with a name (its keys in the file's flavour, an id from [`ID_ATTRIBUTE`] or /// `pc-id` as the entry's [`ForeignEntry::id`] when present), and the `` rows as tool /// entries (a tool key with modifiers is read as an unsupported-modifier error, so [`crate::plan`] reports it unreadable and binds nothing). Rows without a name are skipped; rows without a shortcut stay, with no keys. -/// A file that is not well-formed, declares a document type or nests deeper than [`MAX_DEPTH`] -/// is not a set; each entry carries the line its row starts on, for the import report. +/// A file that is not well-formed, declares a document type or nests deeper than 512 levels is not +/// a set; each entry carries the line its row starts on, for the import report. // pc: crates/engine/src/kys.rs:66 `parse`, :54 `filename_to_name`, :128 `to_ours`. pub fn read(text: &str) -> Result { if text.len() > MAX_BYTES { diff --git a/crates/text/src/composer.rs b/crates/text/src/composer.rs index fc2067f3f..143b33e45 100644 --- a/crates/text/src/composer.rs +++ b/crates/text/src/composer.rs @@ -6,8 +6,9 @@ //! fall in fitness classes more than one apart (a tight line next to a loose one). //! //! - **Justified** lines: word spacing, letter spacing and glyph scaling may stretch and shrink -//! within the paragraph's Justification options (each glyph's [`Flexibility`]); the badness comes from -//! the stretch/shrink ratio, so loose lines are traded for evenly spaced ones. +//! within the paragraph's Justification options (each glyph's +//! [`Flexibility`](crate::composer::Flexibility)); the badness comes from the stretch/shrink +//! ratio, so loose lines are traded for evenly spaced ones. //! - **Ragged** lines (left/centre/right aligned): spaces keep their width, so a line never //! shrinks (it must fit). The badness comes from the line's leftover space measured against a //! rag zone of a sixth of the line width, so the rag is even rather than full lines followed by @@ -16,14 +17,20 @@ /// Glyph measurements needed by the paragraph composer. pub trait Glyph { + /// How far the pen moves past the glyph: its width on the line. fn advance(&self) -> f64; + /// Whether the glyph is a space. A break drops the spaces before it. fn is_space(&self) -> bool; + /// Whether the glyph is a soft hyphen: a break there stays a break whatever Hyphen Limit asks of + /// automatic hyphenation, though it counts as a hyphenated line. fn is_soft_hyphen(&self) -> bool; } /// Stretch and shrink available for a glyph. pub trait Flexibility { + /// How far the glyph may stretch to fill a justified line, in the units of [`Glyph::advance`]. fn stretch(&self) -> f64; + /// How far the glyph may shrink to fit a justified line, in the units of [`Glyph::advance`]. fn shrink(&self) -> f64; } @@ -50,7 +57,9 @@ const EPS: f64 = 1e-6; /// added when breaking there (0 = no hyphen). #[derive(Clone, Copy, Debug, PartialEq)] pub struct Breakpoint { + /// The glyph index the line ends at, exclusive. pub end: usize, + /// The width of the hyphen added when the line breaks here; 0 for a break with no hyphen. pub hyphen: f64, } @@ -336,6 +345,7 @@ pub fn compose_with( #[cfg(test)] mod tests { use super::*; + use craft_ui::testing::trial; struct Unit(char); impl Glyph for Unit { @@ -358,7 +368,7 @@ mod tests { 0.0 } } - #[test] + #[trial] fn rejects_breaks_that_move_backwards() { let glyphs: Vec<_> = "abcd".chars().map(Unit).collect(); let candidates = [Breakpoint { end: 3, hyphen: 0.0 }, Breakpoint { end: 1, hyphen: 0.0 }]; @@ -366,7 +376,7 @@ mod tests { assert_eq!(compose(&glyphs, &|_| 3.0, &|_| 0.0, &|_| 0.0, &candidates, &[] as &[Rigid], ¶ms), None); } - #[test] + #[trial] fn composes_ragged_paragraph_and_trims_spaces() { let glyphs: Vec<_> = "aa bb cc".chars().map(Unit).collect(); let candidates = [Breakpoint { end: 3, hyphen: 0.0 }, Breakpoint { end: 6, hyphen: 0.0 }]; @@ -405,7 +415,7 @@ mod tests { Breakpoint { end, hyphen } } - #[test] + #[trial] fn fitness_classes_and_adjustment_ratios() { assert_eq!([-0.6, 0.0, 0.7, 2.0].map(|r| fitness(r, false)), [0, 1, 2, 3]); assert_eq!([0.1, 0.3, 0.5, 0.9].map(|r| fitness(r, true)), [0, 1, 2, 3]); @@ -422,7 +432,7 @@ mod tests { assert_eq!(adjustment_ratio(11.0, 10.0, 0.0, 0.0, false, &ragged), None); } - #[test] + #[trial] fn empty_and_unmeasurable_paragraphs() { let none: [Unit; 0] = []; assert_eq!(compose(&none, &|_| 3.0, &|_| 0.0, &|_| 0.0, &[], &[] as &[Rigid], &justified()), Some(vec![])); @@ -430,7 +440,7 @@ mod tests { assert_eq!(compose(&huge, &|_| 3.0, &|_| 0.0, &|_| 0.0, &[], &[] as &[Rigid], &justified()), None); } - #[test] + #[trial] fn justified_lines_stretch_and_shrink_within_tolerance() { let glyphs = units("a a b b"); let flex: Vec<_> = glyphs.iter().map(|g| if g.0 == ' ' { Flex(1.0, 0.5) } else { Flex(0.0, 0.0) }).collect(); @@ -450,7 +460,7 @@ mod tests { assert_eq!(compose(&word, &|_| 4.0, &|_| 0.0, &|_| 0.0, &[], &[Rigid, Rigid], &all), Some(vec![(2, false)])); } - #[test] + #[trial] fn hyphen_limit_and_soft_hyphens() { // "ab-cd-ef" with hyphenation points after each pair: every line wants a hyphen. let glyphs = units("abcdef"); @@ -468,7 +478,7 @@ mod tests { assert_eq!(out, vec![(3, true), (6, true), (8, false)]); } - #[test] + #[trial] fn credits_are_clamped_to_the_glyph_and_ignored_when_not_finite() { let glyphs = units("aa bb"); let cands = [brk(3, 0.0)]; @@ -504,7 +514,7 @@ mod tests { } } - #[test] + #[trial] fn measure_can_end_reach_widen_or_exhaust() { let ragged = Params { justify_last: false, ragged: true, tolerance: 100.0, uniform_from: 0, hyphen_limit: 0 }; let two = units("aa bb"); diff --git a/crates/text/src/positioned.rs b/crates/text/src/positioned.rs index cb749cac5..0c15132a3 100644 --- a/crates/text/src/positioned.rs +++ b/crates/text/src/positioned.rs @@ -138,6 +138,7 @@ impl PositionedGlyph { #[cfg(test)] mod tests { use super::*; + use craft_ui::testing::trial; #[derive(Clone, Debug)] struct TestArt; @@ -184,7 +185,7 @@ mod tests { off_path: false, } } - #[test] + #[trial] fn caret_mapping_tracks_ligatures_rtl_and_kerning() { let mut g = glyph(); assert_eq!((g.caret_offset(3, 12.0), g.caret_offset(5, 12.0), g.caret_offset(7, 12.0)), (0.0, 6.0, 12.0)); @@ -195,7 +196,7 @@ mod tests { g.width = f64::NAN; assert_eq!(g.caret_offset(5, 8.0), 4.0); } - #[test] + #[trial] fn artwork_uses_the_same_composition_order() { let g = glyph(); let doc = Affine::translate((10.0, 20.0)); diff --git a/crates/timeline/src/edl.rs b/crates/timeline/src/edl.rs index 1d794dc21..d4c5a2cb1 100644 --- a/crates/timeline/src/edl.rs +++ b/crates/timeline/src/edl.rs @@ -597,8 +597,9 @@ M2 A001 -012.0 00;00;00;00\n\ #[cfg(test)] mod report_limit_tests { use super::*; + use craft_ui::testing::trial; - #[test] + #[trial] fn caps_distinct_unrecognized_lines_without_changing_default() { let text = (0..10).map(|i| format!("unrecognized-{i}\n")).collect::(); let mut limited = Report::default(); diff --git a/crates/timeline/src/report.rs b/crates/timeline/src/report.rs index 9a9782691..7ef375170 100644 --- a/crates/timeline/src/report.rs +++ b/crates/timeline/src/report.rs @@ -98,8 +98,9 @@ impl std::fmt::Display for Report { #[cfg(test)] mod tests { use super::*; + use craft_ui::testing::trial; - #[test] + #[trial] fn limited_entries_share_one_budget_and_keep_existing_counts() { let mut r = Report::default(); r.info_limited(Some(2), "a"); diff --git a/crates/timeline/tests/it/fcp7.rs b/crates/timeline/tests/it/fcp7.rs index f26e952c8..476fa9243 100644 --- a/crates/timeline/tests/it/fcp7.rs +++ b/crates/timeline/tests/it/fcp7.rs @@ -788,7 +788,7 @@ fn nested_sequence_chain_is_bounded_and_reimported_at_a_shallower_depth() { assert!(nested.is_some_and(|seq| seq.video_tracks.first().is_some_and(|track| track.items.len() == 1))); } -#[test] +#[trial] fn optional_report_limit_bounds_distinct_fcp7_diagnostics() { let clips = (0..10).map(|i| format!("A{i}{i}{}01missing{i}", i + 1)).collect::(); let doc = format!("S"); diff --git a/crates/timeline/tests/it/fcpxml.rs b/crates/timeline/tests/it/fcpxml.rs index 2e68828b7..a6570e190 100644 --- a/crates/timeline/tests/it/fcpxml.rs +++ b/crates/timeline/tests/it/fcpxml.rs @@ -617,7 +617,7 @@ fn shallower_retry_does_not_link_a_cached_ancestor_back_to_the_rebuilt_item() { } } -#[test] +#[trial] fn optional_report_limit_bounds_distinct_fcpxml_diagnostics() { let unknown = (0..10).map(|i| format!("