Address CodeRabbit review: Batch writes, recording and dialog edge cases

- CLI batch: recursive inputs keep the engine's tree order for {serial};
  --format picks the encoder whatever extension --naming writes; the
  summary prints before --error-log is written.
- Batch: a jobs.cancel during a write keeps that file in `files`;
  Opened Files refuses a default-named result that replaces another open
  document's file; a recorded Save leaves a document changed when Batch
  writes nothing for it.
- Recording: folded Move-tool nudges add whole-pixel steps; a null
  Check Spelling `action` is recorded as Check Spelling.
- Linked files: a document without links lists none missing; a look
  whose links changed while it ran is dropped.
- Save for Web: a null or empty destination opens the picker; a rename
  while the picker is open writes the picked file.
- Actions: a Check Spelling step fails instead of replacing a dialog
  opened by hand.
- Docs: desktop Batch cancel flow, Check Spelling step shape, filter row
  history count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-11-03 03:02:19 +01:00
1 parent 56870f5687
commit 3ce04b52f4
15 files changed
+258 -22

No files matched your search

+11 -7
View File
@@ -58,7 +58,7 @@ pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) ->
if !a.in_place && same_dir(in_dir, out_dir) {
return Err(CliError::OutIsIn(out_dir.to_path_buf()));
}
let mut inputs: Vec<photocraft_engine::file_cmds::BatchInput> = if a.recursive {
let inputs: Vec<photocraft_engine::file_cmds::BatchInput> = if a.recursive {
photocraft_engine::file_cmds::list_images_tree(&in_dir.to_string_lossy(), &out_dir.to_string_lossy(), "photocraft-cli batch")?
.into_iter()
.filter(|input| is_input(Path::new(&input.path)))
@@ -72,9 +72,11 @@ pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) ->
images.push(photocraft_engine::file_cmds::BatchInput { path: path.to_string_lossy().into_owned(), rel_dir: String::new() });
}
}
// The tree listing already holds the engine's order (each folder's files, then its
// subfolders), which `{serial}` numbers; only the flat listing needs sorting.
images.sort_by(|a, b| a.path.cmp(&b.path));
images
};
inputs.sort_by(|a, b| a.path.cmp(&b.path));
let (mut ok, mut failed) = (0, 0);
// `--format .jpg` names outputs `<stem>.jpg`, as `--format jpg` does (#490).
let format = a.export.format.as_deref().map(|f| f.strip_prefix('.').unwrap_or(f));
@@ -109,7 +111,8 @@ pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) ->
let mut failures = Vec::new();
for (input, target) in inputs.iter().zip(targets) {
let input = Path::new(&input.path);
let ext = target.extension().map(|ext| ext.to_string_lossy().into_owned()).unwrap_or_else(|| "png".into());
// The selected format encodes the bytes, whatever extension `--naming` gives the file.
let ext = format.map(str::to_owned).or_else(|| input.extension().map(|e| e.to_string_lossy().into_owned())).unwrap_or_else(|| "png".into());
let r = (|| -> Result<Vec<String>> {
if let Some(parent) = target.parent() {
std::fs::create_dir_all(parent)?;
@@ -151,10 +154,6 @@ pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) ->
}
}
}
if let Some(path) = &a.error_log {
let bytes = photocraft_engine::file_cmds::encode_batch_error_log(failures.iter().map(|(file, error)| (file.as_str(), error.as_str())));
photocraft_format::atomic_write(path, &bytes)?;
}
let skipped = inputs.len().saturating_sub(ok + failed);
if skipped > 0 {
let _ = writeln!(err, "--stop-on-error: {skipped} remaining input(s) skipped");
@@ -162,6 +161,11 @@ pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) ->
} else {
let _ = writeln!(out, "{ok} succeeded, {failed} failed");
}
// After the summary, so a log that can't be written doesn't hide the counts.
if let Some(path) = &a.error_log {
let bytes = photocraft_engine::file_cmds::encode_batch_error_log(failures.iter().map(|(file, error)| (file.as_str(), error.as_str())));
photocraft_format::atomic_write(path, &bytes)?;
}
if failed > 0 { Err(CliError::FilesFailed(failed)) } else { Ok(()) }
}
+43
View File
@@ -513,6 +513,49 @@ fn batch_recursive_naming_stop_and_error_log() {
assert!(!collision.join("a.png").exists());
}
/// `{serial}` numbers a recursive batch in the engine's order (a folder's files before its
/// subfolders), `--format` encodes the bytes whatever extension `--naming` writes, and an
/// `--error-log` that can't be written still leaves the summary printed.
#[test]
fn batch_naming_keeps_the_tree_order_and_the_selected_encoder() {
let root = tmp("batch-naming-order");
let input = root.join("in");
std::fs::create_dir_all(input.join("sub")).unwrap();
write_png(&input.join("z.png"), 8, 6, 3);
write_png(&input.join("sub/a.png"), 5, 4, 3);
let actions = root.join("actions.json");
std::fs::write(&actions, "[]").unwrap();
let run = |out: &Path, extra: &[&str]| {
bin().args(["batch", "--actions"]).arg(&actions).arg("--in").arg(&input).arg("--out").arg(out).args(extra).output().unwrap()
};
let png_width = |path: &Path| {
let bytes = std::fs::read(path).unwrap();
u32::from_be_bytes(bytes[16..20].try_into().unwrap())
};
let ordered = root.join("ordered");
let result = run(&ordered, &["--recursive", "--naming", "{serial:2}.{ext}"]);
assert!(result.status.success(), "{}", String::from_utf8_lossy(&result.stderr));
assert_eq!(png_width(&ordered.join("01.png")), 8, "the root file comes first");
assert_eq!(png_width(&ordered.join("02.png")), 5);
let jpeg = root.join("jpeg");
let result = run(&jpeg, &["--format", "jpg", "--naming", "{name}_{serial}"]);
assert!(result.status.success(), "{}", String::from_utf8_lossy(&result.stderr));
assert!(std::fs::read(jpeg.join("z_001")).unwrap().starts_with(&[0xff, 0xd8]), "JPEG bytes without an extension");
let png = root.join("png");
let result = run(&png, &["--format", "png", "--naming", "{name}.jpg"]);
assert!(result.status.success(), "{}", String::from_utf8_lossy(&result.stderr));
assert!(std::fs::read(png.join("z.jpg")).unwrap().starts_with(b"\x89PNG"), "PNG bytes under a .jpg name");
let log = root.join("log-is-a-folder");
std::fs::create_dir_all(&log).unwrap();
let result = run(&root.join("logged"), &["--error-log", &log.to_string_lossy()]);
let stdout = String::from_utf8_lossy(&result.stdout);
assert!(!result.status.success(), "{stdout}");
assert!(stdout.contains("1 succeeded, 0 failed"), "{stdout}");
std::fs::remove_dir_all(root).unwrap();
}
#[test]
fn batch_skips_recorded_view_and_save_steps() {
let d = tmp("batch-shell-steps");
+3 -2
View File
@@ -459,8 +459,9 @@ fn fold_recorded_nudges(steps: impl IntoIterator<Item = (String, Value)>) -> Vec
.and_then(|p| p.get("coalesce").and_then(Value::as_str).filter(|run| run.starts_with("nudge:")))
.map(str::to_string);
if let Some(run) = &run {
let dx = params.get("dx").and_then(Value::as_f64);
let dy = params.get("dy").and_then(Value::as_f64);
// `layer.translate` moves each step by whole pixels, so the fold adds rounded steps.
let dx = params.get("dx").and_then(Value::as_f64).map(f64::round);
let dy = params.get("dy").and_then(Value::as_f64).map(f64::round);
if let (Some(dx), Some(dy)) = (dx, dy)
&& dx.is_finite()
&& dy.is_finite()
@@ -395,6 +395,20 @@ fn recording_folds_one_run_of_move_tool_nudges() {
assert_eq!(steps, &[("layer.translate".into(), json!({"dx": 3.0, "dy": 10.0})), ("layer.translate".into(), json!({"dx": 0.0, "dy": 1.0}))]);
}
/// Each nudge moves by whole pixels, so two 0.6 px steps fold into the 2 px they moved, not 1.2.
#[test]
fn folded_nudges_add_whole_pixel_steps() {
let mut s = Session::new();
s.execute("file.new", json!({"width": 24, "height": 24, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Target"})).unwrap();
s.execute("actions.record", json!({"name": "Nudge"})).unwrap();
for _ in 0..2 {
s.execute("layer.translate", json!({"dx": 0.6, "dy": 0.0, "coalesce": "nudge:1"})).unwrap();
}
s.execute("actions.stop", json!({})).unwrap();
assert_eq!(s.actions.list[0].steps, [("layer.translate".into(), json!({"dx": 2.0, "dy": 0.0}))]);
}
#[test]
fn recording_document_activation_uses_opening_order_offset() {
let mut s = Session::new();
+30 -2
View File
@@ -366,7 +366,13 @@ pub(super) fn process_batch_outputs(
let result = process_one(raw_ppi, path, out, save, ProcessOptions { format: Some(format), written: None, ctx: Some(ctx) }, f);
if ctx.cancelled() {
ctx.publish_batch_preview(path, None);
done = index;
// A cancel that lands while the result is written still leaves that file written.
if result.is_ok() {
files.push(out.clone());
done = index + 1;
} else {
done = index;
}
break;
}
if ctx.batch_take_interrupt() {
@@ -642,12 +648,21 @@ fn batch_open_documents(
.collect(),
})
};
// As for a folder: no result may replace another open document's file.
#[cfg(not(target_arch = "wasm32"))]
if let Some(paths) = &planned {
let plan: Vec<(String, String)> = originals.iter().map(|(_, _, path)| path.clone()).zip(paths.iter().cloned()).collect();
validate_flat_outputs(&plan)?;
}
validate_error_log(policy, originals.iter().map(|(_, _, path)| path.clone()), planned.iter().flat_map(|paths| paths.iter().cloned()))?;
let mut files = Vec::new();
let mut errors = Vec::new();
let mut stopped = None;
let mut done = 0;
for (index, (id, name, path)) in originals.iter().enumerate() {
// The document a recorded Save / Save As marked as saved, with its earlier saved
// revision: when Batch then writes nothing, it reads as changed again.
let mut marked: Option<(u64, u64)> = None;
let result = (|| -> Result<()> {
let position = s.documents().iter().position(|state| state.doc.id.0 == *id).ok_or(EngineError::NoDocument)?;
s.set_active(position);
@@ -656,7 +671,11 @@ fn batch_open_documents(
if batch_save_point(command) {
let state = s.active_mut().ok_or(EngineError::NoDocument)?;
saved = Some(state.doc.clone());
if command != "file.saveACopy" {
// With no destination nothing is written, so the document stays changed.
if command != "file.saveACopy" && planned.is_some() {
if marked.is_none() {
marked = Some((state.doc.id.0, state.saved_revision));
}
state.saved_revision = state.revision;
}
continue;
@@ -679,6 +698,15 @@ fn batch_open_documents(
Ok(())
})();
done = index + 1;
if result.is_err()
&& let Some((doc, revision)) = marked
&& let Some(position) = s.documents().iter().position(|state| state.doc.id.0 == doc)
{
s.set_active(position);
if let Some(state) = s.active_mut() {
state.saved_revision = revision;
}
}
if let Err(error) = result {
errors.push(json!({"document": name, "error": error.to_string()}));
if policy.stop_on_error {
+35
View File
@@ -445,6 +445,41 @@ fn batch_open_source_save_as_then_close_ask_writes_the_result() {
assert!(session.documents().is_empty());
}
#[test]
fn batch_open_source_refuses_a_result_that_replaces_another_open_file() {
let dir = tmp("batch-open-replaces-input");
let mut session = Session::new();
// Saved as PNG under its default name, `a.jpg`'s result is the open `a.png`'s file.
for (name, format) in [("a.jpg", "jpg"), ("a.png", "png")] {
let path = png(&dir, name, 8, 6, "#ff0000");
session.execute("file.openAs", json!({"path": path, "as": format})).unwrap();
}
let before = std::fs::read(join(&dir, "a.png")).unwrap();
let error = session
.execute("file.automate.batch", json!({"source": "open", "steps": [["image.imageRotation.90cw", {}]], "output": dir, "format": "png"}))
.unwrap_err();
assert!(error.to_string().contains("replace another input"), "{error}");
assert_eq!(std::fs::read(join(&dir, "a.png")).unwrap(), before, "nothing is written before the refusal");
}
#[test]
fn batch_open_source_save_step_leaves_an_unwritten_document_changed() {
let mut session = Session::new();
session.execute("file.new", json!({"name": "First", "width": 8, "height": 6})).unwrap();
let steps = json!([["image.adjustments.invert", {}], ["file.save", {}]]);
// No destination: nothing is written.
let result = session.execute("file.automate.batch", json!({"source": "open", "steps": steps})).unwrap();
assert_eq!(result["errors"], json!([]), "{result}");
assert!(session.documents()[0].is_dirty(), "a document Batch did not write stays changed");
// A destination that can't be written: the write fails.
let dir = tmp("batch-open-save-fails");
let blocker = join(&dir, "not-a-folder");
std::fs::write(&blocker, b"file").unwrap();
let result = session.execute("file.automate.batch", json!({"source": "open", "steps": steps, "output": blocker, "format": "png"})).unwrap();
assert_eq!(result["errors"].as_array().map(Vec::len), Some(1), "{result}");
assert!(session.documents()[0].is_dirty(), "a failed write leaves the document changed");
}
#[cfg(unix)]
#[test]
fn batch_error_log_rejects_a_dangling_link_to_a_planned_output() {
+11 -1
View File
@@ -207,7 +207,7 @@ fn remove_word(s: &mut Session, p: &Value) -> Result<Value> {
/// Whether an action records this call: only Check Spelling itself (no `action`), which the
/// dialog runs when it closes. Its corrections, dictionary edits and lookups are not recorded.
pub(crate) fn records(p: &Value) -> bool {
p.get("action").is_none()
p.get("action").is_none_or(Value::is_null)
}
/// The step a recorded Check Spelling becomes: `{"allLayers"}`, `false` when it checked one layer.
@@ -442,6 +442,16 @@ mod tests {
assert_eq!(s.actions.list[0].dialogs.len(), 2);
}
/// `"action": null` runs Check Spelling itself, so it is recorded as one.
#[test]
fn a_null_action_is_recorded_as_check_spelling() {
let (mut s, _) = session("Teh end");
s.execute("actions.record", json!({"name": "Null"})).unwrap();
s.execute("edit.checkSpelling", json!({"action": null})).unwrap();
s.execute("actions.stop", json!({})).unwrap();
assert_eq!(s.actions.list[0].steps, [("edit.checkSpelling".to_string(), json!({"allLayers": true}))]);
}
#[test]
fn played_check_spelling_without_its_dialog_changes_nothing() {
let (mut s, id) = session("Teh end");
+46 -1
View File
@@ -96,8 +96,10 @@ impl Session {
}
let Some(st) = self.active() else { return };
let (doc, files) = (st.doc.id.0, resolved_files(st));
// Nothing to look at: no links, or none that is followed.
// Nothing to look at: no links, or none that is followed. None of them is listed as
// missing either, so a link added back isn't shown missing before its first look.
if files.iter().all(|(_, file, _)| file.is_none()) {
self.link_missing.retain(|(d, _)| *d != doc);
return;
}
let slot: LinkScan = Arc::default();
@@ -139,6 +141,13 @@ impl Session {
pub fn poll_link_scan(&mut self) -> Option<Result<Value>> {
let (doc, stamps) = self.link_scan.as_ref()?.lock().unwrap_or_else(PoisonError::into_inner).take()?;
self.link_scan = None;
// A relink or embed while the look ran: it stamped files the document no longer links in
// that way, so drop it; the next look takes the current links.
if let Some(st) = self.active().filter(|st| st.doc.id.0 == doc)
&& !linked_files(&st.doc).iter().map(|(p, ids)| (p, ids)).eq(stamps.iter().map(|(p, ids, _)| (p, ids)))
{
return Some(Ok(json!({"updated": []})));
}
Some(self.apply_link_stamps(doc, stamps))
}
@@ -392,6 +401,42 @@ mod tests {
assert!(s.missing_links().is_empty());
}
#[test]
fn a_document_without_links_lists_none_missing() {
let d = dir("unlinked");
let path = d.join("art.png");
std::fs::write(&path, png(10, 10, "#ff0000")).unwrap();
let (mut s, id) = placed(&path);
std::fs::remove_file(&path).unwrap();
s.execute("layer.smartObjects.updateChanged", json!({})).unwrap();
assert_eq!(s.missing_links().len(), 1);
s.execute("layer.delete", json!({"layer": id})).unwrap();
s.start_link_scan();
assert!(s.missing_links().is_empty(), "the last linked layer is gone");
}
#[test]
fn a_look_at_links_that_changed_meanwhile_is_dropped() {
let d = dir("relinked");
let path = d.join("art.png");
std::fs::write(&path, png(10, 10, "#ff0000")).unwrap();
let (mut s, layer) = placed(&path);
let doc = s.active().unwrap().doc.id.0;
let stored = super::linked_files(&s.active().unwrap().doc)[0].0.clone();
let inject = |s: &mut Session, file: &str| {
let scan = std::sync::Arc::new(std::sync::Mutex::new(Some((doc, vec![(file.to_string(), vec![layer], None)]))));
s.link_scan = Some(scan);
};
// Taken before a relink: its file is no longer linked.
inject(&mut s, &d.join("before-relink.png").to_string_lossy());
assert_eq!(s.poll_link_scan().unwrap().unwrap(), json!({"updated": []}));
assert!(s.missing_links().is_empty(), "a file no longer linked is not listed");
// Taken of the current links: applied.
inject(&mut s, &stored);
s.poll_link_scan().unwrap().unwrap();
assert_eq!(s.missing_links(), [stored].into());
}
#[test]
fn a_background_look_updates_changed_files() {
let d = dir("scan");
@@ -314,6 +314,33 @@ fn save_for_web_with_the_suggested_name_records_only_the_folder() {
let _ = std::fs::remove_dir_all(&dir);
}
/// A null `folder` is no destination: the picker asks. A document renamed while the picker is
/// open writes the picked file, not one named after the new name.
#[test]
fn save_for_web_writes_the_picked_file_when_no_folder_is_given_or_the_name_changed() {
let dir = std::env::temp_dir().join(format!("pc-webui-renamed-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
for rename in [false, true] {
let (mut app, ctx) = app();
let target = dir.join("web.png").to_string_lossy().into_owned();
let (dialog, _) = crate::file_dialog::fake(vec![Some(crate::file_dialog::FileDialogAnswer::SaveTo(target.clone()))]);
app.services.file_dialog = Some(dialog);
let id = open_web(&mut app);
let fields = &mut app.ui.dialog_mut(id).unwrap().fields;
fields.insert("format".into(), json!("png24"));
fields.insert("folder".into(), Value::Null);
crate::dialogs::confirm(&mut app, id).unwrap();
if rename {
std::sync::Arc::make_mut(&mut app.session.active_mut().unwrap().doc).name = "renamed".into();
}
app.poll_file_dialog(&ctx, None);
assert!(std::path::Path::new(&target).exists(), "rename {rename}: {target}");
assert!(!dir.join("renamed.png").exists(), "rename {rename}");
let _ = std::fs::remove_file(&target);
}
let _ = std::fs::remove_dir_all(&dir);
}
#[test]
fn save_for_web_starts_at_the_current_document_size() {
let (mut app, _) = app();
+9 -1
View File
@@ -531,6 +531,10 @@ pub(super) fn web_confirm(app: &mut PhotocraftApp, f: &Map<String, Value>) -> Re
authorize(&prepared)?;
p = prepared;
}
// A null or empty destination is none: the picker asks for one.
if let Some(fields) = p.as_object_mut() {
fields.retain(|key, value| !(matches!(key.as_str(), "path" | "dir" | "folder") && (value.is_null() || value.as_str() == Some(""))));
}
if p.get("path").is_some() || p.get("dir").is_some() || p.get("folder").is_some() {
return save_for_web(app, p);
}
@@ -546,7 +550,11 @@ pub(super) fn web_confirm(app: &mut PhotocraftApp, f: &Map<String, Value>) -> Re
let dir = path.rfind(['/', '\\']).map(|i| path[..i].to_string()).unwrap_or_else(|| ".".into());
p["dir"] = json!(dir);
p["html"] = json!(html);
} else if let Some(folder) = kept_name_folder(&path, &base, st.format.ext()) {
} else if let Some(folder) = kept_name_folder(&path, &base, st.format.ext())
// A save that renamed the document meanwhile: the engine would name the file after
// the new name, not the one picked.
&& app.session.active().is_some_and(|state| photocraft_doc::slices::base_name(&state.doc) == base)
{
// The suggested name kept: only the folder, so a recorded action saves each
// document under its own name, as in Photoshop (#5305).
p["folder"] = json!(folder);
+5 -3
View File
@@ -254,11 +254,13 @@ fn play_owned(app: &mut PhotocraftApp, params: &Value, suspended: Option<Value>)
break;
}
// Check Spelling's dialog opens with Check All Layers as recorded; Done continues the action.
// While another action waits at the open dialog, this step fails and the waiting one keeps it.
// While the dialog is open (for another action or by hand), this step fails and the open
// one keeps its place and ignored words.
// A correction (`action` set) opens no dialog and runs below.
if action.dialogs.contains(&i) && !app.automation_input && id == "edit.checkSpelling" && p.get("action").is_none() {
if app.ui.type_panels.spell.as_ref().is_some_and(|d| d.resume.is_some()) {
failed = Some(json!({"step": i, "id": id, "error": "Check Spelling is already open for another action"}));
if let Some(open) = app.ui.type_panels.spell.as_ref() {
let error = if open.resume.is_some() { "Check Spelling is already open for another action" } else { "Check Spelling is already open" };
failed = Some(json!({"step": i, "id": id, "error": error}));
break;
}
if let Err(error) = crate::type_panels_ui::open_spelling(app, p.get("allLayers").and_then(Value::as_bool).unwrap_or(true)) {
@@ -1606,6 +1606,24 @@ fn a_check_spelling_step_with_its_dialog_opens_it_and_done_continues() {
assert_eq!(texts, ["Teh cat"]);
}
/// Check Spelling opened by hand keeps its place: an action's Check Spelling step fails instead
/// of replacing it.
#[test]
fn a_check_spelling_step_fails_while_the_dialog_is_open_by_hand() {
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());
app.run("file.new", json!({"width": 300, "height": 100})).unwrap();
app.run("type.create", json!({"x": 10, "y": 50, "text": "Teh cat"})).unwrap();
let mut a = Action::new("Spell", vec![("edit.checkSpelling".into(), json!({"allLayers": false})), ("layer.new.layer".into(), json!({"name": "after"}))]);
a.dialogs.insert(0);
app.session.actions.list.push(a);
crate::type_panels_ui::open_spelling(&mut app, true).unwrap();
let v = play(&mut app, &json!({"action": "Spell"})).unwrap();
assert_eq!(v["failed"]["error"], "Check Spelling is already open", "{v}");
let d = app.ui.type_panels.spell.as_ref().expect("the dialog stays open");
assert!(d.all_layers && d.resume.is_none(), "the hand-opened dialog is kept");
assert!(!layer_names(&app).contains(&"after".to_string()));
}
/// A correction step (`action` set) runs as it did before the dialog toggle applied to Check
/// Spelling: its dialog switch opens nothing.
#[test]
+4 -3
View File
@@ -66,6 +66,7 @@ dot only at the end. `batch_include_all_subfolders`,
`batch_naming_later_result_replaces_the_earlier_one`, and
`extension_component_only_adds_a_dot_at_the_end` check those cases. PhotoCraft deliberately
rejects a plan that would replace another input file before it is read, to prevent data loss.
It keeps a progress display and immediate cancellation in the UI so headless control clients can
observe and stop a batch. The measured Photoshop dialog has no progress display and asks whether
to continue or stop after Esc; those differences remain open under AUTO-219-5.
The desktop Batch follows the measured flow: it shows no progress in the status bar, previews each
input read-only on the canvas, and Esc asks whether to continue or stop. Headless control clients
still read the job's progress and stop it with `jobs.cancel`. The inputs are not live tabs with
Layers panel content, so AUTO-219-5 stays partial.
+1 -1
View File
@@ -152,7 +152,7 @@ store expose and persist the same setting; scripts keep using canonical command
| `actions.list` | `{}` → `{actions:[{name, steps}], recording}` (the name being recorded, or null) |
| `actions.get` | `{"action": name or index}` → `{name, steps:[[id, params], …], disabled:[step, …]}`. `steps` is the shape `file.automate.batch` and droplets take; `disabled` lists the 0-based steps playback skips |
| `actions.record` | `{"name":"Red"}` starts a new action (default name `Action N`). `{"action": name or index}` appends to one that exists |
| `actions.stop` | `{}` → `{action, steps}`. Copies replayable journal entries since `actions.record` (queries and action-editing commands omitted). For portable playback, an active `layer` id is dropped only when it is the sole selected layer and does not supply source content (`layer.new.frame`, `select.loadSelection`, `type.createSelection`, `edit.checkSpelling`). Otherwise, including when several layers are selected, it is recorded by its unique name; `layer.select` records `{"name":"Layer","occurrence":0}`. Type tool keystrokes on a new layer fold into its `type.create` step; edits on an existing text layer retain separate replacements so styled text between edited spans survives replay. For commands other than `layer.select`, ambiguous layer names keep the id and require a unique name for portable playback |
| `actions.stop` | `{}` → `{action, steps}`. Copies replayable journal entries since `actions.record` (queries and action-editing commands omitted). For portable playback, an active `layer` id is dropped only when it is the sole selected layer and does not supply source content (`layer.new.frame`, `select.loadSelection`, `type.createSelection`, `edit.checkSpelling`; a Check Spelling step keeps only `allLayers`, as the reference application's step does). Otherwise, including when several layers are selected, it is recorded by its unique name; `layer.select` records `{"name":"Layer","occurrence":0}`. Type tool keystrokes on a new layer fold into its `type.create` step; edits on an existing text layer retain separate replacements so styled text between edited spans survives replay. For commands other than `layer.select`, ambiguous layer names keep the id and require a unique name for portable playback |
| `actions.play` | `{"action": name or index, "from": step?}`. `from` and `failed.step` are 0-based. Returns `{action, ran, failed?:{step, id, error}}` and still returns ok when a step fails, so a partial run is reported. Leaves one history step per step that ran. Supports nested action calls up to 16 levels, rejecting cycles. While recording, playing another action appends one named `actions.play` step instead of its expanded commands. On an untrusted session each step is authorized the same way as a top-level command |
| `actions.move` | `{"action": name or index, "step": index?, "to": index}` moves a step within its action, or moves the whole action when `step` is omitted. `to` is the final zero-based index. Pending steps can be reordered while recording; invalid moves leave the list unchanged. |
| `actions.delete` | `{"action": name or index, "step": index?}`. With a zero-based `step`: `{action, deletedStep, steps}`, also allowed while recording. Without `step`: `{deleted}`, refused while recording |
+1 -1
View File
@@ -267,7 +267,7 @@ Paragraph; the rest open as in-app floating windows.
| Date | Change | Summary |
|---|---|---|
| 2026-11-01 | minor | Every preference takes effect: 11 of 183 do nothing (was 12); Graphics Adapter always worked, but startup read it by raw JSON key, which the scorecard audit can't see |
| 2026-10-31 | minor | Layers panel filter-type dropdown: Color filters by the layers' label colour (#5898); Kind, Name, Mode and Color, the other five missing; no percentage changed |
| 2026-10-31 | minor | Layers panel filter-type dropdown: Color filters by the layers' label colour (#5898); Kind, Name, Mode, Color, Smart Object and Artboard, the other three missing; no percentage changed |
| 2026-10-29 | minor | Paragraph box overflow: text a box can't hold enlarges the box's lower-right handle and shows a black + in it, as the reference application does (#8311); agents read `typeBoxOverflow` in `ui.inspect`. Not a new command, so no percentage changed |
| 2026-10-28 | minor | The text and gradient stop Color Pickers preview the picked colour on the canvas before OK, as Photoshop's do (#5530); no percentage changed |
| 2026-10-27 | minor | Shape Fill/Stroke popover as Photoshop's (paint types, Color Picker button, Recently Used Colors, swatch folders, with the Gradient tab) and every colour swatch opens the full Color Picker; rows added (partial, done); Recently Used Colors is a new preference, so 12 of 183 do nothing; no percentage changed; 2026-10-30: the swatches preview live while their Color Picker is open |