LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Merge PR #2327: #2312: culling goes on from a photo rated out of the view
francoisgn4e75723da561
diff --cc crates/engine/src/cmd/library.rsindex cf9d8ef9a,20f3560ae..b6658b34b--- a/crates/engine/src/cmd/library.rs+++ b/crates/engine/src/cmd/library.rs@@@ -801,18 -869,14 +865,18 @@@ pub fn specs() -> Vec<CommandSpec>"Set Color Label",["Photo", "Set Color Label"],None,- "{label: red|yellow|green|blue|purple|none, ids?}",+ "{label: red|yellow|green|blue|purple|none, ids?, advance?: bool} — without `ids`, the selection moves on when this takes the active photo out of the view",has_selection,|s, p| {- let l = match str_param(p, "label") {- None | Some("none") => None,- Some(x) => Some(ColorLabel::parse(x).ok_or_else(|| bad("photo.label", "unknown label"))?),+ // `none` (or null) clears; a missing label or one that isn't text is an error, not a clear+ let l = match p.get("label") {+ Some(Value::Null) => None,+ Some(Value::String(x)) if x == "none" => None,+ Some(Value::String(x)) => Some(ColorLabel::parse(x).ok_or_else(|| bad("photo.label", "unknown label"))?),+ None => return Err(bad("photo.label", "missing `label` (red|yellow|green|blue|purple|none)")),+ Some(_) => return Err(bad("photo.label", "label must be red|yellow|green|blue|purple|none")),};- for_targets(s, p, "Set Color Label", |id| Some(Op::SetLabel { id, label: l }))+ cull(s, p, |s| for_targets(s, p, "Set Color Label", |id| Some(Op::SetLabel { id, label: l })))}),// ---- orientationdiff --cc docs/parity-checklist.mdindex 1994e2ee9,c7ee4f53b..dbff885d8--- a/docs/parity-checklist.md+++ b/docs/parity-checklist.md@@@ -100,8 -102,8 +100,10 @@@ differences and missing bindings are i| LR-LIB-SHARED-ALBUM | Shared albums | P2 | ⬜ | | needs a sharing service || LR-LIB-OFFLINE | Keep album offline | P2 | 🚫 | | not applicable: local-first library || LR-LIB-TARGET | Target album | P2 | ✅ | `cmd:album.setTarget`, `cmd:album.toggleTarget` | see LRC-LIB-COLLECTIONS |+| LR-LIB-RATING | Star ratings | P0 | ✅ | `cmd:photo.rate` (`advance`), `cmd:photo.decreaseRating`, `cmd:photo.increaseRating`, `crates/ui-egui/src/shortcuts.rs`, `crates/ui-egui/src/rating.rs` | one shared star row in the bottom bar, Info panel and filter bar (hover previews, ←/→ on a focused star) and one painter for badges (grid cells, filmstrip, Compare caption); menu rows with star text (Photo ▸ Set Rating, Select By Rating, the grid context menu) are separate menu items, unchanged; 0 clears; 1–5 set; Shift+0–5 applies and advances once, including with Auto Advance. Default grid brackets adjust each photo by one, clamped to 0–5; one batch undo and AutoWrite. Batch grid and undo/redo regressions; macOS native ownership corrected (PR #261) |+| LR-LIB-FLAG | Pick / reject flags | P0 | ✅ | `cmd:photo.pick`, `cmd:photo.reject`, `cmd:photo.unflag`, `cmd:photo.flag` | P pick, X reject, U clear; Shift+P picks and advances in both grids (Presets elsewhere); Shift+X/U and legacy Shift+Z advance; no flag cycle; rejection does not delete the file; a pick shows as a filled flag on thumbnails, in Compare, in the loupe and on the Pick button, a reject outlined (#1013) |+ | LR-LIB-RATING | Star ratings | P0 | ✅ | `cmd:photo.rate` (`advance`), `cmd:photo.decreaseRating`, `cmd:photo.increaseRating`, `crates/ui-egui/src/shortcuts.rs` | 0 clears; 1–5 set; Shift+0–5 applies and advances once, including with Auto Advance. A rating, flag or label that takes the active photo out of the view (filter bar, Picks, smart album) makes the photo after it active (the one before at the end), and Shift / Auto Advance doesn't step past it (#2312). Default grid brackets adjust each photo by one, clamped to 0–5; one batch undo and AutoWrite. Batch grid and undo/redo regressions; macOS native ownership corrected (PR #261) |+ | LR-LIB-FLAG | Pick / reject flags | P0 | ✅ | `cmd:photo.pick`, `cmd:photo.reject`, `cmd:photo.unflag`, `cmd:photo.flag` | P pick, X reject, U clear; Shift+P picks and advances in both grids (Presets elsewhere); Shift+X/U and legacy Shift+Z advance; no flag cycle; rejection does not delete the file || LR-LIB-LABEL | Colour labels | P1 | ✅ | `cmd:photo.label`, `cmd:label.setNames`, `cmd:label.names`, `cmd:dialog.labelNames`, keys 6–9 in `crates/ui-egui/src/shortcuts.rs` | Photo menu and grid context menu (coloured, named), Info-panel swatches, label dot plus translucent colour on square-grid/filmstrip surrounds and photo-grid footers (photo pixels unchanged); colour-label toasts have pale matching backgrounds; setting/clearing through keys (including Shift), menus or Info swatches shows the same bottom toast as ratings, with the colour/custom name; editable label names (undoable, journaled); no purple key (as in Lightroom), no custom extra labels || LR-LIB-KEYWORD | Keywords | P0 | ✅ | `cmd:panel.keywords`, `cmd:photo.setMeta` (`addKeywords`/`removeKeywords`), `cmd:keyword.list`, `cmd:keyword.rename`, `cmd:keyword.delete`, `cmd:keyword.merge`, `cmd:keyword.suggest`, `crates/catalog/src/keywords.rs`, `crates/ui-egui/src/panels/left.rs` | left-panel keyword tree with counts (click filters, children included; context menu rename / merge / delete / add / remove); library-wide ops are one undo step and replay from the op log; suggestions (co-occurring / most used / completions) in the Keywords panel; keywords reorganize by drag and drop in the Keyword List (LRC-LIB-KEYWORDS) || LR-LIB-PEOPLE | People / faces | P2 | 🟡 | `cmd:faces.detect`, `cmd:view.people`, `cmd:view.faceBoxes`, `cmd:photo.removeRegion`, `cmd:photo.setRegion`, `cmd:library.filter`, `crates/ui-egui/src/panels/people.rs`, `crates/catalog/src/query.rs` (`people`), `crates/engine/src/media.rs` (`face_job`), `crates/meta/src/xmp.rs` | MVP: named face regions read from XMP (MWG-RS, read-only, see `docs/xmp-interop.md`; clipped to the photo; Lightroom's `Rotation` of ±π/2 and π handled, mirrored orientations taken as written; boxes follow Rotate Left/Right and flips; a sidecar stating `mwg-rs:Regions`, even empty, replaces the photo's on re-read, one without leaves them) become cards in the People view (View ▸ People, or the People button in the toolbar): a close-up of the person's largest face, name and photo count; a click filters the grid (`person` in `library.filter`, `person:` search token, filter chip). Face boxes in the loupe can be switched off (View ▸ Face Boxes, toolbar) resized with eight drag handles and removed with the × shown on hover (catalog-only and undoable, one undo step per drag; the sidecar is never rewritten for either); no moving a box by dragging it yet. Photo ▸ Detect Faces (`cmd:faces.detect`) finds faces with the YuNet detector (pure Rust, about 200 ms a photo, matches OpenCV's own YuNet on a 45-photo test set; the 232 KB model is a one-time download offered in the same step, never part of LightCraft) and adds them as unnamed boxes; names are suggested from the faces already named (recognition models are opt-in downloads, run on the CPU in a background thread; a face is named only when you confirm it); a person's page shows their cropped faces and the unnamed faces that look like them (LRC-LIB-PEOPLE), with a user-triggered ↑ action or targeted A key to name all shown suggestions at or above one score in one undo step; with recognition on, a background scan finds faces in photos that have none and embeds every face (one to three worker threads, raws through their embedded preview); an Unnamed faces section orders faces by likeness and names a selected group at once; no separated clusters, no manual tagging, no writing regions back |@@@ -801,22 -797,7 +803,23 @@@ Latin stays upright. Advanced Japanese| Date | Change | Summary ||---|---|---|+| 2026-10-22 | minor | LR-VIEW-INFOOVERLAY: the info overlay shows the star rating and flag, and in the full-screen preview on macOS it starts below the window controls (issue #2460); status unchanged |+| 2026-10-21 | patch | LR-IMP-ADD-DIALOG: reconcile #2362 with current main; deleted-album guard and hierarchical picker retained; counts unchanged |+| 2026-10-20 | minor | LR-IMP-ADD-DIALOG: #2362 gives the import review the shared hierarchy/search album picker while retaining None/New album and existing destination IDs; status and feature counts unchanged |+| 2026-10-21 | patch | KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the slider's row; leaving it (even between two frames) or Tab focus alone does not arm them (issue #1355); status unchanged |+| 2026-10-21 | minor | KEYC-PANELS: F8 shows / hides the right panel (`view.rightPanel`), with F6 / F7 already bound; ⬜ → 🟡 |+| 2026-10-20 | minor | LR-PRE-PANEL: the preset applied to a photo is marked again (with its Amount slider) on returning to the photo, until the photo is edited further (#2392); status unchanged (✅) |+| 2026-10-20 | minor | LR-MASK-OVERLAY: creating, picking, duplicating or adding to a mask shows the overlay a mask slider hid (#1800); status unchanged (✅) |+| 2026-10-20 | patch | LRC-LIB-COMPARE, LR-VIEW-SURVEY: in Compare and Survey the Info panel's stars and colour labels and the Set Color Label menu act on the active photo only (they labelled the whole selection), and the panes show the colour label (#2398); statuses unchanged |+| 2026-10-20 | patch | LR-VIEW-ZOOM: the 20 ms rule clears a slow-drag verdict only on a drag timed at full size; a drag that drafts small leaves it unchanged, as the code does; status unchanged |+| 2026-10-19 | patch | LR-CROP-RECT: on a straightened photo a moved crop slides along the tilted edges, so a box that fills the photo's height reaches its sides (#2299); status unchanged |+| 2026-10-19 | patch | LR-VIEW-ZOOM: the slow slider-drag verdict is described as per photo and control, as the code keys it; status unchanged |+| 2026-10-18 | patch | LR-META-XMP: Lightroom's profile and version bookkeeping (`CompatibleVersion`, profile digests, lens profile identity, `CropConstrainToUnitSquare`, default-strength lens profile scales) is no longer reported as unimported XMP; status unchanged (✅) |+| 2026-10-15 | minor | LR-VIEW-ZOOM: a slow slider-drag verdict needs two drags over 20 ms and expires after 30 s (doubling to 240 s); hidden-window frame times are ignored; the slow set forgets its oldest entry, not all (issue #330); status unchanged |+| 2026-10-15 | minor | LR-BEHAV-BG-TASKS: Reload from Disk reads its files on a worker thread with a cancellable activity row instead of freezing the window on a selection of raws; its result is committed through the command wrapper (XMP sidecars auto-written as before) and an older reload finishing late no longer overwrites a newer one; status unchanged (✅) |+| 2026-10-19 | patch | LR-LIB-STACK: the filmstrip's stack badge expands / collapses the stack like the grid's, and a badge click works on a stack that isn't selected (it is selected first). Statuses and feature counts unchanged. |+| 2026-10-14 | minor | LR-VIEW-ZOOM: Visualize Spots, Point Color range and Visualize HDR render zoom windows; LRC-DEV-SOFTPROOF: output-space proofs on the GPU |+ | 2026-10-19 | patch | LR-LIB-RATING: a rating, flag or label that takes the active photo out of the view makes the photo after it active instead of leaving an unseen photo active (→ then went to the view's first photo), and Shift / Auto Advance doesn't step past it (#2312); status unchanged (✅) || 2026-10-14 | patch | LR-EXP-TYPE: opaque 8-bit PNG/TIFF/WebP use RGB; transparent exports retain alpha (#1670). Statuses and feature counts unchanged. || 2026-10-15 | minor | LRC-PRINT-PAGE: Page Options (Page Numbers, Page Info, Crop Marks) on Single Image and Contact Sheet pages, in the Print dialog, `print.set` and templates; still 🟡 (no identity plate, watermark, photo info or Cut Guides) || 2026-10-15 | minor | LR-IMP-FORMATS: Hasselblad 3FR and FFF show their uncompressed RGB preview (no JPEG in these files) in the grid and loupe until developed, and as the stand-in when a file fails to decode; status unchanged (🟡) |diff --cc docs/whats-new.mdindex 572ba8114,d08d1eade..4cba05560--- a/docs/whats-new.md+++ b/docs/whats-new.md@@@ -1,180 -1,13 +1,188 @@@# What's new in LightCraft+## 2026-10-21++### Settings window+- Settings is one size on every tab and stays where it is as you go through them; before, each tab made its own+ size and the tabs moved under the pointer. The tabs stay in place while a long page scrolls (in a very short+ LightCraft window, where the page has too little room to scroll by itself, the tabs and the page scroll together), a+ page that goes on below shows a scroll handle without the pointer on it, and each page remembers where it was+ scrolled to, also when Settings is closed and opened again.+- Nothing in Settings runs off the side any more. A row with more choices than fit (the languages on General) wraps+ onto further lines and a long label wraps in its column, where both used to widen the window: in a small+ LightCraft window the labels and the Close button of General ended up off screen.+- The Slideshow tab is one column like the other tabs, with the slide preview first, instead of a column beside the+ preview that made Settings much wider on that tab. The preview stays above the page while it scrolls, so pointing+ at a template further down still shows it there (in a very short window it scrolls with the page instead). Pointing+ at a template no longer pushes its rows out from under the pointer, and the Export buttons wrap.+- A long folder (General ▸ Library ▸ Location, the folder Auto Import watches, the smart previews folder, a monitor+ profile's file) is shortened to its last folders ("…/Pictures/Library") on one line; rest the pointer on it for+ the whole path.+### One star rating control+- The stars in the bottom bar, the Info panel and the filter bar are now one shared control, and the badges on grid+ cells, filmstrip thumbnails and the Compare caption use the same drawing. Hovering a star in the filter bar now+ previews the rating like the others do, and with a star focused (Tab), ← and → lower and raise the rating.+### Progress looks the same everywhere+- Download, scan, denoise and activity progress now use one bar that fills the width it is given, with its text on+ it, and a gentle sweep while the amount of work isn't known yet. Waits that only said "Selecting…", "Waiting to+ start…" or "Installing…" now show a small turning arc beside the text, and a thumbnail still being made shows a+ quiet placeholder that fits the theme in the grid, the filmstrip and Compare. Screen readers hear a progress+ indicator with its percentage.+### Menu names that say what they are+- Switches in the menus are named for what they show, with the check mark saying whether it is on: Filmstrip ✓,+ Focus Point ✓, Clipping ✓, Photo Counts ✓, Mask Overlay ✓ instead of Show Focus Point ✓. No two commands share a+ name any more: View ▸ Detail is now Detail View (the Edit section Detail keeps its name), Window ▸ Edit is Edit+ Panel, and Compare Before and After is Before/After Side by Side, next to Split and Top/Bottom.+- The preview cache command has one name, Discard Preview Cache, in File ▸ Previews and in the toast that confirms+ it. Keyboard shortcuts are unchanged.++### Sharper resampling in HDR and panorama merges+- Merged photos (HDR and panorama) are resampled with a sharper filter (Lanczos-3 instead of bilinear). Moving a+ photo by half a pixel used to lose a third of its finest detail; now it keeps most of it, without halos around+ hard edges such as clipped highlights.++### Scrolling past editing sliders+- Leaving a selected slider disarms its vertical mouse-wheel adjustment (issue #1355), even when the pointer leaves+ and comes back between two screen updates. Scrolling back over it now scrolls the panel instead of unexpectedly+ changing the photo. Click or drag the slider again to adjust it with the vertical wheel; keyboard arrow+ adjustments and an ongoing drag still work. A slider reached with Tab takes the arrow keys but not the wheel:+ click it to scroll-adjust it. Sideways scrolling still adjusts the slider under the pointer without selecting it+ first.++### A pinch no longer re-renders the photo at every zoom step+- Pinching the loupe now keeps the size the fit view is rendered at until the gesture is quiet, as it already did for+ the render sizes and windows. Before, each frame of a pinch asked for a new full-frame render at a new size.++### Fujifilm lens corrections that match the camera+- X-T4 raws now read the lens's own distortion and vignetting tables the way the camera does. Many photos from zoom+ lenses got no distortion correction at all (more than half of those checked from the XF16-55 and XF70-300), and+ corners came out up to 6.5 % brighter than in the camera's JPEG. The corrected photo now lines up with the camera's+ framing. Other recent Fujifilm bodies whose tables have nine knots are read the same way, but only the X-T4 was+ measured. Thumbnails are redrawn when the library next shows them.++### Reference view reliability+- Escape now leaves Reference for Detail without changing the active photo or its edits; the next+ Escape returns to the grid. A dialog, tool or Lights Out still handles Escape first.+- Opening or creating a different library clears the pinned reference. Photo IDs belong to one+ catalog; a pin no longer silently becomes another library's photo with the same numeric ID.+- Missing or Recently Deleted photos cannot be pinned. Deleting the pinned reference stops drawing+ it; re-entering Reference chooses a live photo, and restoring the deleted photo makes it pinnable again.+ In Recently Deleted, Set as Reference Photo is greyed out, and a refusal says to restore the photo.+- Switching library from Reference view goes to the grid instead of an empty Reference canvas. A refused+ or failed switch keeps both the reference and the Compare pair.+- `photo.setReference` refuses an `id` that is not a photo id (a string, a negative or fractional+ number) instead of pinning the active photo; only an absent or null `id` means the active photo.++## 2026-10-20++### Smart albums check File Path rules faster+- A smart album rule on File Path (contains, doesn't contain, is, isn't, starts with, ends with, is empty, isn't+ empty) no longer builds new text for every photo. On a synthetic library of 312,000 photos, a File Path "contains"+ or "doesn't contain" rule took about 17 ms per pass instead of about 62 ms, around 3.5 times faster, with the same+ photos matched; about 6 ms of that is only reading the paths. Paths and rule text with letters beyond A–Z are+ compared as before.++## 2026-10-19++### AI Denoise on DirectX 12 with NVIDIA GTX 10-series cards+- AI Denoise on the GPU under DirectX 12 (the Windows default) gives the same result as on the CPU again on an NVIDIA+ GeForce GTX 1070. The driver ran the denoise network's output stores wrong, so every second pixel's colour+ channels came out shifted and the denoised photo was wrong without any error. Vulkan was not affected.++### The Before label stays in view when zoomed in+- Zoomed in, the "Before" label (\ key or the Before view) now sits at the canvas' corner instead of leaving the+ screen with the photo's corner (issue #2267).++### Synchronize Folder on a folder that is up to date+- When the scan finds nothing to import, relink, remove or read, the Synchronize Folder dialog says the library is up+ to date with the folder and has one Close button. It used to show four greyed choices, two of them still ticked,+ and a Synchronize button that started a job with nothing to do. Files it skipped (already in the library elsewhere,+ or unreadable) are still listed.+++### Hidden Local locations come back one at a time+- With several locations removed from Local, "Show N hidden locations" now lists them, so each comes back on its own+ (Restore All is there too). The row used to bring every hidden location back at once (issue #2114).++## 2026-10-18++### Thumbnails of Lightroom HDR and panorama merges in a second+- Grid and filmstrip thumbnails of DNGs that Lightroom merged (HDR, Panorama, HDR Panorama) now develop from the+ small copies of the raw image Lightroom keeps inside the file (256 to 2048 px), not from the whole merge. A 23836 ×+ 7078 drone panorama's 512 px thumbnail took 38 s and now takes about a second, with the same look; your edits still+ apply. Loupe previews larger than the biggest copy, 1:1 views and exports still read the full image.++### Fewer false "not imported" warnings for Lightroom raws+- Importing raws with Lightroom XMP sidecars no longer lists settings Lightroom writes only for itself as adjustments+ that weren't imported: `CompatibleVersion`, the camera and lens profile checksums, the lens profile's name, file and+ setup, the crop's "constrain to image" option, and the lens profile's strength when it is at its default of 100 %.+ A raw sidecar used to name all of them for every photo. Settings LightCraft really doesn't apply, such as `Look`,+ are still reported.+++### Fill Location from GPS: no more neighbouring town in City+- The offline place names list towns of 15,000 people or more, so a photo taken in a smaller one got the nearest larger+ town in City, sometimes another municipality (issue #2242). The Fill Location tooltip and the command help now say so,+ and `metadata.reverseGeocode` takes `maxDistance` (metres): past it, City stays empty (State and Country still fill)+ and the reply names the town it found as `nearestCity`.++### A preset that couldn't be saved is no longer lost silently+- When presets.json can't be written (a full disk, or the browser's storage quota), the new or changed preset now+ counts as unsaved, like other changes: the top bar warns, saving is retried, and quitting asks first (issue #2266).+ Before, the failure was only logged, and the preset could be lost without any warning.++### Portrait crop ratios stay portrait+- A crop ratio no longer flips to the photo's orientation (issue #2253): after X turns the crop portrait, picking+ another ratio (4 × 5, 2 × 3…) keeps it portrait, as in Lightroom, and a Custom ratio taller than wide gives a+ portrait crop.++## 2026-10-16++### Synchronize Folder shows that it is listing the folder+- A folder with tens of thousands of photos, above all on a network share, can take minutes to list before+ Synchronize Folder checks a single photo. Its row in the activity stack used to sit at "0 of 64085" with an empty+ bar all that time, as if it had stopped. It now says how many folders and files it has listed so far, with a bar+ that moves on its own, and then counts the photos it checks. The dialog says the same.+- ✕ on the row stops the listing too, not only the checks after it.++### The photo grid keeps up with imports into a large library+- While photos are imported into a large library, the grid takes in each batch as it arrives instead of reading+ every photo of the view again: at about 180,000 photos a batch cost the window a tenth of a second, over and over+ for as long as the import ran. Changing one photo's capture time or crop is quicker too.++## 2026-10-15++### Photo Merge takes each photo once+- A merge that names the same photo more than once (through `ids` on the control channel, MCP or the CLI) now merges+ it once (issue #1947). Naming one photo three times no longer "merges" it with itself, and a long repeated list no+ longer decodes the photo again for every entry.++### Constrain Crop tightens the crop you see+- Geometry ▸ Constrain Crop now changes the crop itself, as in Lightroom (issue #1927). Ticking it, or moving a+ Geometry slider, Upright or a lens correction while it is ticked, shrinks the crop about its centre until the blank+ corners left by the correction are gone, and the Crop tool shows the tighter crop. Before, it only applied when the+ photo was shown outside the Crop tool, so in the Crop panel, where the checkbox is, nothing seemed to change. A crop+ you draw by hand is kept as drawn, and unticking keeps the tighter crop.++### Web: no backup that misses unsaved changes+- In the browser version, File ▸ Back Up Library… no longer reports success while a save is failing (storage full or+ cleared): the backup copies the stored library, so it left out the changes that couldn't be saved (issue #1508). It+ now refuses to start and says how many changes are unsaved and why. LightCraft retries the save with every change;+ back up once nothing is left unsaved.++### Web: an unreadable library is not opened+- In the browser version, a library file that exists but can't be read at start-up is no longer taken for a missing+ one (issue #1507). LightCraft used to open the library without it, showing an incomplete catalog that the next save+ would write over the stored copy. It now leaves the library unopened, saves nothing and says which file couldn't be+ read; reload the page to try again.+ ## 2026-10-19++ ### Rating in a filtered view keeps your place+ - When a filter shows only one-star photos and you take the star off a photo, it leaves the view and the photo after+ it is now selected, so you carry on from where you were (issue #2312). The same goes for flags and colour labels,+ in Picks and in smart albums. Before, the photo stayed selected although the grid no longer showed it, and → or+ Auto Advance jumped back to the first photo of the view. With Auto Advance on, or with Shift+0–5, you land on the+ photo after it: no photo is skipped.## 2026-10-14