mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 06:24:39 +00:00
Repair next CI checks and register the remaining text and timeline trials
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -88,8 +88,8 @@ fn attribute(attrs: &[(String, String)], name: &str) -> Option<String> {
|
||||
/// 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 `<tool>` 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<ForeignSet, KysError> {
|
||||
if text.len() > MAX_BYTES {
|
||||
|
||||
+20
-10
@@ -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<G: Glyph, F: Flexibility, M: Measure>(
|
||||
#[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");
|
||||
|
||||
@@ -138,6 +138,7 @@ impl<A: Artwork> PositionedGlyph<A> {
|
||||
#[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));
|
||||
|
||||
@@ -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::<String>();
|
||||
let mut limited = Report::default();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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!("<clipitem id=\"c{i}\"><name>A{i}</name><start>{i}</start><end>{}</end><in>0</in><out>1</out><file id=\"f{i}\"><name>missing{i}</name></file></clipitem>", i + 1)).collect::<String>();
|
||||
let doc = format!("<xmeml><sequence id=\"s\"><name>S</name><media><video><track>{clips}</track></video></media></sequence></xmeml>");
|
||||
|
||||
@@ -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!("<video name=\"missing{i}\" duration=\"1s\"/> ")).collect::<String>();
|
||||
let doc = format!(
|
||||
@@ -633,7 +633,7 @@ fn optional_report_limit_bounds_distinct_fcpxml_diagnostics() {
|
||||
assert_eq!(ordinary.entries.len(), 10);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[trial]
|
||||
fn optional_report_limit_bounds_fcpxml_export_diagnostics_without_changing_output() {
|
||||
let (p, s) = project();
|
||||
let mut ordinary = Report::default();
|
||||
|
||||
@@ -198,6 +198,7 @@ Grouped by gallery level, then shape, then name.
|
||||
| `ParamRows` | Pattern | `craft_ui_patterns::patterns::form_dialogs::rows` | The rows of a parameter list: a group of one labelled field per visible [`Param`], the control chosen by its [`ParamKind`], in a panel the host lays out or inside a dialog |
|
||||
| `PasswordDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::password` | A question with a lock icon, the message, the masked field and the buttons |
|
||||
| `PathRow` | Pattern | `craft_ui_patterns::patterns::form_dialogs::path_row` | A text field with the path, taking the row's room, and a Browse button after it, for a row whose enclosing `Field` shows the label |
|
||||
| `PathSetting` | Pattern | `craft_ui_patterns::patterns::preferences::path_setting` | A path setting for a custom row or page of Preferences ([`CustomSettings`](super::CustomSettings)): the label, then a text field with the path and a Browse… button, over the draft value at `key` |
|
||||
| `PdfExportDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::pdf_export` | File > Save as PDF: a preset row, Standard and Compatibility, and a list of sections (General, Compression, Marks and Bleeds, Output, Advanced, Security and Summary) beside the shown section |
|
||||
| `PreferencesWindow` | Pattern | `craft_ui_patterns::patterns::preferences::window` | The preferences window: a search field over a page list and the shown page, with OK, Cancel and Apply under them |
|
||||
| `PresetBrowser` | Pattern | `craft_ui_patterns::patterns::presets::browser` | A library of named presets shown as thumbnails |
|
||||
|
||||
Reference in New Issue
Block a user