From c39de363431a0827d8cf21be4a4bdc697e28960f Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 12 Oct 2026 15:09:40 +0200 Subject: [PATCH 01/10] History Options: Automatically Create First Snapshot, New Snapshot When Saving, Show New Snapshot Dialog by Default (#2966) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three snapshot options of History panel ☰ › History Options… that #3535 leaves out, as in Photoshop. Builds on #3567 (first snapshot, New Snapshot dialog) and #3535 (History Options dialog), which this branch merges. Co-Authored-By: Claude Opus 5.5 (1M context) --- Cargo.lock | 1 + crates/automation/src/headless.rs | 2 + crates/automation/tests/save_snapshot.rs | 47 +++++ crates/engine/Cargo.toml | 3 + crates/engine/src/history_options_cmds.rs | 198 +++++++++++++++++++--- crates/engine/src/lib.rs | 8 +- crates/engine/src/prefs.rs | 21 ++- crates/ui-egui/src/history_options_ui.rs | 41 +++-- crates/ui-egui/src/i18n/cs.tsv | 3 + crates/ui-egui/src/i18n/de.tsv | 3 + crates/ui-egui/src/i18n/es.tsv | 3 + crates/ui-egui/src/i18n/ko.tsv | 3 + crates/ui-egui/src/i18n/vi.tsv | 3 + crates/ui-egui/src/i18n/zh-hans.tsv | 3 + crates/ui-egui/src/i18n/zh-hant.tsv | 3 + crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/panels.rs | 73 +++++++- crates/ui-egui/src/view_cmds.rs | 7 +- docs/control-protocol.md | 2 +- docs/scorecard.md | 4 +- docs/ui-parity.md | 5 +- 21 files changed, 393 insertions(+), 42 deletions(-) create mode 100644 crates/automation/tests/save_snapshot.rs diff --git a/Cargo.lock b/Cargo.lock index 160403c482..412e6676f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4349,6 +4349,7 @@ name = "photocraft-engine" version = "0.8.0" dependencies = [ "blake3", + "chrono", "exr", "flate2", "photocraft-affinity", diff --git a/crates/automation/src/headless.rs b/crates/automation/src/headless.rs index cd92f584a2..e1745391a1 100644 --- a/crates/automation/src/headless.rs +++ b/crates/automation/src/headless.rs @@ -268,6 +268,8 @@ impl Headless { if let Some(st) = self.session.active_mut() { st.saved_to(target.to_string_lossy().into_owned()); } + // History Options › Automatically Create New Snapshot When Saving (#2966). + photocraft_engine::history_options_cmds::snapshot_on_save(&mut self.session); if let Some(active) = previously_active { self.session.set_active(active); } diff --git a/crates/automation/tests/save_snapshot.rs b/crates/automation/tests/save_snapshot.rs new file mode 100644 index 0000000000..95c922c4a3 --- /dev/null +++ b/crates/automation/tests/save_snapshot.rs @@ -0,0 +1,47 @@ +//! History Options › Automatically Create New Snapshot When Saving (#2966) through the headless +//! server: a save of the document to its own layered file adds a snapshot when the option is on; +//! a flat export is a copy and adds none, and with the option off no save does. + +use photocraft_automation::Headless; +use serde_json::json; + +fn tmp() -> std::path::PathBuf { + let dir = std::env::temp_dir().join(format!( + "pc-save-snapshot-{}-{}", + std::process::id(), + std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos() + )); + std::fs::create_dir_all(&dir).unwrap(); + dir +} + +fn snapshots(h: &Headless) -> usize { + h.session.active().unwrap().snapshots.len() +} + +#[test] +fn a_document_save_adds_a_snapshot_only_with_the_option() { + let dir = tmp(); + let psd = dir.join("a.psd"); + let png = dir.join("a.png"); + let mut h = Headless::trusted_local(); + h.handle("doc.new", json!({"width": 8, "height": 8, "background": "white"})).unwrap(); + assert_eq!(snapshots(&h), 1, "the first snapshot"); + + // Off (the default): saving adds nothing. + h.handle("doc.save", json!({"path": psd.to_str().unwrap()})).unwrap(); + assert_eq!(snapshots(&h), 1); + + h.handle("engine.execute", json!({"command": "history.options", "params": {"automaticallyCreateNewSnapshotWhenSaving": true}})).unwrap(); + h.handle("engine.execute", json!({"command": "image.adjustments.invert", "params": {}})).unwrap(); + h.handle("doc.save", json!({})).unwrap(); + assert_eq!(snapshots(&h), 2, "the save added one"); + let st = h.session.active().unwrap(); + assert!(std::sync::Arc::ptr_eq(&st.snapshots[1].doc, &st.doc), "of the document as saved"); + assert!(!st.is_dirty(), "and the document stays saved"); + + // A flat export is a copy, not a save of the document. + h.handle("doc.save", json!({"path": png.to_str().unwrap()})).unwrap(); + assert_eq!(snapshots(&h), 2); + std::fs::remove_dir_all(dir).unwrap(); +} diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index d15e0f985a..21375c4131 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -40,6 +40,9 @@ roxmltree = "0.20" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] tempfile = "3" +# The local time that names History Options' snapshot on save (#2966); already in the tree +# through rmcp. The web build has no local clock here and names it "Snapshot N". +chrono = { version = "0.4", default-features = false, features = ["clock"] } [dev-dependencies] photocraft-affinity = { workspace = true, features = ["synth"] } diff --git a/crates/engine/src/history_options_cmds.rs b/crates/engine/src/history_options_cmds.rs index 88cec69f6e..c812b0d6d0 100644 --- a/crates/engine/src/history_options_cmds.rs +++ b/crates/engine/src/history_options_cmds.rs @@ -1,35 +1,96 @@ -//! History panel › History Options… (#2966): Allow Non-Linear History and Make Layer Visibility -//! Changes Undoable. The values are preferences (`historyOptions.*`, also `prefs.set`), applied -//! by [`Session::apply_prefs`] and [`Session::edit_visibility`]. Without params the command -//! reports them; the GUI opens its dialog instead and runs it with the dialog's values on OK. -//! -//! Photoshop's three snapshot options (Automatically Create First Snapshot, Automatically -//! Create New Snapshot When Saving, Show New Snapshot Dialog by Default) are not here: snapshots -//! are not implemented, and a checkbox that does nothing is worse than a missing one. +//! History panel › History Options… (#2966), Photoshop's five checkboxes: Automatically Create +//! First Snapshot, Automatically Create New Snapshot When Saving, Allow Non-Linear History, Show +//! New Snapshot Dialog by Default and Make Layer Visibility Changes Undoable. The values are +//! preferences (`historyOptions.*`, also `prefs.set`), applied by [`Session::add_document`], +//! [`snapshot_on_save`], [`Session::apply_prefs`], [`Session::edit_visibility`] and the GUI's +//! camera button. Without params the command reports them; the GUI opens its dialog instead and +//! runs it with the dialog's values on OK. use serde_json::{Map, Value}; use crate::commands::CommandSpec; +use crate::history_cmds::Snapshot; +use crate::prefs::HistoryOptions; use crate::{EngineError, Result, Session}; const CMD: &str = "history.options"; -/// The option keys, as in `prefs.get historyOptions` and the command's params. -pub const OPTIONS: [&str; 2] = ["allowNonLinearHistory", "makeLayerVisibilityChangesUndoable"]; +/// The option keys, as in `prefs.get historyOptions` and the command's params, in the order of +/// Photoshop's dialog. +pub const OPTIONS: [&str; 5] = [ + "automaticallyCreateFirstSnapshot", + "automaticallyCreateNewSnapshotWhenSaving", + "allowNonLinearHistory", + "showNewSnapshotDialogByDefault", + "makeLayerVisibilityChangesUndoable", +]; + +/// The option named `key` (one of [`OPTIONS`]). +fn option_mut<'a>(o: &'a mut HistoryOptions, key: &str) -> Option<&'a mut bool> { + Some(match key { + "automaticallyCreateFirstSnapshot" => &mut o.automatically_create_first_snapshot, + "automaticallyCreateNewSnapshotWhenSaving" => &mut o.automatically_create_new_snapshot_when_saving, + "allowNonLinearHistory" => &mut o.allow_non_linear_history, + "showNewSnapshotDialogByDefault" => &mut o.show_new_snapshot_dialog_by_default, + "makeLayerVisibilityChangesUndoable" => &mut o.make_layer_visibility_changes_undoable, + _ => return None, + }) +} fn bad(msg: impl Into) -> EngineError { EngineError::BadParams { cmd: CMD.into(), msg: msg.into() } } -/// The current History Options as `{allowNonLinearHistory, makeLayerVisibilityChangesUndoable}`. +/// The current History Options, keyed by [`OPTIONS`]. pub fn current(s: &Session) -> Value { let o = &s.prefs().history_options; serde_json::json!({ + "automaticallyCreateFirstSnapshot": o.automatically_create_first_snapshot, + "automaticallyCreateNewSnapshotWhenSaving": o.automatically_create_new_snapshot_when_saving, "allowNonLinearHistory": o.allow_non_linear_history, + "showNewSnapshotDialogByDefault": o.show_new_snapshot_dialog_by_default, "makeLayerVisibilityChangesUndoable": o.make_layer_visibility_changes_undoable, }) } +/// History Options › Show New Snapshot Dialog by Default: whether a plain click on the History +/// panel's camera button opens New Snapshot. +pub fn show_new_snapshot_dialog(s: &Session) -> bool { + s.prefs().history_options.show_new_snapshot_dialog_by_default +} + +/// History Options › Automatically Create New Snapshot When Saving: after the active document +/// was saved to its own file (not a copy or an export), add a snapshot of it named with the local +/// time of the save, as Photoshop does. Not a history state. Returns the new snapshot's id, or +/// `None` when the option is off or no document is active. Shells call it where they record a +/// document save. +pub fn snapshot_on_save(s: &mut Session) -> Option { + if !s.prefs().history_options.automatically_create_new_snapshot_when_saving { + return None; + } + let st = s.active_mut()?; + let name = save_snapshot_name().unwrap_or_else(|| crate::history_cmds::next_snapshot_name(st)); + let id = st.next_snapshot; + st.next_snapshot = id.saturating_add(1); + let (doc, layers) = (st.doc.clone(), st.layer_target()); + // Like the camera button: the document and its saved state are unchanged. + st.snapshots.push(Snapshot { id, name, doc, layers }); + Some(id) +} + +/// The local time as `HH:MM:SS`, the name of a snapshot made on save; `None` without a clock +/// (the web build), where the snapshot gets the camera button's "Snapshot N" instead. +fn save_snapshot_name() -> Option { + #[cfg(not(target_arch = "wasm32"))] + { + Some(chrono::Local::now().format("%H:%M:%S").to_string()) + } + #[cfg(target_arch = "wasm32")] + { + None + } +} + fn options(s: &mut Session, p: &Value) -> Result { let given: Map = match p { Value::Null => Map::new(), @@ -39,7 +100,7 @@ fn options(s: &mut Session, p: &Value) -> Result { // Validate everything before changing anything. let mut set = Vec::new(); for (k, v) in &given { - if !OPTIONS.contains(&k.as_str()) { + if option_mut(&mut HistoryOptions::default(), k).is_none() { return Err(bad(format!("unknown option `{k}` (expected {})", OPTIONS.join(", ")))); } let b = v.as_bool().ok_or_else(|| bad(format!("`{k}` must be true or false")))?; @@ -48,9 +109,8 @@ fn options(s: &mut Session, p: &Value) -> Result { if !set.is_empty() { s.edit_prefs(|prefs| { for (k, b) in &set { - match k.as_str() { - "allowNonLinearHistory" => prefs.history_options.allow_non_linear_history = *b, - _ => prefs.history_options.make_layer_visibility_changes_undoable = *b, + if let Some(o) = option_mut(&mut prefs.history_options, k) { + *o = *b; } } }); @@ -103,7 +163,7 @@ pub fn specs() -> Vec { label: "History Options…", menu: &[], shortcut: None, - params: r##"{"allowNonLinearHistory":bool?,"makeLayerVisibilityChangesUndoable":bool?} → both values (no params: report them). Allow Non-Linear History: an edit after stepping back keeps the later states and is appended at the end; deleting a state deletes only it (default off). Make Layer Visibility Changes Undoable: showing or hiding a layer is a history state (default on). Also `prefs.set historyOptions.*`"##, + params: r##"{"automaticallyCreateFirstSnapshot":bool?,"automaticallyCreateNewSnapshotWhenSaving":bool?,"allowNonLinearHistory":bool?,"showNewSnapshotDialogByDefault":bool?,"makeLayerVisibilityChangesUndoable":bool?} → all five values (no params: report them). Automatically Create First Snapshot: a new or opened document starts with a snapshot of itself, named after it (default on). Automatically Create New Snapshot When Saving: each save of the document (not a copy) adds a snapshot named with the time of the save (default off). Allow Non-Linear History: an edit after stepping back keeps the later states and is appended at the end; deleting a state deletes only it (default off). Show New Snapshot Dialog by Default: a click on the History panel's camera button opens New Snapshot, not only ⌥-click (default off). Make Layer Visibility Changes Undoable: showing or hiding a layer is a history state (default on). Also `prefs.set historyOptions.*`"##, enabled: always, run: options, journal: false, @@ -131,10 +191,21 @@ mod tests { #[test] fn defaults_match_photoshop_and_round_trip_through_prefs() { let mut s = Session::new(); - assert_eq!(s.execute(CMD, json!({})).unwrap(), json!({"allowNonLinearHistory": false, "makeLayerVisibilityChangesUndoable": true})); + let defaults = json!({ + "automaticallyCreateFirstSnapshot": true, + "automaticallyCreateNewSnapshotWhenSaving": false, + "allowNonLinearHistory": false, + "showNewSnapshotDialogByDefault": false, + "makeLayerVisibilityChangesUndoable": true, + }); + assert_eq!(s.execute(CMD, json!({})).unwrap(), defaults); assert_eq!(s.execute("prefs.get", json!({"path": "historyOptions"})).unwrap(), current(&s)); - let r = s.execute(CMD, json!({"allowNonLinearHistory": true, "makeLayerVisibilityChangesUndoable": false})).unwrap(); - assert_eq!(r, json!({"allowNonLinearHistory": true, "makeLayerVisibilityChangesUndoable": false})); + let flipped: Map = defaults.as_object().unwrap().iter().map(|(k, v)| (k.clone(), json!(!v.as_bool().unwrap()))).collect(); + let r = s.execute(CMD, Value::Object(flipped.clone())).unwrap(); + assert_eq!(r, Value::Object(flipped)); + for key in OPTIONS { + assert_eq!(s.execute("prefs.get", json!({"path": format!("historyOptions.{key}")})).unwrap(), r[key], "{key}"); + } assert_eq!(s.execute("prefs.get", json!({"path": "historyOptions.allowNonLinearHistory"})).unwrap(), json!(true)); // Saved and restored with the other preferences. let saved = s.prefs_to_json(); @@ -160,6 +231,11 @@ mod tests { json!({"allowNonLinearHistory": 1}), json!({"makeLayerVisibilityChangesUndoable": null}), json!({"allowNonLinearHistory": true, "snapshots": true}), + json!({"automaticallyCreateFirstSnapshot": "true"}), + json!({"automaticallyCreateNewSnapshotWhenSaving": 0}), + json!({"showNewSnapshotDialogByDefault": [true]}), + json!({"showNewSnapshotDialogByDefault": true, "showNewSnapshotDialog": true}), + json!({"AutomaticallyCreateFirstSnapshot": false}), json!([true]), json!("x"), json!(3), @@ -168,6 +244,8 @@ mod tests { assert_eq!(current(&s), before, "{p} changed nothing"); } assert!(s.execute("prefs.set", json!({"path": "historyOptions.allowNonLinearHistory", "value": "on"})).is_err()); + assert!(s.execute("prefs.set", json!({"path": "historyOptions.automaticallyCreateFirstSnapshot", "value": 1})).is_err()); + assert!(s.execute("prefs.set", json!({"path": "historyOptions.showNewSnapshotDialogByDefault", "value": null})).is_err()); assert_eq!(current(&s), before); } @@ -248,4 +326,86 @@ mod tests { s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); assert!(s.active().unwrap().history.non_linear); } + + fn snapshot_names(s: &Session) -> Vec { + s.active().unwrap().snapshots.iter().map(|snap| snap.name.clone()).collect() + } + + /// PNG bytes of a small image, to open. + fn png() -> Vec { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 8, "height": 6})).unwrap(); + crate::file_cmds::encode(&s.active().unwrap().doc, "a.png", None::).unwrap().0 + } + + /// Automatically Create First Snapshot (checked against Photoshop): on (the default), a new or + /// opened document starts with a snapshot named after it; off, it starts with none and the + /// camera's first snapshot is still "Snapshot 1". + #[test] + fn first_snapshot_follows_the_option_on_new_and_open() { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); + let name = s.active().unwrap().doc.name.clone(); + assert_eq!(snapshot_names(&s), [name]); + crate::file_cmds::open_bytes_as(&mut s, "photo.png", &png(), None, None).unwrap(); + assert_eq!(snapshot_names(&s), ["photo.png"], "named after the file, as Photoshop does"); + + s.execute(CMD, json!({"automaticallyCreateFirstSnapshot": false})).unwrap(); + s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); + assert!(snapshot_names(&s).is_empty()); + assert_eq!(entries(&s).len(), 1, "the opening state is still there"); + crate::file_cmds::open_bytes_as(&mut s, "photo.png", &png(), None, None).unwrap(); + assert!(snapshot_names(&s).is_empty()); + assert_eq!(s.execute("history.newSnapshot", json!({})).unwrap(), json!({"snapshot": 1, "name": "Snapshot 1"})); + assert_eq!(crate::inspect::document(s.active().unwrap())["snapshots"], json!([{"id": 1, "name": "Snapshot 1"}])); + // Documents opened earlier keep theirs: the option applies when a document opens. + s.set_active(0); + assert_eq!(snapshot_names(&s).len(), 1); + } + + /// Automatically Create New Snapshot When Saving: off (the default), a save adds nothing; on, + /// each save adds a snapshot of the document as saved, named with the time, and not a + /// history state. + #[test] + fn a_save_adds_a_snapshot_only_with_the_option() { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); + assert_eq!(snapshot_on_save(&mut s), None); + assert_eq!(snapshot_names(&s).len(), 1, "only the first snapshot"); + + s.execute(CMD, json!({"automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + s.execute("edit.fill", json!({"color": "#ff0000"})).unwrap(); + s.active_mut().unwrap().saved_to("saved.psd".into()); + let states = entries(&s); + let id = snapshot_on_save(&mut s).unwrap(); + let st = s.active().unwrap(); + let snap = st.snapshots.last().unwrap(); + assert_eq!(snap.id, id); + assert!(std::sync::Arc::ptr_eq(&snap.doc, &st.doc), "the document as saved"); + // HH:MM:SS, the local time of the save. + let parts: Vec<&str> = snap.name.split(':').collect(); + assert!(parts.len() == 3 && parts.iter().all(|p| p.len() == 2 && p.bytes().all(|b| b.is_ascii_digit())), "{}", snap.name); + assert_eq!(entries(&s), states, "not a history state"); + assert!(!s.active().unwrap().is_dirty(), "the saved document stays clean"); + // Each save adds one; selecting it brings that save back. + s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap(); + let second = snapshot_on_save(&mut s).unwrap(); + assert_eq!(snapshot_names(&s).len(), 3); + s.execute("history.selectSnapshot", json!({"snapshot": id})).unwrap(); + assert_eq!(s.active().unwrap().doc.layers[0].surface().unwrap().rgba(1, 1), [1.0, 0.0, 0.0, 1.0]); + assert!(second > id); + // No document: nothing to do, no panic. + let mut empty = Session::new(); + empty.execute(CMD, json!({"automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + assert_eq!(snapshot_on_save(&mut empty), None); + } + + #[test] + fn show_new_snapshot_dialog_reads_the_option() { + let mut s = Session::new(); + assert!(!show_new_snapshot_dialog(&s)); + s.execute("prefs.set", json!({"path": "historyOptions.showNewSnapshotDialogByDefault", "value": true})).unwrap(); + assert!(show_new_snapshot_dialog(&s)); + assert_eq!(crate::inspect::session(&s)["historyOptions"]["showNewSnapshotDialogByDefault"], json!(true)); + } } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 626c80f76c..9b5dc9b3e3 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -219,7 +219,8 @@ pub struct DocState { /// to `.pcraft` or PSD, and not a history step. pub color_samplers: Vec<[f64; 2]>, /// History panel snapshots, oldest first (`history.newSnapshot`, #2966): the first (id 0) is - /// the document as opened. Kept for the session only, as in Photoshop: not history states, + /// the document as opened (unless History Options › Automatically Create First Snapshot is + /// off). Kept for the session only, as in Photoshop: not history states, /// and not saved with the document. pub snapshots: Vec, /// The id the next snapshot gets; ids are never reused, so deleting one keeps the others. @@ -497,6 +498,11 @@ impl Session { st.history.max_states = self.prefs.get().performance.history_states.max(1) as usize; st.history.max_bytes = self.prefs.get().performance.history_budget_bytes(); st.history.non_linear = self.prefs.get().history_options.allow_non_linear_history; + // History Options › Automatically Create First Snapshot off: no snapshot of the document + // as opened, so the History panel starts at the opening state (#2966). + if !self.prefs.get().history_options.automatically_create_first_snapshot { + st.snapshots.clear(); + } self.docs.push(st); let i = self.docs.len() - 1; self.active = Some(i); diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 365b57fa6b..9540e21268 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -946,21 +946,36 @@ impl Default for Integrations { } } -/// The History panel's History Options… (not part of Edit › Preferences in Photoshop either). -/// Photoshop's snapshot options are not here yet: snapshots are not implemented. +/// The History panel's History Options… (not part of Edit › Preferences in Photoshop either), +/// in the dialog's order. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct HistoryOptions { + /// Automatically Create First Snapshot: a new or opened document starts with a snapshot of + /// itself, named after it (the History panel's top row). + pub automatically_create_first_snapshot: bool, + /// Automatically Create New Snapshot When Saving: every save of the document (not a copy) + /// adds a snapshot named with the time of the save. + pub automatically_create_new_snapshot_when_saving: bool, /// Allow Non-Linear History: editing after selecting an earlier state keeps the later /// states (the new step is appended at the end), and deleting a state deletes only it. pub allow_non_linear_history: bool, + /// Show New Snapshot Dialog by Default: a plain click on the History panel's camera button + /// opens New Snapshot (otherwise only ⌥-click does). + pub show_new_snapshot_dialog_by_default: bool, /// Make Layer Visibility Changes Undoable: showing or hiding a layer is a history state. pub make_layer_visibility_changes_undoable: bool, } impl Default for HistoryOptions { fn default() -> Self { - Self { allow_non_linear_history: false, make_layer_visibility_changes_undoable: true } + Self { + automatically_create_first_snapshot: true, + automatically_create_new_snapshot_when_saving: false, + allow_non_linear_history: false, + show_new_snapshot_dialog_by_default: false, + make_layer_visibility_changes_undoable: true, + } } } diff --git a/crates/ui-egui/src/history_options_ui.rs b/crates/ui-egui/src/history_options_ui.rs index 2d4756543b..0ff35dbc0e 100644 --- a/crates/ui-egui/src/history_options_ui.rs +++ b/crates/ui-egui/src/history_options_ui.rs @@ -1,8 +1,8 @@ //! The History Options dialog (History panel menu › History Options…, #2966): a form over the -//! engine's `history.options` with its two checkboxes, filled with the current values. OK runs -//! the command with the dialog's values (the generic command-dialog confirm), Cancel changes -//! nothing. Agents can also run `history.options` with params directly, or `prefs.set -//! historyOptions.*`; a call with params skips the dialog. +//! engine's `history.options` with Photoshop's five checkboxes in its order, filled with the +//! current values. OK runs the command with the dialog's values (the generic command-dialog +//! confirm), Cancel changes nothing. Agents can also run `history.options` with params directly, +//! or `prefs.set historyOptions.*`; a call with params skips the dialog. use serde_json::{Map, Value, json}; @@ -27,11 +27,16 @@ pub fn open(app: &mut PhotocraftApp) -> u64 { f.insert("__label".into(), json!("History Options…")); f.insert("__form".into(), json!(true)); f.insert("__choices".into(), json!({})); - // Photoshop's capitalised labels, in the UI language (the form would sentence-case the keys). + // Photoshop's order and capitalised labels, in the UI language (the form would sort the keys + // and sentence-case them). + f.insert("__order".into(), json!(photocraft_engine::history_options_cmds::OPTIONS)); f.insert( "__labels".into(), json!({ + "automaticallyCreateFirstSnapshot": tl!("Automatically Create First Snapshot"), + "automaticallyCreateNewSnapshotWhenSaving": tl!("Automatically Create New Snapshot When Saving"), "allowNonLinearHistory": tl!("Allow Non-Linear History"), + "showNewSnapshotDialogByDefault": tl!("Show New Snapshot Dialog by Default"), "makeLayerVisibilityChangesUndoable": tl!("Make Layer Visibility Changes Undoable"), }), ); @@ -58,19 +63,25 @@ mod tests { let d = app.ui.dialogs.iter().find(|d| d.id == id).unwrap(); assert_eq!(d.fields["allowNonLinearHistory"], json!(false)); assert_eq!(d.fields["makeLayerVisibilityChangesUndoable"], json!(true)); + assert_eq!(d.fields["automaticallyCreateFirstSnapshot"], json!(true)); + assert_eq!(d.fields["automaticallyCreateNewSnapshotWhenSaving"], json!(false)); + assert_eq!(d.fields["showNewSnapshotDialogByDefault"], json!(false)); assert_eq!(crate::dialogs::title(d), "History Options"); // Cancel changes nothing. app.ui.dialog_mut(id).unwrap().fields.insert("allowNonLinearHistory".into(), json!(true)); crate::dialogs::cancel(&mut app, id).unwrap(); assert!(!app.session.prefs().history_options.allow_non_linear_history); - // OK applies both checkboxes. + // OK applies every checkbox. let id = open(&mut app); let fields = &mut app.ui.dialog_mut(id).unwrap().fields; - fields.insert("allowNonLinearHistory".into(), json!(true)); - fields.insert("makeLayerVisibilityChangesUndoable".into(), json!(false)); + for key in photocraft_engine::history_options_cmds::OPTIONS { + let on = fields[key].as_bool().unwrap(); + fields.insert(key.into(), json!(!on)); + } crate::dialogs::confirm(&mut app, id).unwrap(); let o = &app.session.prefs().history_options; assert!(o.allow_non_linear_history && !o.make_layer_visibility_changes_undoable); + assert!(!o.automatically_create_first_snapshot && o.automatically_create_new_snapshot_when_saving && o.show_new_snapshot_dialog_by_default); assert!(app.ui.dialogs.is_empty()); // Reopened, it shows what was chosen; with params the command runs without a dialog. let id = open(&mut app); @@ -82,16 +93,24 @@ mod tests { assert!(crate::menus::invoke(&mut app, &ctx, COMMAND, json!({"allowNonLinearHistory": "no"})).is_err()); } + /// The five checkboxes with Photoshop's labels, top to bottom in its dialog's order. #[test] - fn the_dialog_draws_both_checkboxes_with_photoshops_labels() { + fn the_dialog_draws_the_checkboxes_in_photoshops_order() { use egui_kittest::{Harness, kittest::Queryable}; let mut h = Harness::builder().with_size(egui::vec2(700.0, 400.0)).build_ui_state(|ui, app| crate::dialogs::show(app, ui.ctx()), app()); PhotocraftApp::setup_context(&h.ctx, crate::theme::ThemeKind::ALL[0]); open(h.state_mut()); h.run_steps(3); h.get_by_label("History Options"); - h.get_by_label("Allow Non-Linear History"); - h.get_by_label("Make Layer Visibility Changes Undoable"); + let labels = [ + "Automatically Create First Snapshot", + "Automatically Create New Snapshot When Saving", + "Allow Non-Linear History", + "Show New Snapshot Dialog by Default", + "Make Layer Visibility Changes Undoable", + ]; + let tops: Vec = labels.iter().map(|l| h.get_by_label(l).rect().min.y).collect(); + assert!(tops.windows(2).all(|w| w[0] < w[1]), "top to bottom: {tops:?}"); h.get_by_label("OK"); h.get_by_label("Cancel"); } diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 8c482c864d..c963b60982 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3673,3 +3673,6 @@ navigator Zoom Zvětšení Remove after each stroke Odstranit po každém tahu Apply the removal ({key}) Použít odstranění ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) Tahy k odstranění: {n} (Enter použije, Esc zruší) + Automatically Create First Snapshot Automaticky vytvořit první snímek + Automatically Create New Snapshot When Saving Automaticky vytvořit nový snímek při ukládání + Show New Snapshot Dialog by Default Ve výchozím nastavení zobrazit dialog Nový snímek diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 211262dbf2..1199c83d59 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2699,3 +2699,6 @@ curves Smooth Glätten Remove after each stroke Nach jedem Strich entfernen Apply the removal ({key}) Entfernen anwenden ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) Striche zum Entfernen: {n} (Eingabe wendet an, Esc bricht ab) + Automatically Create First Snapshot Ersten Snapshot automatisch erstellen + Automatically Create New Snapshot When Saving Beim Speichern automatisch neuen Snapshot erstellen + Show New Snapshot Dialog by Default Dialogfeld „Neuer Snapshot“ standardmäßig anzeigen diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index e4a1cdb050..2d8e929569 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2740,3 +2740,6 @@ curves Smooth Suavizar Remove after each stroke Eliminar después de cada trazo Apply the removal ({key}) Aplicar la eliminación ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) Trazos por eliminar: {n} (Intro aplica, Esc cancela) + Automatically Create First Snapshot Crear automáticamente la primera instantánea + Automatically Create New Snapshot When Saving Crear automáticamente una instantánea nueva al guardar + Show New Snapshot Dialog by Default Mostrar el cuadro de diálogo Instantánea nueva de forma predeterminada diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 256a21ab63..c91d161bd6 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3229,3 +3229,6 @@ curves Smooth 매끄럽게 Remove after each stroke 획마다 제거 Apply the removal ({key}) 제거 적용 ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) 제거할 획: {n} (Enter 적용, Esc 취소) + Automatically Create First Snapshot 첫 번째 스냅샷 자동 만들기 + Automatically Create New Snapshot When Saving 저장할 때 새 스냅샷 자동 만들기 + Show New Snapshot Dialog by Default 기본적으로 새 스냅샷 대화 상자 표시 diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 710709a82e..f28a31bc6b 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3543,3 +3543,6 @@ curves Smooth Làm mượt History Options… Tùy chọn lịch sử… Allow Non-Linear History Cho phép lịch sử không tuyến tính Make Layer Visibility Changes Undoable Cho phép hoàn tác thay đổi hiển thị lớp + Automatically Create First Snapshot Tự động tạo ảnh chụp trạng thái đầu tiên + Automatically Create New Snapshot When Saving Tự động tạo ảnh chụp trạng thái mới khi lưu + Show New Snapshot Dialog by Default Mặc định hiện hộp thoại Ảnh chụp trạng thái mới diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 4294d08cdd..f09fb57d33 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2664,3 +2664,6 @@ curves Smooth 平滑 Remove after each stroke 每次描边后移除 Apply the removal ({key}) 应用移除 ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) 待移除的描边:{n}(Enter 应用,Esc 取消) + Automatically Create First Snapshot 自动创建第一幅快照 + Automatically Create New Snapshot When Saving 存储时自动创建新快照 + Show New Snapshot Dialog by Default 默认显示新建快照对话框 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 42bd150bca..aeecf651ce 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2649,3 +2649,6 @@ curves Smooth 平滑 Remove after each stroke 每次描邊後移除 Apply the removal ({key}) 套用移除 ({key}) Strokes to remove: {n} (Enter applies, Esc cancels) 待移除的描邊:{n}(Enter 套用,Esc 取消) + Automatically Create First Snapshot 自動建立第一個快照 + Automatically Create New Snapshot When Saving 儲存時自動建立新快照 + Show New Snapshot Dialog by Default 預設顯示新增快照對話框 diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 73c02ac426..1e3f1ec157 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1395,6 +1395,8 @@ impl PhotocraftApp { st.saved_to(path.to_string()); // The job locked the document, but record the revision that was written. st.saved_revision = revision; + // History Options › Automatically Create New Snapshot When Saving (#2966). + photocraft_engine::history_options_cmds::snapshot_on_save(&mut app.session); } // "Save Document" script events and File › Generate › Image Assets. if hooks diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 7380d10cef..0c3e7724d8 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -2956,9 +2956,11 @@ fn history(app: &mut PhotocraftApp, ui: &mut egui::Ui) { footer_cmd = Some("history.deleteState"); } let can_snap = app.session.is_enabled("history.newSnapshot"); - // ⌥-click opens New Snapshot (name, From) instead, as in Photoshop. + // ⌥-click opens New Snapshot (name, From) instead, as in Photoshop; with History + // Options › Show New Snapshot Dialog by Default a plain click does too. + let dialog_by_default = photocraft_engine::history_options_cmds::show_new_snapshot_dialog(&app.session); if ui.add_enabled_ui(can_snap, |ui| icons::button(ui, "scan", 26.0, false, tl!("Create new snapshot"))).inner.clicked() { - if ui.input(|i| i.modifiers.alt) { + if dialog_by_default || ui.input(|i| i.modifiers.alt) { snapshot_dialog = true; } else { footer_cmd = Some("history.newSnapshot"); @@ -4607,6 +4609,73 @@ mod snapshot_row_tests { assert!(h.state().ui.dialogs.is_empty()); } + /// History Options › Show New Snapshot Dialog by Default (#2966): a plain click on the camera + /// opens New Snapshot as ⌥-click does, and ⌥-click still opens it (Photoshop's button always + /// prompts with the option on). Off, a plain click takes the snapshot at once. + #[test] + fn show_new_snapshot_dialog_by_default_makes_a_click_open_the_dialog() { + for (dialog_by_default, modifiers) in [(true, egui::Modifiers::NONE), (true, egui::Modifiers::ALT), (false, egui::Modifiers::NONE)] { + let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); + app.run("file.new", json!({"width": 200, "height": 150})).unwrap(); + app.run("history.options", json!({"showNewSnapshotDialogByDefault": dialog_by_default})).unwrap(); + let mut h = Harness::builder().with_size(vec2(900.0, 700.0)).build_ui_state( + |ui, app: &mut PhotocraftApp| { + let ctx = ui.ctx().clone(); + if !ctx.fonts(|f| f.families().contains(&egui::FontFamily::Name("medium".into()))) { + return; + } + history(app, ui); + crate::dialogs::show(app, &ctx); + }, + app, + ); + PhotocraftApp::setup_context(&h.ctx, crate::theme::ThemeKind::ProMedium); + h.state_mut().ui.theme = crate::theme::ThemeKind::ProMedium; + h.run_steps(4); + let mut buttons: Vec = h + .ctx + .viewport(|v| v.prev_pass.widgets.layers().flat_map(|(_, w)| w.iter()).filter(|w| w.rect.size() == vec2(26.0, 26.0)).map(|w| w.rect).collect()); + buttons.sort_by(|a, b| b.center().x.total_cmp(&a.center().x)); + let camera = buttons[1].center(); + h.event(egui::Event::ModifiersChanged(modifiers)); + h.event(egui::Event::PointerMoved(camera)); + h.run_steps(1); + for pressed in [true, false] { + h.event(egui::Event::PointerButton { pos: camera, button: egui::PointerButton::Primary, pressed, modifiers }); + h.run_steps(1); + } + h.event(egui::Event::ModifiersChanged(egui::Modifiers::NONE)); + h.run_steps(3); + let snaps = h.state().session.active().unwrap().snapshots.len(); + let dialog = h.state().ui.dialogs.last().is_some_and(|d| crate::snapshot_dialog::owns(&d.fields)); + if dialog_by_default { + assert!(dialog, "{modifiers:?}: the dialog opens"); + assert_eq!(snaps, 1, "{modifiers:?}: no snapshot until OK"); + h.get_by_label("OK").click(); + h.run_steps(3); + assert_eq!(h.state().session.active().unwrap().snapshots.last().unwrap().name, "Snapshot 1"); + } else { + assert!(!dialog, "off: no dialog"); + assert_eq!(snaps, 2, "off: the click takes the snapshot"); + } + } + } + + /// History Options › Automatically Create First Snapshot: on, the panel's top row is a + /// snapshot named after the document; off, there is none above the opening state. + #[test] + fn the_first_snapshot_row_follows_the_option() { + for first in [true, false] { + let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); + app.run("history.options", json!({"automaticallyCreateFirstSnapshot": first})).unwrap(); + app.run("file.new", json!({"width": 200, "height": 150})).unwrap(); + let name = app.session.active().unwrap().doc.name.clone(); + let mut h = Harness::builder().with_size(vec2(300.0, 400.0)).build_ui_state(|ui, app: &mut PhotocraftApp| history(app, ui), app); + h.run_steps(3); + assert_eq!(h.query_by_label(&name).is_some(), first, "a snapshot row named after the document: {first}"); + } + } + /// Renaming belongs to one document: snapshot ids restart in each, so switching tabs must not /// carry the edit over to the other document's snapshot with the same id. #[test] diff --git a/crates/ui-egui/src/view_cmds.rs b/crates/ui-egui/src/view_cmds.rs index cb75e28032..3f3b33cf16 100644 --- a/crates/ui-egui/src/view_cmds.rs +++ b/crates/ui-egui/src/view_cmds.rs @@ -978,7 +978,12 @@ pub fn form_body(ui: &mut egui::Ui, f: &mut Map) { // come from `__labels` verbatim; everything else goes through the catalogue. let labels = f.get("__labels").cloned().unwrap_or(Value::Null); let label = |k: &str| labels.get(k).and_then(Value::as_str).map_or_else(|| label_of(k), str::to_string); - let keys: Vec = f.keys().filter(|k| !k.starts_with("__")).cloned().collect(); + // `__order` lists the fields in the dialog's order (the map itself is sorted by key); fields + // it leaves out follow in key order. + let order: Vec = + f.get("__order").and_then(Value::as_array).map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect()).unwrap_or_default(); + let mut keys: Vec = order.iter().filter(|k| !k.starts_with("__") && f.contains_key(k.as_str())).cloned().collect(); + keys.extend(f.keys().filter(|k| !k.starts_with("__") && !order.contains(k)).cloned()); egui::Grid::new("form-dialog").num_columns(2).spacing([12.0, 6.0]).show(ui, |ui| { for k in keys { let v = f.get(&k).cloned().unwrap_or(Value::Null); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3a8ddb38a8..4c913280a1 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -106,7 +106,7 @@ store expose and persist the same setting; scripts keep using canonical command | `layer.newAdjustmentLayer.hueSaturation` | `{"hue":30,"saturation":10}` | | `paint.stroke` | `{"points":[[x,y,pressure],…],"size":20,"color":"#ff0000"}` | | `select.rect` | `{"x":0,"y":0,"width":100,"height":50,"mode":"add","ellipse":false}` | -| `document.inspect` | `{}`: layer tree, history, snapshots (`[{id, name}]`, for `history.selectSnapshot`; id 0 is the document as opened), selection bounds | +| `document.inspect` | `{}`: layer tree, history, snapshots (`[{id, name}]`, for `history.selectSnapshot`; id 0 is the document as opened, unless `history.options` `automaticallyCreateFirstSnapshot` is off), selection bounds | | `document.pixel` | `{"x":10,"y":10}`: composite RGBA | | `document.presets.list` | `{}` → `{presets:[{name,settings}]}`: saved New Document configurations | | `document.presets.save` | `{"name":"Product square","settings":{"width":1600,"height":1600,"background":"transparent"}}`: save a snapshot; names are trimmed, 1–255 characters, and ASCII case-insensitive duplicates are rejected | diff --git a/docs/scorecard.md b/docs/scorecard.md index ff0188d419..a7d0390de1 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 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 6 | 13 | 8 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 133/256, round trip ≥ 258/256 | | [Tools](#tools) | 28 | 14 | 1 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 5 | 5 | settings that do nothing: 27 of 158 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 5 | 5 | settings that do nothing: 27 of 161 (target 0) | | [Type](#type) | 4 | 2 | 3 | | | [Automation](#automation) | 4 | 2 | 5 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present | @@ -176,7 +176,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 27 of 158** (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: 27 of 161** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `file_handling.maximize_psd_compatibility`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `enhanced_controls.touch_gestures`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index c798387e26..fd0a4b8087 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity: tools, handles, modifiers and feel -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (History snapshots) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (History snapshots; History Options snapshot options) · **Target:** Adobe Photoshop 2026 How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation, @@ -202,7 +202,7 @@ Paragraph; the rest open as in-app floating windows. | Command palette with recents | done | UI-217-7 | | Every preference takes effect | partial | 46 of 149 do nothing (scorecard) | | UI scale presets | missing | UI-217-9, #2492 | -| History snapshots: camera button, New Snapshot dialog (⌥-click: Name, From), the first snapshot (the document as opened), snapshot rows (click returns, rename, delete), `history.*Snapshot` commands | partial | `history_cmds.rs`, `snapshot_rows` in `panels.rs`, `snapshot_dialog.rs`; the snapshot History Options and History Brush sources to come (#2966) | +| History snapshots: camera button, New Snapshot dialog (⌥-click: Name, From), the first snapshot (the document as opened), snapshot rows (click returns, rename, delete), `history.*Snapshot` commands; History Options' snapshot options (Automatically Create First Snapshot, New Snapshot When Saving, Show New Snapshot Dialog by Default) | partial | `history_cmds.rs`, `history_options_cmds.rs`, `snapshot_rows` in `panels.rs`, `snapshot_dialog.rs`; History Brush sources to come (#2966) | | Themes: Photoshop's four greys | partial | five themes; #2661 | | Document tabs: overflow, context menu, reorder | done | UI-217-6; middle-click close #2570 | | Layers panel: wheel steps blend modes, drop on New/Trash | partial | UI-217-14 | @@ -218,3 +218,4 @@ Paragraph; the rest open as in-app floating windows. | 2026-10-11 | minor | ⇧-drag a guide out of a ruler lands on the nearest ruler tick (#3770) | | 2026-10-11 | minor | Layer and selection keys from Photoshop's shortcut set: ⌘, toggles, ⌘\, /, ⌘⌥2, ⌘⌥⌫, Tab rename-next, ⌥-click thumbnail to fit | | 2026-10-12 | minor | History snapshots: the New Snapshot dialog (⌥-click the camera), and the first snapshot of the document as opened as the panel's top row (#2966) | +| 2026-10-12 | minor | History Options: Automatically Create First Snapshot, Automatically Create New Snapshot When Saving, Show New Snapshot Dialog by Default (#2966) | From 9591d0446130e250c39b1aae15f41eaf30e04a7a Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 13 Oct 2026 00:43:44 +0200 Subject: [PATCH 02/10] Merge fixups: translate the History Options and New Snapshot strings into Hungarian and Turkish Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/i18n/hu.tsv | 6 ++++++ crates/ui-egui/src/i18n/tr.tsv | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index e0eff7b8a7..f77695d5f7 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3649,6 +3649,12 @@ cameraRaw Yellow Sárga Auto-leading % Automatikus sorköz % Automatically Create First Snapshot Első pillanatkép automatikus létrehozása Automatically Create New Snapshot When Saving Új pillanatkép automatikus létrehozása mentéskor + From: Forrás: + Full Document Teljes dokumentum + Merged Layers Egyesített rétegek + History Options… Előzménybeállítások… + Allow Non-Linear History Nemlineáris előzmények engedélyezése + Make Layer Visibility Changes Undoable A rétegláthatóság módosításai visszavonhatók legyenek Avoid Widows/Orphans Fattyúsorok elkerülése Blend RGB Colors Using Gamma 1.0 RGB-színek keverése 1,0 gammával Blending Mode Keverési mód diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 8401f8e5ac..1f735bea85 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2647,6 +2647,12 @@ cameraRaw Color Renk Set New Snapshot as Default Yeni Anlık Görüntüyü Varsayılan Olarak Ayarla Automatically Create First Snapshot İlk Anlık Görüntüyü Otomatik Olarak Oluştur Automatically Create New Snapshot When Saving Kaydederken Otomatik Olarak Yeni Anlık Görüntü Oluştur + From: Kaynak: + Full Document Tam Belge + Merged Layers Birleştirilmiş Katmanlar + History Options… Geçmiş Seçenekleri… + Allow Non-Linear History Doğrusal Olmayan Geçmişe İzin Ver + Make Layer Visibility Changes Undoable Katman Görünürlüğü Değişikliklerini Geri Alınabilir Yap Show New Snapshot Dialog by Default Yeni Anlık Görüntü İletişim Kutusunu Varsayılan Olarak Göster Clear History Geçmişi Temizle Panel Options… Panel Seçenekleri… From 5bdd9f773eadd8fd5eab9c178c01efe5c36762dc Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 13 Oct 2026 13:26:50 +0200 Subject: [PATCH 03/10] History snapshot options: Serbian labels Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/i18n/sr.tsv | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index 7a85f8d58f..7e79139a1a 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -2268,6 +2268,12 @@ Automatically Create New Snapshot When Saving Automatski napravi novi snimak stanja pri čuvanju Show New Snapshot Dialog by Default Podrazumevano prikaži dijalog za novi snimak stanja Clear History Obriši istoriju + History Options… Opcije istorije… + Allow Non-Linear History Dozvoli nelinearnu istoriju + Make Layer Visibility Changes Undoable Omogući opozivanje promena vidljivosti slojeva + From: Od: + Full Document Ceo dokument + Merged Layers Spojeni slojevi Panel Options… Opcije panela… View menu Meni prikaza Keep view in sync Drži prikaz usklađenim From 0c425166d626f6727281dfd3c9a9aba77d733137 Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 13 Oct 2026 19:32:21 +0200 Subject: [PATCH 04/10] docs: regenerate scorecard after merging main Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/scorecard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scorecard.md b/docs/scorecard.md index af13a3f265..5cff3b2f13 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 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 7 | 13 | 7 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 145/256, round trip ≥ 258/256 | | [Tools](#tools) | 28 | 14 | 1 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 156 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 161 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present | @@ -176,7 +176,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 26 of 156** (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: 26 of 161** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `enhanced_controls.touch_gestures`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. From 79b2bee666f5d9f56f57d232a8f4f214b140d5aa Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 13 Oct 2026 20:07:38 +0200 Subject: [PATCH 05/10] docs: regenerate scorecard after merging main Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/scorecard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scorecard.md b/docs/scorecard.md index 92f9315ebd..fc88746a66 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 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 7 | 13 | 7 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 145/256, round trip ≥ 258/256 | | [Tools](#tools) | 28 | 14 | 1 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 157 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 162 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present | @@ -176,7 +176,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 26 of 157** (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: 26 of 162** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `enhanced_controls.touch_gestures`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. From 42e831fa305003cb07b09d479c14b558e7e12d14 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 15 Oct 2026 14:00:07 +0200 Subject: [PATCH 06/10] History Options: no duplicate snapshot when saving an unchanged document (#2966) Automatically Create New Snapshot When Saving adds no row when the document is unchanged since the snapshot the previous save added (and that snapshot is still there), so Ctrl+S on a clean document doesn't stack duplicates. The new snapshot's tiles are trimmed against the history budget at once, and its memory cost is documented: snapshots count against History & Cache by dropping the oldest states, but are never dropped themselves. Tests: the engine dedupe, and the desktop save path (a save adds one, Save a Copy none, a background save finishing on another document snapshots the document it saved). The purge test from main deletes the first snapshot so it measures only the snapshot it takes. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/engine/src/history_cmds.rs | 3 ++ crates/engine/src/history_options_cmds.rs | 45 +++++++++++++++++++- crates/engine/src/lib.rs | 4 ++ crates/ui-egui/src/save_identity_tests.rs | 50 +++++++++++++++++++++++ docs/control-protocol.md | 2 +- docs/scorecard.md | 4 +- 6 files changed, 103 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/history_cmds.rs b/crates/engine/src/history_cmds.rs index d5736d1b1b..0a943f62fb 100644 --- a/crates/engine/src/history_cmds.rs +++ b/crates/engine/src/history_cmds.rs @@ -503,6 +503,9 @@ mod tests { #[test] fn purging_histories_frees_only_what_no_snapshot_keeps() { let mut s = session(); + // Only the snapshot taken here: the first snapshot (the document as opened) would keep + // tiles of the oldest states too. + s.execute("history.deleteSnapshot", json!({"snapshot": 0})).unwrap(); s.execute("history.newSnapshot", json!({})).unwrap(); s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap(); let st = s.active().unwrap(); diff --git a/crates/engine/src/history_options_cmds.rs b/crates/engine/src/history_options_cmds.rs index c812b0d6d0..5ea1d4bcaa 100644 --- a/crates/engine/src/history_options_cmds.rs +++ b/crates/engine/src/history_options_cmds.rs @@ -62,19 +62,36 @@ pub fn show_new_snapshot_dialog(s: &Session) -> bool { /// History Options › Automatically Create New Snapshot When Saving: after the active document /// was saved to its own file (not a copy or an export), add a snapshot of it named with the local /// time of the save, as Photoshop does. Not a history state. Returns the new snapshot's id, or -/// `None` when the option is off or no document is active. Shells call it where they record a -/// document save. +/// `None` when the option is off, no document is active, or the document is unchanged since the +/// snapshot the previous save added (and that snapshot is still there), so saving a clean +/// document again doesn't add a duplicate row. Shells call it where they record a document save. +/// +/// Memory: like every History panel snapshot, each one pins a copy of the document for the +/// session (only the tiles that differ from the document and the other snapshots cost memory). +/// [`crate::DocState::trim_history`] counts those tiles against the History & Cache budget by +/// dropping the oldest history states, but never drops a snapshot itself: many saves of a +/// changing document can hold more than the budget until snapshots are deleted or the document +/// is closed. pub fn snapshot_on_save(s: &mut Session) -> Option { if !s.prefs().history_options.automatically_create_new_snapshot_when_saving { return None; } let st = s.active_mut()?; + // Saved again without a change: the previous save's snapshot already shows this document. + if let Some(prev) = st.save_snapshot + && st.snapshots.iter().any(|snap| snap.id == prev && std::sync::Arc::ptr_eq(&snap.doc, &st.doc)) + { + return None; + } let name = save_snapshot_name().unwrap_or_else(|| crate::history_cmds::next_snapshot_name(st)); let id = st.next_snapshot; st.next_snapshot = id.saturating_add(1); let (doc, layers) = (st.doc.clone(), st.layer_target()); // Like the camera button: the document and its saved state are unchanged. st.snapshots.push(Snapshot { id, name, doc, layers }); + st.save_snapshot = Some(id); + // The snapshot's tiles count against the history budget. + st.trim_history(); Some(id) } @@ -400,6 +417,30 @@ mod tests { assert_eq!(snapshot_on_save(&mut empty), None); } + /// Saving an unchanged document again (⌘S on a clean document) adds no duplicate row; a + /// change, or deleting the previous save's snapshot, makes the next save add one again. + #[test] + fn saving_an_unchanged_document_adds_no_duplicate_snapshot() { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); + s.execute(CMD, json!({"automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + let first = snapshot_on_save(&mut s).unwrap(); + assert_eq!(snapshot_on_save(&mut s), None, "unchanged since the last save snapshot"); + assert_eq!(snapshot_names(&s).len(), 2, "the first snapshot and one save snapshot"); + // A view-only change (no document change) doesn't count either. + s.active_mut().unwrap().revision += 1; + assert_eq!(snapshot_on_save(&mut s), None); + // An edit does. + s.execute("edit.fill", json!({"color": "#ff0000"})).unwrap(); + let second = snapshot_on_save(&mut s).unwrap(); + assert!(second > first); + assert_eq!(snapshot_on_save(&mut s), None); + // The previous save's snapshot deleted: the next save shows the document again. + s.execute("history.deleteSnapshot", json!({"snapshot": second})).unwrap(); + assert!(snapshot_on_save(&mut s).is_some()); + assert_eq!(snapshot_names(&s).len(), 3); + } + #[test] fn show_new_snapshot_dialog_reads_the_option() { let mut s = Session::new(); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index a443454027..ca86984045 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -235,6 +235,9 @@ pub struct DocState { pub snapshots: Vec, /// The id the next snapshot gets; ids are never reused, so deleting one keeps the others. next_snapshot: u64, + /// The snapshot the latest save added (History Options › Automatically Create New Snapshot + /// When Saving), so saving an unchanged document again doesn't add a duplicate row. + save_snapshot: Option, } impl DocState { @@ -283,6 +286,7 @@ impl DocState { color_samplers: Vec::new(), snapshots: vec![first], next_snapshot: 1, + save_snapshot: None, } } /// The selected layers in bottom-to-top document order, always including the active layer. diff --git a/crates/ui-egui/src/save_identity_tests.rs b/crates/ui-egui/src/save_identity_tests.rs index c947afc9b6..aa535a9d46 100644 --- a/crates/ui-egui/src/save_identity_tests.rs +++ b/crates/ui-egui/src/save_identity_tests.rs @@ -254,3 +254,53 @@ fn save_settings_start_at_the_opened_files_encoding() { app.open_bytes("art.webp", &lossless).unwrap(); assert!(app.save_settings().webp_lossless); } + +/// The names of the active document's History panel snapshots. +fn snapshots(app: &PhotocraftApp) -> Vec { + app.session.active().unwrap().snapshots.iter().map(|s| s.name.clone()).collect() +} + +/// History Options › Automatically Create New Snapshot When Saving (#2966) through the desktop +/// save path: a save adds one snapshot, saving again unchanged adds none, Save a Copy adds none. +#[test] +fn a_save_adds_one_snapshot_and_a_copy_none() { + let mut app = app(); + app.run("history.options", json!({"automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + let before = snapshots(&app).len(); + app.save_as(Some("saved.psd".into())).unwrap(); + assert_eq!(snapshots(&app).len(), before + 1, "the save adds a snapshot"); + let st = app.session.active().unwrap(); + assert!(std::sync::Arc::ptr_eq(&st.snapshots.last().unwrap().doc, &st.doc), "of the document as saved"); + app.save_as(Some("saved.psd".into())).unwrap(); + assert_eq!(snapshots(&app).len(), before + 1, "saving an unchanged document adds no duplicate"); + + app.run("layer.new.layer", json!({})).unwrap(); + app.write_document("copy.psd".into(), &ExportSettings::default(), true).unwrap(); + assert_eq!(snapshots(&app).len(), before + 1, "Save a Copy adds none"); + app.save_as(Some("saved.psd".into())).unwrap(); + assert_eq!(snapshots(&app).len(), before + 2); +} + +/// A background save that finishes while another document is active snapshots the document it +/// saved, not the active one. +#[test] +fn a_background_save_snapshots_its_own_document() { + let mut app = app(); + app.run("history.options", json!({"automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + let (saved_doc, revision) = { + let st = app.session.active().unwrap(); + (st.doc.id, st.revision) + }; + let saved_snaps = snapshots(&app).len(); + app.run("file.new", json!({"width": 4, "height": 4, "name": "Untitled-2"})).unwrap(); + let active = app.active_doc_id().unwrap(); + assert_ne!(active, saved_doc); + let active_snaps = snapshots(&app).len(); + // What jobs_ui does when the save job of `saved_doc` ends. + app.saved(saved_doc, revision, "background.psd", &[], false); + assert_eq!(app.active_doc_id(), Ok(active), "the active document stays active"); + assert_eq!(snapshots(&app).len(), active_snaps, "the active document gets no snapshot"); + let st = app.session.documents().iter().find(|st| st.doc.id == saved_doc).unwrap(); + assert_eq!(st.snapshots.len(), saved_snaps + 1, "the saved document gets one"); + assert_eq!(st.path.as_deref(), Some("background.psd")); +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index fb6870b3a2..47a59fd04d 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -112,7 +112,7 @@ store expose and persist the same setting; scripts keep using canonical command | `layer.newAdjustmentLayer.hueSaturation` | `{"hue":30,"saturation":10}` | | `paint.stroke` | `{"points":[[x,y,pressure],…],"size":20,"color":"#ff0000"}` | | `select.rect` | `{"x":0,"y":0,"width":100,"height":50,"mode":"add","ellipse":false}` | -| `document.inspect` | `{}`: layer tree, history, snapshots (`[{id, name}]`, for `history.selectSnapshot`; id 0 is the document as opened, unless `history.options` `automaticallyCreateFirstSnapshot` is off), selection bounds | +| `document.inspect` | `{}`: layer tree, history, snapshots (`[{id, name}]`, for `history.selectSnapshot`; id 0 is the document as opened, unless `history.options` `automaticallyCreateFirstSnapshot` is off; with `automaticallyCreateNewSnapshotWhenSaving` on, each save of a changed document adds one named `HH:MM:SS`, or `Snapshot N` in the browser; every snapshot keeps its copy of the document for the session: its tiles count against the History & Cache budget by dropping the oldest history states, but snapshots are never dropped themselves), selection bounds | | `layer.list` | `{"document":index?,"flat":bool?}`: just the layers, top-down: `id`, `name`, `kind`, `visible`, `bounds` (`[x,y,w,h]` or null), `selected`, `active`; groups list their `children`, or with `flat` every layer is one row with its `depth` and `parent` group id | | `document.pixel` | `{"x":10,"y":10}`: composite RGBA | | `document.presets.list` | `{}` → `{presets:[{name,settings}]}`: saved New Document configurations | diff --git a/docs/scorecard.md b/docs/scorecard.md index 1e0576ba02..beab3671e1 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 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 7 | 14 | 6 | io corpus: oracle ≥ 148/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 249/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 188/256, round trip ≥ 258/256 | | [Tools](#tools) | 33 | 11 | 0 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 166 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 171 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 29 of 29 crates; panic_hunt present | @@ -177,7 +177,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 26 of 166** (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: 26 of 171** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `enhanced_controls.touch_gestures`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. From 9b227c2c5bfdde2000f784b11cfa50b6cc75540c Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 20 Oct 2026 19:49:23 +0200 Subject: [PATCH 07/10] Regenerate docs/scorecard.md Co-Authored-By: Claude Opus 5.5 --- docs/scorecard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scorecard.md b/docs/scorecard.md index c4b53a20f8..d675bbec72 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 | 24 | 58 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 19 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 7 | 14 | 6 | io corpus: oracle ≥ 148/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 249/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 188/256, round trip ≥ 258/256 | | [Tools](#tools) | 33 | 11 | 0 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 25 of 169 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 25 of 174 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present | @@ -179,7 +179,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 25 of 169** (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: 25 of 174** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. From 0427d52cbb5d445dfefb1d0d286bfb653c07d475 Mon Sep 17 00:00:00 2001 From: David Mann Date: Wed, 21 Oct 2026 12:17:13 +0200 Subject: [PATCH 08/10] Fix up the merges of #3535, #3567 and #6088: one catalog line per string, purge test as in #3567 The merges left the History Options and New Snapshot strings twice in the hu, sr, tr and vi catalogs (this branch's old copies next to #3535's and #3567's), which the catalog consistency test refuses; the owners' lines stay. The purge-histories test had both #3567's and this branch's edits; it is #3567's again. A test checks the snapshots against #3535's current visibility rule: with visibility changes not undoable, undoing the selection of the first snapshot or a save snapshot hides a layer the eye hid again, and Redo shows it. Regenerated docs/scorecard.md. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/history_cmds.rs | 3 --- crates/engine/src/history_options_cmds.rs | 27 +++++++++++++++++++++++ crates/ui-egui/src/i18n/hu.tsv | 5 ----- crates/ui-egui/src/i18n/sr.tsv | 3 --- crates/ui-egui/src/i18n/tr.tsv | 5 ----- crates/ui-egui/src/i18n/vi.tsv | 3 --- docs/scorecard.md | 4 ++-- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/crates/engine/src/history_cmds.rs b/crates/engine/src/history_cmds.rs index 2242ce98d0..4c352ad4b9 100644 --- a/crates/engine/src/history_cmds.rs +++ b/crates/engine/src/history_cmds.rs @@ -516,9 +516,6 @@ mod tests { #[test] fn purging_histories_frees_only_what_no_snapshot_keeps() { let mut s = session(); - // Only the snapshot taken here: the first snapshot (the document as opened) would keep - // tiles of the oldest states too. - s.execute("history.deleteSnapshot", json!({"snapshot": 0})).unwrap(); s.execute("history.newSnapshot", json!({})).unwrap(); s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap(); let st = s.active().unwrap(); diff --git a/crates/engine/src/history_options_cmds.rs b/crates/engine/src/history_options_cmds.rs index 60f97098b4..5f04c55888 100644 --- a/crates/engine/src/history_options_cmds.rs +++ b/crates/engine/src/history_options_cmds.rs @@ -553,6 +553,33 @@ mod tests { assert_eq!(crate::inspect::session(&s)["historyOptions"]["showNewSnapshotDialogByDefault"], json!(true)); } + /// The first snapshot and a save snapshot are recorded steps like any other: with Make Layer + /// Visibility Changes Undoable off, selecting one that shows a layer the eye hid, then Undo, + /// hides the layer again, and Redo shows it (the step changed it, #3535's rule). + #[test] + fn selecting_a_snapshot_undoes_its_own_visibility_change() { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 16, "height": 16})).unwrap(); + let id = s.active().unwrap().active_layer.unwrap().0; + // Red, not the white document as opened (`red` only reads the red channel). + let red = |s: &Session| s.active().unwrap().doc.layer(photocraft_doc::LayerId(id)).unwrap().surface().unwrap().pixel(1, 1)[1] < 0.5; + s.execute(CMD, json!({"makeLayerVisibilityChangesUndoable": false, "automaticallyCreateNewSnapshotWhenSaving": true})).unwrap(); + s.execute("edit.fill", json!({"color": "#ff0000"})).unwrap(); + s.active_mut().unwrap().saved_to("saved.psd".into()); + let saved = snapshot_on_save(&mut s).unwrap(); + // The eye hides the layer: no state. + s.execute("layer.setProps", json!({"layer": id, "visible": false})).unwrap(); + for (snap, is_red) in [(0, false), (saved, true)] { + s.execute("history.selectSnapshot", json!({"snapshot": snap})).unwrap(); + assert!(visible(&s, id) && red(&s) == is_red, "snapshot {snap} shows the layer as it was"); + s.execute("edit.undo", json!({})).unwrap(); + assert!(!visible(&s, id) && red(&s), "undoing snapshot {snap} hides the layer again"); + s.execute("edit.redo", json!({})).unwrap(); + assert!(visible(&s, id) && red(&s) == is_red, "redoing snapshot {snap} shows it"); + s.execute("edit.undo", json!({})).unwrap(); + } + } + /// With the oldest state current, non-linear Delete is still enabled for a later (dimmed) /// state (the History panel's trash and its drop target ask for it); linear history has /// nothing to delete there. diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0825e7c7c9..4f2b0c5eb4 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3702,12 +3702,7 @@ cameraRaw Yellow Sárga Auto-leading % Automatikus sorköz % Automatically Create First Snapshot Első pillanatkép automatikus létrehozása Automatically Create New Snapshot When Saving Új pillanatkép automatikus létrehozása mentéskor - From: Forrás: - Full Document Teljes dokumentum - Merged Layers Egyesített rétegek History Options… Előzménybeállítások… - Allow Non-Linear History Nemlineáris előzmények engedélyezése - Make Layer Visibility Changes Undoable A rétegláthatóság módosításai visszavonhatók legyenek Avoid Widows/Orphans Fattyúsorok elkerülése Blend RGB Colors Using Gamma 1.0 RGB-színek keverése 1,0 gammával Blending Mode Keverési mód diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index 513dcd47bb..275d0a3ac0 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -2290,9 +2290,6 @@ History Options… Opcije istorije… Allow Non-Linear History Dozvoli nelinearnu istoriju Make Layer Visibility Changes Undoable Omogući opozivanje promena vidljivosti slojeva - From: Od: - Full Document Ceo dokument - Merged Layers Spojeni slojevi Panel Options… Opcije panela… View menu Meni prikaza Keep view in sync Drži prikaz usklađenim diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 84cd0aeec5..d045880b51 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2697,12 +2697,7 @@ cameraRaw Color Renk Set New Snapshot as Default Yeni Anlık Görüntüyü Varsayılan Olarak Ayarla Automatically Create First Snapshot İlk Anlık Görüntüyü Otomatik Olarak Oluştur Automatically Create New Snapshot When Saving Kaydederken Otomatik Olarak Yeni Anlık Görüntü Oluştur - From: Kaynak: - Full Document Tam Belge - Merged Layers Birleştirilmiş Katmanlar History Options… Geçmiş Seçenekleri… - Allow Non-Linear History Doğrusal Olmayan Geçmişe İzin Ver - Make Layer Visibility Changes Undoable Katman Görünürlüğü Değişikliklerini Geri Alınabilir Yap Show New Snapshot Dialog by Default Yeni Anlık Görüntü İletişim Kutusunu Varsayılan Olarak Göster Clear History Geçmişi Temizle Panel Options… Panel Seçenekleri… diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 521ab4fdc3..4e919df810 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3670,9 +3670,6 @@ curves Smooth Làm mượt set in Print Settings… đặt trong thiết lập in… ICO is limited to 256 × 256 pixels ICO giới hạn ở 256 × 256 pixel # History panel › History Options… (#2966) - History Options… Tùy chọn lịch sử… - Allow Non-Linear History Cho phép lịch sử không tuyến tính - Make Layer Visibility Changes Undoable Cho phép hoàn tác thay đổi hiển thị lớp Automatically Create First Snapshot Tự động tạo ảnh chụp trạng thái đầu tiên Automatically Create New Snapshot When Saving Tự động tạo ảnh chụp trạng thái mới khi lưu Show New Snapshot Dialog by Default Mặc định hiện hộp thoại Ảnh chụp trạng thái mới diff --git a/docs/scorecard.md b/docs/scorecard.md index c26e0a8020..7707161883 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 | 25 | 59 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 20 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 7 | 14 | 6 | io corpus: oracle ≥ 148/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 249/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 188/256, round trip ≥ 258/256 | | [Tools](#tools) | 33 | 11 | 0 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 172 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 175 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present | @@ -180,7 +180,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 26 of 172** (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: 26 of 175** (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`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.gpu_adapter`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. From d03b47f8a9e28590309d98a9be076b53a10b36bd Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 26 Oct 2026 15:25:54 +0100 Subject: [PATCH 09/10] Scorecard: regenerate after merging main (#3634) Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/scorecard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scorecard.md b/docs/scorecard.md index 8045086f6b..7bdd69549d 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 | 31 | 65 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 27 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: 12 of 180 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 15 | 6 | 2 | settings that do nothing: 12 of 183 (target 0) | | [Type](#type) | 5 | 5 | 0 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present | @@ -187,7 +187,7 @@ Corpus floors (`crates/io/tests/it/corpus.rs`): the enforced minimums; the corpu ## Workspace and UI -**Settings that do nothing: 12 of 180** (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: 12 of 183** (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.gpu_adapter`, `performance.legacy_compositing`, `scratch_disks.disks`, `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`. From b69f56de4d5dc0f650ae1a30961d316391f59954 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 29 Oct 2026 17:09:17 +0100 Subject: [PATCH 10/10] Scorecard: regenerate after merging main (#3634) Co-Authored-By: Claude Opus 5.5 --- docs/scorecard.md | 4 ++-- docs/ui-parity.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/scorecard.md b/docs/scorecard.md index 076537a3a2..965e949839 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: 12 of 181 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 15 | 6 | 2 | settings that do nothing: 12 of 184 (target 0) | | [Type](#type) | 5 | 5 | 0 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 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: 12 of 181** (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: 12 of 184** (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.gpu_adapter`, `performance.legacy_compositing`, `scratch_disks.disks`, `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`. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 01a4e74df3..65c77d4c42 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity: tools, handles, modifiers and feel -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (History Options snapshot options, #3634; New Group dialog and button modifiers; new layers go into an open active group and join a clipping mask, except that type, shapes, pastes and placed files go above a group whose lock would refuse them; Color panel Hue and Brightness Cube show the out-of-gamut ⚠ and nearest printable colour when the field is at least 53 pt tall, #8672; 12 of 181 preferences do nothing, from the scorecard; Art History Brush in the History group of the Y flyout, partial, TOOL-213-20, #1610; Histogram panel: Compact / Expanded / All Channels views, Luminosity and Colors channels, Source, range statistics, Uncached Refresh, live adjustment overlay, Cache Levels preference; the font menu opens on the current family, marked in the recent group when it is a recent one, #9160; Type options bar alignment and direction follow the target paragraph; a swatch click recolours selected type and shape layers with any tool, #9238; UI scale presets done: 105–120% steps, #3222; ⇧⌥ blend mode letters; painting tool Mode menus; ⌥ + an adjustment's shortcut reopens it at its last settings, ⌥⌘L / ⌥⌘M, #8900; Crop default mode: moving the image under the box snaps the frame's edges and centre, #8580; View › Extras hides the Move transform controls, #6699; adjustment clipping stays visible in compact Properties, #5231; Color panel modes from its panel menu, the same in every theme, UI-217-17, #6000; a picked colour recolours the selected type and shapes; Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Move tool: dragged selected pixels take their own outline as the selection, #7538; artboard backgrounds remain below child Free Transform previews; ⌫/Delete removes the selected smart filter, #4751; Object Finder foreground/background discrimination (#6548); rounded triangle, polygon and star corners; shape Fill/Stroke popovers accept hex RGB values, #6176; a guide let go over either ruler is removed, #6286; Crop rows corrected: saved crop presets and Delete Cropped Pixels off are done, #6562; marching ants in device pixels, #7489; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests; Properties › Transform shows a shape's path geometry, without its stroke) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (History Options snapshot options, #3634; New Group dialog and button modifiers; new layers go into an open active group and join a clipping mask, except that type, shapes, pastes and placed files go above a group whose lock would refuse them; Color panel Hue and Brightness Cube show the out-of-gamut ⚠ and nearest printable colour when the field is at least 53 pt tall, #8672; 12 of 184 preferences do nothing, from the scorecard; Art History Brush in the History group of the Y flyout, partial, TOOL-213-20, #1610; Histogram panel: Compact / Expanded / All Channels views, Luminosity and Colors channels, Source, range statistics, Uncached Refresh, live adjustment overlay, Cache Levels preference; the font menu opens on the current family, marked in the recent group when it is a recent one, #9160; Type options bar alignment and direction follow the target paragraph; a swatch click recolours selected type and shape layers with any tool, #9238; UI scale presets done: 105–120% steps, #3222; ⇧⌥ blend mode letters; painting tool Mode menus; ⌥ + an adjustment's shortcut reopens it at its last settings, ⌥⌘L / ⌥⌘M, #8900; Crop default mode: moving the image under the box snaps the frame's edges and centre, #8580; View › Extras hides the Move transform controls, #6699; adjustment clipping stays visible in compact Properties, #5231; Color panel modes from its panel menu, the same in every theme, UI-217-17, #6000; a picked colour recolours the selected type and shapes; Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Move tool: dragged selected pixels take their own outline as the selection, #7538; artboard backgrounds remain below child Free Transform previews; ⌫/Delete removes the selected smart filter, #4751; Object Finder foreground/background discrimination (#6548); rounded triangle, polygon and star corners; shape Fill/Stroke popovers accept hex RGB values, #6176; a guide let go over either ruler is removed, #6286; Crop rows corrected: saved crop presets and Delete Cropped Pixels off are done, #6562; marching ants in device pixels, #7489; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests; Properties › Transform shows a shape's path geometry, without its stroke) · **Target:** Adobe Photoshop 2026 How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation, @@ -230,7 +230,7 @@ Paragraph; the rest open as in-app floating windows. | Histogram panel: Compact (the default, of the entire image), Expanded and All Channels views (the channel kept across them); RGB/CMYK/Lab/Gray channels, Luminosity and Colors (overlaid, mixed where they overlap); Show Channels in Color and Show Statistics; Source (Entire Image, Selected Layer, Adjustment Composite) for multilayer documents; Mean, Std Dev, Median, Pixels, Level, Count, Percentile and Cache Level for the pointer level or a dragged range; the cached-data warning, Uncached Refresh (menu, button, warning click, double-click); the adjusted histogram over the original while an adjustment previews; Cache Levels 1–8 in Preferences › Performance; Color Sampler levels marked on the graph | partial | `histogram_panel.rs`, `histogram_panel_tests.rs`, `tone.rs`; differs: filter dialogs that preview on the CPU proxy aren't counted live, a selection doesn't limit the histogram yet, with Source Selected Layer an adjustment dialog's preview isn't counted, and new strings are English-only so far | | Command palette with recents | done | UI-217-7 | | Menu bar from the keyboard: Alt / F10 focus the bar, ← → ↓ ↩ drive it, Alt+letter opens a menu, underlined mnemonics run items | done | `menu_keys.rs`, #4988; macOS uses the native bar | -| Every preference takes effect | partial | 12 of 181 do nothing (scorecard, 2026-10-27) | +| Every preference takes effect | partial | 12 of 184 do nothing (scorecard, 2026-10-29) | | UI scale presets | done | UI-217-9; 75–125% in 5% steps (#2492, #3222) | | History snapshots: camera button, New Snapshot dialog (⌥-click: Name, From), the first snapshot (the document as opened), snapshot rows (click returns and selects, rename, delete; the trash deletes the selected snapshot, and a snapshot or state dragged onto it, #5324), `history.*Snapshot` commands; History Options' snapshot options (Automatically Create First Snapshot, New Snapshot When Saving, Show New Snapshot Dialog by Default) | partial | `history_cmds.rs`, `history_options_cmds.rs`, `snapshot_rows` in `panels.rs`, `snapshot_dialog.rs`; History Brush sources to come (#2966) | | Themes: Photoshop's four greys | partial | five themes; #2661 |