Skip to content

Export: the run-presets and contact-sheet commands refuse to start beside another export, the contact sheet gets a cancellable row, and the web build greys out Export with Several Presets - #1841

Merged
emmertex merged 2 commits into
emmertex:stagingfrom
blwfish:fix/fx-217-227-run-presets-command-and-wasm
Dec 2, 2026

Conversation

@blwfish

@blwfish blwfish commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Part of #1838 (entries 14 and 15).

In short: export.runPresets and export.contactSheet, as commands, could start while another export was running, and the contact sheet showed no row and had no cancel. Now both are refused while another export row is running (the rule app.runPresets already follows), and the contact sheet has one row, "Exporting contact sheet", that a cancel stops before the next photo. The web build can't write files that way, so Export with Several Presets is greyed out there, as the contact sheet, Print and slideshow export already are.

Change

  • Busy rule: a new Activity::is_running and export::ensure_none_running; both commands refuse with the usual "another export is running" message.
  • Contact sheet row: the run holds one activity row whose cancel flag it checks before each photo; a cancel returns an error and writes no file.
  • Calling thread: both commands still run on the calling thread, as every engine command does. The app already has the background forms app.runPresets and app.contactSheet. Over the control channel the ✕ can't be clicked until the command returns, but activity.cancel works from another thread; docs/background-tasks.md says so.
  • Web build: the menu item is greyed out; dialog.runPresets and app.runPresets also refuse there, with a message saying why. The run still uses the engine's writer; making it use the front end's is a larger change.
  • Manual, docs/background-tasks.md; what's new and changelog entries.

How it was checked

the_export_commands_are_refused_while_another_export_runs and a_run_with_a_row_shows_progress_and_a_cancel_stops_it fail with the old behaviour put back; the_web_build_greys_out_and_refuses_several_presets fails with the web check removed. cargo check --target wasm32-unknown-unknown -p lcc-engine -p lcc-ui-egui passes.

Question: see the umbrella (entry 14).

  • cargo xtask ci --quick --base origin/staging on this branch (macOS, staging d4c89211f merged): fmt, brand, quarantine, docs, notes, i18n, windows, clippy and stamp pass. Tests of lcc-engine and lcc-ui-egui: all pass except tests that also fail on plain staging: device_sync::tests::a_shared_collection_brings_photos_files_and_edits_both_ways (environmental on that machine), i18n::tests::translated_catalogs_do_not_use_missing_menu_triangles (the ja.json string for Auto Orient uses ▸) and tests_phone_menus::every_menu_and_its_rows_fit_a_phone_on_its_side. Parity, layers, assets, wasm and deny: pass.

  • The five branches of this batch (this one and its neighbours) were also merged together on current staging and gated as one: fmt, brand, quarantine, docs, notes, i18n, windows, clippy, heif, stamp, parity, layers, assets, wasm and deny pass; the tests fail only where plain staging fails too (device_sync, translated_catalogs_do_not_use_missing_menu_triangles, tests_phone_menus), plus one timing test in io_sched that passes alone.

🤖 Generated with Claude Code

blwfish and others added 2 commits December 2, 2026 07:48
…d the contact sheet command has a row with a real cancel

Problem: export.runPresets and export.contactSheet run the whole job on the calling thread (the CLI, the MCP
server, or the desktop app's UI thread for the control channel). runPresets had a row but no check for a running
background export, which app.runPresets makes (so two exports could write to the same folders at once);
contactSheet had neither a row nor a cancel (`work.run(&mut |_, _| true)`).

Change: both commands now refuse while a top-level `export` row is in flight (`export::ensure_none_running`, backed
by the new `Activity::is_running`; a row being stopped still counts). The contact sheet command runs through
`Prepared::run_with_row`: one row ("Exporting contact sheet") whose cancel flag the run checks before each photo,
so `activity.cancel` stops it with no file written. The commands stay on the calling thread, as every engine
command does: moving them to a worker would change what the CLI and MCP get back, and a window already has the
background forms (`app.runPresets`, `app.contactSheet`). Where the control channel answers on the UI thread the
row's cancel button still can't be clicked until the command returns; `activity.cancel` from another thread
works. Documented in docs/background-tasks.md and the commands' help.

Tests: `the_export_commands_are_refused_while_another_export_runs` (other kinds of task don't block; an export
row, a batch export row and a row already being stopped do; nothing is written; both run once the row ends) and
`a_run_with_a_row_shows_progress_and_a_cancel_stops_it` (the row's kind, label, ✕ and counts while it runs; a
cancel stops it before the next photo and no document is made; the row ends either way). Both fail with the old
behaviour put back (no busy check; `run(&mut |_, _| true)` with no row), and the busy test fails with only the
contactSheet check removed.

Manual: output/more-exports, output/export-presets

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d its commands refuse there

Problem: the run writes every file with the native writer (`export::write_file`), which the web build doesn't have,
yet the File > More Exports item was enabled there (no `cfg(target_arch)` on `enabled`, and `start` ran the work
inline on wasm32): choosing it made every file fail with a file-system error.

Change: `enabled` is false on the web build and `dialog.runPresets` / `app.runPresets` refuse there with a message
saying why, the way the contact sheet, Print and slideshow export items are greyed out (`!cfg!(wasm32)`). Using
the front end's own writer instead (as the web Export does) is a larger change to the shared run and not done here.
This commit also carries the release notes for FX-217 and this change.

Tests: `the_web_build_greys_out_and_refuses_several_presets` (native build on, web build off and both commands
refused, nothing opened or started; `enabled_on` / `run_on` take the build as an argument so the native test can
check the web side). It fails with the web check removed. `cargo check --target wasm32-unknown-unknown -p lcc-engine
-p lcc-ui-egui` passes.

Manual: output/export-presets

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@emmertex
emmertex merged commit dec10ea into emmertex:staging Dec 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants