Repository navigation
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1838 (entries 14 and 15).
In short:
export.runPresetsandexport.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 ruleapp.runPresetsalready 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
Activity::is_runningandexport::ensure_none_running; both commands refuse with the usual "another export is running" message.app.runPresetsandapp.contactSheet. Over the control channel the ✕ can't be clicked until the command returns, butactivity.cancelworks from another thread;docs/background-tasks.mdsays so.dialog.runPresetsandapp.runPresetsalso 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.docs/background-tasks.md; what's new and changelog entries.How it was checked
the_export_commands_are_refused_while_another_export_runsanda_run_with_a_row_shows_progress_and_a_cancel_stops_itfail with the old behaviour put back;the_web_build_greys_out_and_refuses_several_presetsfails with the web check removed.cargo check --target wasm32-unknown-unknown -p lcc-engine -p lcc-ui-eguipasses.Question: see the umbrella (entry 14).
cargo xtask ci --quick --base origin/stagingon this branch (macOS, stagingd4c89211fmerged): 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 plainstaging: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(theja.jsonstring for Auto Orient uses▸) andtests_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
stagingand 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 plainstagingfails too (device_sync,translated_catalogs_do_not_use_missing_menu_triangles,tests_phone_menus), plus one timing test inio_schedthat passes alone.🤖 Generated with Claude Code