You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LRC-LIB-LIBFOLDERS: an "Unfinished moves" window says what the next open found of a move cut short (stacked on #3119) - #2915
Stacked on #3119 (a move cut short is followed at the next open), which is stacked on #2914 (a move writes a record in the library before the first file moves), which is stacked on #1925; chain to main: #1925 → #2914 → #3119 → this PR. Its own commit is 715041137f; the commits below it are #3119's, #2914's and #1925's.
Problem
#3119 makes the next open follow a move that a force-quit or a crash cut short, and records what it found (photos pointed at their files, files that can't be reached now, copies removed, a record that can't be read) in library.info → recoveredMoves, the log and the CLI's stderr. In the app the person sees nothing: photos they had moved simply point somewhere new, or a move they expected to be waiting for a disconnected disk is silently retried at every open.
Change
An "Unfinished moves" window (crates/ui-egui/src/panels/notices.rs) shows once when the library opens, with OK, what following the moves an earlier run cut short came to. The text says, as they apply: how many photos were being moved and that the library now points at where the files are (Edit → Undo moves them back), how many files can't be reached now (a disk not connected?) and that LightCraft looks again at the next open, how many copies were removed from the new place because the original was still where the library has it, and each problem: a record that can't be read, a file now at both places, a sidecar that couldn't follow its file, a library that couldn't follow or save, and a library open without its lock that was left alone. It has its own title and button, apart from "Settings file problem", and comes after the quit prompt and before the settings notices.
Agents:ui.inspect → moveNotice is the text of the window until OK is pressed (button:moveNoticeOk). docs/control-protocol.md says so.
A switch to another library clears it (switch_library), so the text of the library that was left is never shown over the next one.
Translations: the ten strings (the window's title and the seven messages it says, plus the removed-copies message and the unlocked-library sentence) are translated in all 17 catalogs, each with its own name for Find Missing Photos and its own terms for the library and for Undo. docs/whats-new.md and docs/parity-checklist.md are updated.
Format, clippy with -D warnings on the workspace, the UI crate's i18n tests (37) and the tests whose names contain move (85), and the docs checks (Markdown lint, spelling and link checks on the changed docs), all at this head
User-visible change: ran the app and looked at the result (release builds of this draft and its parent, procedural demo photos, a scratch library; see Screenshots).
Tests (crates/ui-egui/src/tests_move_notice.rs, 5 tests, all added here). The ones that need the app failed on a throwaway copy of this head with the thing they are about taken out, and pass here:
A library whose open followed moves shows the notice once; ui.inspect → moveNotice holds the text; the window has its OK; pressing it closes the window and the notice is not handed out again. Failed with the library's result not taken.
The text says what was followed, what waits and what went wrong; removed copies, and a library left alone for want of its lock, are told. The last one failed with the removed-copies line taken out.
A switch to another library clears the notice of the one that was left. Failed with the clearing taken out (the old text was still there).
Nothing is said when nothing was left.
Translated text is not compared with the catalogs in a test, as the repo's own i18n report lists any gap.
An independent read-only review of this head looked for what the window hides or misstates for every state the engine can report, and for placeholders, term and wording problems in all 17 catalogs. Its findings (the notice outliving a library switch, one catalog's word for "library", a missing ui.inspect row, a stale comment) are fixed in this head; the fixed head was not read again.
Screenshots
All shots are release builds at a 1600×1000 point window (2× pixels), drawn with a windowed ui.screenshot on the procedural demo photos, in a scratch library and settings folder; every state was driven through the control channel. "Before" is the parent PR's head built the same way. Before: the head of #2914. "After" is this head.
To get a library that holds a move cut short, I made on disk what a force-quit leaves instead of killing the app mid-move: a scratch library with eight imported photos, then (app closed) two of the files moved to another folder by hand, one file removed (its new folder doesn't exist, as for a disk that isn't connected), one file copied to the new place with the same bytes, one copied there with different bytes, and a record of those five moves written into the library's moves/ folder in the engine's own format ({"version":1,"moves":[[from,to],…]}). The same library and files were then opened by each build.
What the next open says. Before, the open follows the moves (the same findings are in library.info → recoveredMoves: 2 relinked, 1 waiting, 1 copy removed, 1 problem) but the app shows nothing. After, the "Unfinished moves" window says it once, with OK.
Before
After
Not pictured: the other texts (a record that can't be read, a sidecar that couldn't follow, a library that couldn't follow or save, a library open without its lock), and the window in the other 16 languages.
Reviewing files that changed from the base of the PR and between 77c0a6a and 7150411.
Files selected for processing: 74
apps/lightcraft-cli/src/main.rs
apps/lightcraft/src/main.rs
crates/engine/src/activity.rs
crates/engine/src/cmd/browse.rs
crates/engine/src/cmd/convert.rs
crates/engine/src/cmd/library/specs.rs
crates/engine/src/errors.rs
crates/engine/src/lib.rs
crates/engine/src/library.rs
crates/engine/src/move_intent.rs
crates/engine/src/move_job.rs
crates/engine/src/rename.rs
crates/engine/src/rename/fs.rs
crates/engine/src/rename/moves.rs
crates/engine/src/rename/plan.rs
crates/engine/src/sidecar.rs
crates/engine/src/tests.rs
crates/engine/src/tests/move_job.rs
crates/ui-egui/locales/cs-formats.json
crates/ui-egui/locales/cs.json
crates/ui-egui/locales/de-formats.json
crates/ui-egui/locales/de.json
crates/ui-egui/locales/es-formats.json
crates/ui-egui/locales/es.json
crates/ui-egui/locales/fi-formats.json
crates/ui-egui/locales/fi.json
crates/ui-egui/locales/fr-formats.json
crates/ui-egui/locales/fr.json
crates/ui-egui/locales/id-formats.json
crates/ui-egui/locales/id.json
crates/ui-egui/locales/it-formats.json
crates/ui-egui/locales/it.json
crates/ui-egui/locales/ja-formats.json
crates/ui-egui/locales/ja.json
crates/ui-egui/locales/ka-formats.json
crates/ui-egui/locales/ka.json
crates/ui-egui/locales/pl-formats.json
crates/ui-egui/locales/pl.json
crates/ui-egui/locales/pt-br-formats.json
crates/ui-egui/locales/pt-br.json
crates/ui-egui/locales/ru-formats.json
crates/ui-egui/locales/ru.json
crates/ui-egui/locales/sv-formats.json
crates/ui-egui/locales/sv.json
crates/ui-egui/locales/uk-formats.json
crates/ui-egui/locales/uk.json
crates/ui-egui/locales/vi-formats.json
crates/ui-egui/locales/vi.json
crates/ui-egui/locales/zh-hans-formats.json
crates/ui-egui/locales/zh-hans.json
crates/ui-egui/locales/zh-hant-formats.json
crates/ui-egui/locales/zh-hant.json
crates/ui-egui/src/app.rs
crates/ui-egui/src/app/frame.rs
crates/ui-egui/src/control.rs
crates/ui-egui/src/dialogs.rs
crates/ui-egui/src/dialogs/confirm.rs
crates/ui-egui/src/dialogs/import/task.rs
crates/ui-egui/src/dialogs/settings/libraries.rs
crates/ui-egui/src/headless.rs
crates/ui-egui/src/lib.rs
crates/ui-egui/src/menus/run.rs
crates/ui-egui/src/move_task.rs
crates/ui-egui/src/panels/grid.rs
crates/ui-egui/src/panels/left.rs
crates/ui-egui/src/panels/left/folders.rs
crates/ui-egui/src/panels/notices.rs
crates/ui-egui/src/tests.rs
crates/ui-egui/src/tests/folder_drop.rs
crates/ui-egui/src/tests/move_notice.rs
docs/background-tasks.md
docs/control-protocol.md
docs/parity-checklist.md
docs/whats-new.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Walkthrough
This change runs photo moves as background jobs, records move intent for recovery, and processes interrupted moves when a library opens. The engine blocks selected conflicting operations while a move runs. The UI reports move progress, completion, and recovery results.
Photo moves now use a planned job with worker execution and library finalization. The engine tracks active source paths, defers sidecar writes, and refuses operations that conflict with a running move.
The engine records file moves and processes unfinished records when a library opens. Recovery reports relinked, waiting, and problematic moves, with handling that depends on whether the library lock is held.
Folder moves now start and report through a background task. The UI exposes running and last-move state, handles move conflicts in imports, and prompts before quitting during a move.
Recovery notices and localized messages crates/ui-egui/src/panels/notices.rs, crates/ui-egui/src/tests/move_notice.rs, crates/ui-egui/locales/*
The UI displays a dismissible notice for recovered moves. Locale files add move-progress, error, and recovery messages, and remove the prior generic moved-count translation.
sequenceDiagram
participant UI as LightcraftApp
participant Engine as move_job
participant Worker as MoveWork
participant Files as Filesystem
UI->>Engine: Start move with folder and photo IDs
Engine->>Worker: Return planned work and finalizer
Worker->>Files: Record intent and move files
Worker-->>UI: Return move outcome
UI->>Engine: Finish move and update library
Loading
Suggested reviewers:emmertex, aiongg
Merge Risk: Minimal · up to 71504
This change moves photo moves into background jobs, records interrupted moves for recovery on the next library open, and shows an "Unfinished moves" notice. No merge-blocking issue was found in the supplied review or in the checks run. Normal checks apply before merging.
Security architecture risk: Moderate · up to 71504
Durable records and move guards contain normal interruptions, but recovery relies on filenames to establish ownership. After external file changes it can attribute an unrelated file to an unfinished move, and cleanup can interfere with another library transferring into the same folder. These are bounded but meaningful recovery and failure-containment risks.
Retained concerns
Medium · reliability · inferred: Recovery cannot distinguish an arrived photo from an unrelated replacement at the recorded destination. Records contain only source and destination paths. When the source is absent, its parent remains accessible, and the destination is a regular file, recovery relinks the catalog and follows sidecars without checking durable file identity. External deletion or replacement while a record remains pending can therefore cause mistaken file attribution, weakening ownership and subsequent rollback. Initial destination checks and the stronger comparisons used when both paths exist do not establish identity across an interrupted session.
Medium · reliability · inferred: Recovery extends a library-local lock into cleanup authority over a shared destination folder. With the lock held, cleanup removes every partial whose name starts with the destination-specific prefix, including other process IDs. If another library is actively copying the same destination filename, recovery of an older record can unlink that worker's live partial and make placement fail. Exclusive partial creation does not prevent this deletion. Original-file retention and batch rollback limit the consequence, but do not provide isolation between independent libraries.
Security review details
Security Blast Radius
observed — Move authority comes from catalog-selected file paths and a caller-specified existing destination, under the desktop process's filesystem permissions. The planner rejects Local photos and non-file sources, but does not confine destinations to the library directory. Effects therefore include accessible external folders and associated sidecars, not only library metadata.
Trust Boundaries and Controls
observed — Without the library lock, recovery leaves earlier runs' records untouched and reports their unprotected status. Recovery of a failed current worker is scoped to that worker's recorded path. These controls protect library-local ownership, but do not establish exclusive ownership of files in a destination shared by different libraries.
Resilience and Maintainability Implications
observed — The existing cross-volume transfer preserves the original until copying and byte comparison succeed. This limits the live-partial cleanup concern to failed transfer and possible batch rollback rather than demonstrating loss of the original photo. The new recovery cleanup is nevertheless able to interfere with that previously independent transfer.
Hardening Proposals
proposed — Give each move durable operation identity and evidence sufficient to recognize its completed file and owned partials. Ambiguous destination attribution should remain unresolved rather than automatically relinking, and cleanup should require operation ownership or destination-level coordination rather than a library lock and filename prefix alone.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 74.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly identifies the main change: an “Unfinished moves” window that reports recovery findings after an interrupted move. It is specific and related to the pull request objectives.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 74.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 83 functions across 36 files. (38 skipped: 38 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
Clippy (1.99.0)
Clippy execution timed out
Comment @coderabbitai help to get the list of available commands.
Rebased onto #2914 after #2913 (egui 0.37): the "Unfinished moves" window is now one of the prompts that own input (prompt_layer and prompt_key in panels/notices.rs know it, between the quit prompts and the settings-notice queue, and its window(…) call takes the shared notice_input); nothing else beyond the rebase.
Rebased onto #2914's new head (a87f13a5ed); this PR's own commit applied without a conflict (new head 8d46e9294c). Still a draft, waiting on #1925 and then #2914.
…he library or point them at another file
Delete Permanently, Empty Recently Deleted, an import that replaces a trashed photo, Convert to DNG, Find Missing Photos, Locate and a Synchronize relink are refused while the photo they would remove or relink is being moved, with the number of photos in the message. The check is in Session::commit, so every change that removes or relinks a photo is covered; Convert to DNG also checks before it writes a DNG.
The refusals are a new error kind (MoveInProgress) and the app shows them as a toast wherever the command came from; the status line they used to reach isn't drawn. A import batch the move refused says why instead of counting as not readable.
…pen found of a move cut short
The window shows once, with OK, what following the moves an earlier run cut short came to: photos pointed at their files, files that can't be reached now, copies removed, a record that can't be read, a library left alone for want of its lock. `ui.inspect` -> `moveNotice` is its text. Translated in every catalog.
Co-Authored-By: Claude <noreply@anthropic.com>
nledford
changed the title
LRC-LIB-LIBFOLDERS: an "Unfinished moves" window says what the next open found of a move cut short (stacked on #2914)
LRC-LIB-LIBFOLDERS: an "Unfinished moves" window says what the next open found of a move cut short (stacked on #3119)
Oct 29, 2026
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
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.
Stacked on #3119 (a move cut short is followed at the next open), which is stacked on #2914 (a move writes a record in the library before the first file moves), which is stacked on #1925; chain to
main: #1925 → #2914 → #3119 → this PR. Its own commit is715041137f; the commits below it are #3119's, #2914's and #1925's.Problem
#3119 makes the next open follow a move that a force-quit or a crash cut short, and records what it found (photos pointed at their files, files that can't be reached now, copies removed, a record that can't be read) in
library.info→recoveredMoves, the log and the CLI's stderr. In the app the person sees nothing: photos they had moved simply point somewhere new, or a move they expected to be waiting for a disconnected disk is silently retried at every open.Change
An "Unfinished moves" window (
crates/ui-egui/src/panels/notices.rs) shows once when the library opens, with OK, what following the moves an earlier run cut short came to. The text says, as they apply: how many photos were being moved and that the library now points at where the files are (Edit → Undo moves them back), how many files can't be reached now (a disk not connected?) and that LightCraft looks again at the next open, how many copies were removed from the new place because the original was still where the library has it, and each problem: a record that can't be read, a file now at both places, a sidecar that couldn't follow its file, a library that couldn't follow or save, and a library open without its lock that was left alone. It has its own title and button, apart from "Settings file problem", and comes after the quit prompt and before the settings notices.Agents:
ui.inspect→moveNoticeis the text of the window until OK is pressed (button:moveNoticeOk).docs/control-protocol.mdsays so.A switch to another library clears it (
switch_library), so the text of the library that was left is never shown over the next one.Translations: the ten strings (the window's title and the seven messages it says, plus the removed-copies message and the unlocked-library sentence) are translated in all 17 catalogs, each with its own name for Find Missing Photos and its own terms for the library and for Undo.
docs/whats-new.mdanddocs/parity-checklist.mdare updated.Not in this PR:
How it was checked
f86ceeeaef, which is on the new layout (files moved and split; each hunk went to the file that now holds its code), conflicts in the docs resolved by hand, and what the move left unresolved (paths, visibility,modanduselines) fixed so it builds. At715041137f: the workspace builds with its tests (cargo check), clippy with-D warningsis clean (with the one-line macOS fix of MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973 applied uncommitted and never committed), and I ran the engine'smove_jobtests (35 passed, 0 failed) and the app'smove_noticetests (5 passed, 0 failed). The fullcargo xtask ciis the hosted gate's run on this head; the older runs below are of the version before the move.panels/notices.rs(the quit prompt's new functions andrecovered_textkept side by side), the rest identical to the old commit. At715041137f: clippy with-D warningsclean (the onenative_menu.rsclippy error ofmainaside) and the PR's own tests pass.Review: a fresh read-only reviewer at
715041137f(28 Oct), comparing the ported diff with the old one hunk by hunk: no blocking finding.cargo xtask ciat715041137f(run on this Mac with MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973's one-file clippy fix applied uncommitted, then reverted): all 8 steps passed (fmt, clippy, heif, test, parity, layers, assets, wasm); the test step ran 5,292 tests, 0 failed, 42 ignored.-D warningson the workspace, the UI crate'si18ntests (37) and the tests whose names containmove(85), and the docs checks (Markdown lint, spelling and link checks on the changed docs), all at this headTests (
crates/ui-egui/src/tests_move_notice.rs, 5 tests, all added here). The ones that need the app failed on a throwaway copy of this head with the thing they are about taken out, and pass here:ui.inspect→moveNoticeholds the text; the window has its OK; pressing it closes the window and the notice is not handed out again. Failed with the library's result not taken.Translated text is not compared with the catalogs in a test, as the repo's own i18n report lists any gap.
An independent read-only review of this head looked for what the window hides or misstates for every state the engine can report, and for placeholders, term and wording problems in all 17 catalogs. Its findings (the notice outliving a library switch, one catalog's word for "library", a missing
ui.inspectrow, a stale comment) are fixed in this head; the fixed head was not read again.Screenshots
All shots are release builds at a 1600×1000 point window (2× pixels), drawn with a windowed
ui.screenshoton the procedural demo photos, in a scratch library and settings folder; every state was driven through the control channel. "Before" is the parent PR's head built the same way. Before: the head of #2914. "After" is this head.To get a library that holds a move cut short, I made on disk what a force-quit leaves instead of killing the app mid-move: a scratch library with eight imported photos, then (app closed) two of the files moved to another folder by hand, one file removed (its new folder doesn't exist, as for a disk that isn't connected), one file copied to the new place with the same bytes, one copied there with different bytes, and a record of those five moves written into the library's
moves/folder in the engine's own format ({"version":1,"moves":[[from,to],…]}). The same library and files were then opened by each build.What the next open says. Before, the open follows the moves (the same findings are in
library.info→recoveredMoves: 2 relinked, 1 waiting, 1 copy removed, 1 problem) but the app shows nothing. After, the "Unfinished moves" window says it once, with OK.Not pictured: the other texts (a record that can't be read, a sidecar that couldn't follow, a library that couldn't follow or save, a library open without its lock), and the window in the other 16 languages.
Merging
notices.rs,lib.rs,control.rsandsettings.rsmerge cleanly with them and with LR-BEHAV-BG-TASKS: a preview build asked for while another runs can wait in line for it (engine) #2806.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none. No new crate inCargo.lock.Checklist
tr()/tr_format!with keys in allcrates/ui-egui/locales/*.json; no new shortcutdocs/parity-checklist.mdare updated (nodocs/gaps.mdentry covered this)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes