diff --git a/crates/ui-egui/src/panels/actions/new_layout_tests.rs b/crates/ui-egui/src/panels/actions/new_layout_tests.rs index 1a1231110df..2ee9abe9b1d 100644 --- a/crates/ui-egui/src/panels/actions/new_layout_tests.rs +++ b/crates/ui-egui/src/panels/actions/new_layout_tests.rs @@ -53,7 +53,7 @@ fn streamed_history_keeps_the_root_boundary_across_quanta_and_nested_dialogs() { assert!(!app.ui.status_error, "{}", app.ui.status); let state = app.session.active().unwrap(); assert!(state.doc.layers.iter().any(|layer| layer.name == "Tail")); - assert_eq!(state.history.past_len(), past + if single { 1 } else { 2 }, "nested={nested}, dialog={dialog}"); + assert_eq!(state.history.past_len(), past + if single { 1 } else { 2 + usize::from(dialog) }, "nested={nested}, dialog={dialog}"); if single { assert_eq!(state.history.entries().last().map(String::as_str), Some("Action: Root")); app.run("edit.undo", json!({})).unwrap(); diff --git a/crates/ui-egui/src/panels/actions/tests.rs b/crates/ui-egui/src/panels/actions/tests.rs index 2b95ab3293b..827ee8de34d 100644 --- a/crates/ui-egui/src/panels/actions/tests.rs +++ b/crates/ui-egui/src/panels/actions/tests.rs @@ -104,6 +104,15 @@ fn single_history_dialog_refuses_intervening_edit_or_document_switch() { /// Prepare a real paused spelling step with a known document and history boundary, under either grouping policy. fn paused_history_spelling(single: bool, gate: Option) -> (PhotocraftApp, std::sync::Arc, usize) { + paused_history_spelling_with(single, gate, |_| {}) +} + +/// Configure the complete definition before its immutable playback snapshot is paused. +fn paused_history_spelling_with( + single: bool, + gate: Option, + configure: impl FnOnce(&mut Vec), +) -> (PhotocraftApp, std::sync::Arc, usize) { let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); app.run("file.new", json!({"width":300,"height":100})).unwrap(); app.run("type.create", json!({"x":10,"y":50,"text":"Teh brwon"})).unwrap(); @@ -120,6 +129,7 @@ fn paused_history_spelling(single: bool, gate: Option) -> (PhotocraftApp, ); action.dialogs.insert(1); app.session.actions.list.push(action); + configure(&mut app.session.actions.list); app.session.authorize = gate; let paused = play(&mut app, &json!({"action":"Spell"})).unwrap(); assert_eq!(paused["paused"]["dialog"], crate::type_panels_ui::SPELLING, "{paused}"); @@ -2400,11 +2410,12 @@ fn a_changed_live_gate_cannot_be_replaced_for_the_remaining_action() { } for service in [false, true] { for nested in [false, true] { - let (mut app, before, past) = paused_history_spelling(true, Some(deny_wide_blur)); - if nested { - app.session.actions.list.push(Action::new("Nested tail", vec![("layer.renameLayer".into(), json!({"name":"Forbidden tail"}))])); - app.session.actions.list[0].steps[2] = ("actions.play".into(), json!({"action":"Nested tail"})); - } + let (mut app, before, past) = paused_history_spelling_with(true, Some(deny_wide_blur), |list| { + if nested { + list.push(Action::new("Nested tail", vec![("layer.renameLayer".into(), json!({"name":"Forbidden tail"}))])); + list[0].steps[2] = ("actions.play".into(), json!({"action":"Nested tail"})); + } + }); spelling_change(&mut app, json!({"action":"change","start":0,"end":3,"word":"Teh","replace":"The"})).unwrap(); let corrected = app.session.active().unwrap().doc.clone(); if service { @@ -2509,8 +2520,7 @@ fn configured_gates_require_one_composed_policy_for_automated_resume() { #[test] /// A policy change after the final spelling step must not discard completed edits when no tail remains to dispatch. fn a_changed_gate_after_the_last_spelling_step_keeps_completed_edits() { - let (mut app, before, past) = paused_history_spelling(true, Some(deny_wide_blur)); - app.session.actions.list[0].steps.truncate(2); + let (mut app, before, past) = paused_history_spelling_with(true, Some(deny_wide_blur), |list| list[0].steps.truncate(2)); spelling_change(&mut app, json!({"action":"change","start":0,"end":3,"word":"Teh","replace":"The"})).unwrap(); let corrected = app.session.active().unwrap().doc.clone(); app.session.authorize = Some(|_, _| Ok(())); diff --git a/docs/scorecard.md b/docs/scorecard.md index 713d5a3dc8d..c63d5968d20 100644 --- a/docs/scorecard.md +++ b/docs/scorecard.md @@ -9,7 +9,7 @@ Generated by `cargo xtask scorecard` from `perf/budgets.toml`, `perf/baseline.js | [Performance](#performance) | 3 | 22 | 45 | 79 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 41 not run, 4 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 11 | 14 | 2 | io corpus: oracle ≥ 148/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 249/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 190/258, round trip ≥ 258/258 | | [Tools](#tools) | 36 | 9 | 0 | | -| [Workspace and UI](#workspace-and-ui) | 15 | 6 | 2 | settings that do nothing: 10 of 187 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 15 | 6 | 2 | settings that do nothing: 10 of 188 (target 0) | | [Type](#type) | 5 | 5 | 0 | | | [Automation](#automation) | 5 | 3 | 3 | 640 of 640 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present | @@ -203,7 +203,7 @@ Corpus floors (`crates/io/tests/it/corpus.rs`): the enforced minimums; the corpu ## Workspace and UI -**Settings that do nothing: 10 of 187** (target 0, #204). Counted by the prefs audit (`xtask/src/scorecard.rs`): a `Preferences` field counts as read when code outside the prefs model (`prefs.rs` except its `impl Session` blocks; tests excluded; the schema-driven dialog never names a field) accesses `section.field`, or `.section` and `.field` in the same file, or calls a section method that reads `self.field`. It is a heuristic lower bound: a generic name can look read when it isn't. +**Settings that do nothing: 10 of 188** (target 0, #204). Counted by the prefs audit (`xtask/src/scorecard.rs`): a `Preferences` field counts as read when code outside the prefs model (`prefs.rs` except its `impl Session` blocks; tests excluded; the schema-driven dialog never names a field) accesses `section.field`, or `.section` and `.field` in the same file, or calls a section method that reads `self.field`. It is a heuristic lower bound: a generic name can look read when it isn't. Unread: `general.color_picker`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `performance.legacy_compositing`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `type_.text_engine`, `enhanced_controls.scrubby_slider_acceleration`.