Repository navigation
fix(perspective-crop): run imported Perspective Crop steps in Batch and droplet runs - #20736
Higgs32584 wants to merge 1 commit into
Conversation
…nd droplet runs A droplet plays its action's stored steps as a step list through Batch (or directly for Destination None), where no named action raises the playback counter, so a loaded Perspective Crop step was refused. Batch and droplet runs raise batch_depth; accept the recorded descriptor there too. A direct call outside playback is still refused. Fixes storytold#20730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
A droplet or Batch step list made from an action with a loaded Perspective Crop now crops instead of failing.
Fixes #20730.
What the user saw: running a droplet built from an action that holds an imported (ATN) Perspective Crop step failed that step with "a recorded Perspective Crop descriptor may only run during action playback".
Cause:
perspective_crop(follow-up to #20166) accepted the recorded descriptor only whenrecording.playing > 0. A droplet runs its stored steps as an explicit step list: throughfile.automate.batchwithsteps(not a named action, soplayingstays 0), or for Destination None throughs.executeinrun_droplet_open. Neither raisesplaying.Change: the guard in
crates/engine-core/src/cmd/perspective_crop_cmds.rsalso acceptsrecording.batch_depth > 0. Both Batch's run (folder and open-documents sources) andrun_droplet_openraisebatch_depthfor their steps, so both droplet paths are covered by this one condition. A direct call with the descriptor outside any playback or batch is still refused. Script runs of saved steps (mentioned as "likely" in the issue) are not changed here.Test:
perspective_crop_atn_runs_in_a_batch_step_list_but_not_directlyincrates/engine-core/src/cmd/atn_cmds/perspective_crop_step_tests.rsloads an ATN Perspective Crop, checks that a direct call with the imported params is refused, then runs the same step throughfile.automate.batchwith astepslist on the open document and checks the run has no errors and the canvas shrank. Without the fix it fails with the refusal error in the batch'serrors.Verification (local):
cargo test -p photocraft-engine-core --lib perspective_crop(60 passed; the new test failed before the fix),cargo clippy -p photocraft-engine-core --all-targets -- -D warnings(clean),cargo fmt --check(clean).photocraft-engine-coretest suite,cargo xtask layers,cargo xtask wasm, the panic_hunt sweep, and the corpus tests; left to CI.🤖 Generated with Claude Code
Summary by CodeRabbit