Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

M1: merge upstream main and resolve documentation conflicts

Hanmoa47afdc1f482
diff --cc crates/ui-egui/locales/zh-hans.json
index 9f1c62624,2090461a4..15477ae12
--- a/crates/ui-egui/locales/zh-hans.json
+++ b/crates/ui-egui/locales/zh-hans.json
@@@ -147,8 -187,9 +187,10 @@@
"Cloudy": "阴天",
"Collapse All Stacks": "折叠所有堆叠",
"Color": "颜色",
+ "Color label cleared": "已清除颜色标签",
"Color Grading": "颜色分级",
+ "Color Label Names": "颜色标签名称",
+ "Color Label Sets": "颜色标签集",
"Color Mixer": "颜色混合器",
"Color Noise Reduction": "颜色降噪",
"Color Priority": "颜色优先",
diff --cc crates/ui-egui/src/tests_labels.rs
index 8a24b9884,000000000..9325ab77e
mode 100644,000000..100644
--- a/crates/ui-egui/src/tests_labels.rs
+++ b/crates/ui-egui/src/tests_labels.rs
@@@ -1,80 -1,0 +1,85 @@@
+//! Rendered regressions: label colour belongs on thumbnail chrome and the label HUD, not pixels.
+
+use std::time::Duration;
+
+use egui::{Color32, ColorImage, Pos2};
+use lightcraft_catalog::{Op, Photo, PhotoId, Source};
+use serde_json::json;
+
+use crate::headless::Headless;
+use crate::state::ViewMode;
+use crate::{LightcraftApp, Services};
+
++const SETTLE: Duration = Duration::from_secs(120);
++
+fn app(view: ViewMode) -> Headless {
+ let mut s = lightcraft_engine::Session::new();
+ for id in 1..=6 {
+ let p = Photo::new(PhotoId(id), Source::Demo { scene: 1 }, &format!("{id}.jpg"), "JPEG", 640, 480, "2026-10-08");
+ s.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap();
+ }
+ s.execute("library.sort", &json!({"key": "fileName", "ascending": true, "group": "none"})).unwrap();
+ s.execute("library.select", &json!({"ids": [1]})).unwrap();
+ let mut h = Headless::new(LightcraftApp::new(s, Services { png: None, ..Default::default() }), [1200.0, 800.0], 1.0);
+ h.app.ui.view = view;
+ h.app.ui.right = crate::state::RightPanel::None;
+ h.app.ui.thumb_size = 160.0;
- assert!(h.settle(Duration::from_secs(30)));
++ // Parallel UI tests can leave a quiet spell before thumbnail jobs complete. Require the
++ // fixture's real textures before comparing photo pixels, as well as settled layout.
++ assert!(h.step_until(SETTLE, |h| h.app.renderer.thumb_textures() == 6), "all fixture thumbnails must be ready");
++ assert!(h.settle(SETTLE), "label fixture did not settle");
+ h
+}
+
+fn rect(h: &Headless, id: &str) -> egui::Rect {
+ h.app.widgets.iter().find(|(w, _)| w == id).unwrap().1
+}
+
+fn pixel(image: &ColorImage, p: Pos2) -> Color32 {
+ image.pixels[p.y as usize * image.size[0] + p.x as usize]
+}
+
+#[test]
+fn label_tints_grid_and_filmstrip_chrome_without_changing_photo_pixels() {
+ for view in [ViewMode::SquareGrid, ViewMode::PhotoGrid, ViewMode::Detail] {
+ let mut h = app(view);
+ let widget = if view == ViewMode::Detail { "film:1" } else { "thumb:1" };
+ let cell = rect(&h, widget);
+ let sample = if view == ViewMode::PhotoGrid {
+ egui::pos2(cell.right() - 40.0, cell.bottom() - 8.0)
+ } else {
+ egui::pos2(cell.left() + 4.0, cell.center().y)
+ };
+ let neutral = h.paint();
+ let centre = pixel(&neutral, cell.center());
+ let mut colours = Vec::new();
+ for label in ["red", "yellow", "green", "blue", "purple"] {
+ h.app.run("photo.label", json!({"label": label})).unwrap();
+ h.app.ui.toast = None;
+ h.step();
+ let image = h.paint();
+ let c = pixel(&image, sample);
+ assert_ne!(c, pixel(&neutral, sample), "{view:?} {label} must tint the thumbnail surround/footer");
+ assert!(!colours.contains(&c), "each label has a distinct tint: {view:?} {label}");
+ colours.push(c);
+ assert_eq!(pixel(&image, cell.center()), centre, "{view:?} {label} must not tint image pixels");
+ }
+ h.app.run("photo.label", json!({"label": "none"})).unwrap();
+ h.app.ui.toast = None;
+ h.step();
+ assert_eq!(pixel(&h.paint(), sample), pixel(&neutral, sample), "clearing restores neutral chrome");
+ }
+}
+
+#[test]
+fn label_toast_has_pale_colour_and_rating_restores_neutral_style() {
+ let mut h = app(ViewMode::SquareGrid);
+ h.app.run("photo.label", json!({"label": "red"})).unwrap();
+ h.step();
+ let at = egui::pos2(h.app.canvas_rect.unwrap().center().x, h.app.canvas_rect.unwrap().bottom() - 45.0);
+ let red = pixel(&h.paint(), at);
+ assert!(red.r() > 180 && red.r() > red.g() && red.r() > red.b(), "pale red toast: {red:?}");
+ h.request("ui.key", json!({"key": "5"}), Duration::from_secs(20));
+ let rating = pixel(&h.paint(), at);
+ assert!(rating.r() < 80 && rating.r() == rating.g() && rating.g() == rating.b(), "neutral rating toast: {rating:?}");
+}
diff --cc docs/parity.md
index 47f805c5a,d5a31ea9c..25a916859
--- a/docs/parity.md
+++ b/docs/parity.md
@@@ -59,14 -59,8 +59,14 @@@ Ordered by user impact, then tier, the
that decide whether a photographer can switch (see the honest assessment in [ROADMAP.md](../ROADMAP.md#where-we-stand)).
Take the first one nobody is working on.
+Library culling keys now cover ratings, labels and flags with Shift-to-advance (see
+[library shortcuts](library-shortcuts.md), issue #283 and PR #261). Colour labels also tint thumbnail
+surrounds/footers and use matching pale confirmations, with rendered regressions for all five colours.
+**KEYC-RATING** remains partial:
+rating-step keys, flag cycling and filter-bar bindings are still open; Shift+P is contextual.
+
- 1. **LR-PROF-CAMERACOLOR** (P0): our own camera colour calibration. Sony ARW and Nikon NEF now get a guarded file-local fit to their own embedded JPEG (colour matrix + hue/saturation/value table + tone and chroma curves, relative WB; per-model profiles pooled from many photos via `lightcraft-cli calibrate`; ARW: 7 of 10 public samples accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples from 6 bodies accepted, ΔE 13–46 → 3–8, one mixed-light scene 13 → 12); measured calibration and fidelity remain missing. Other non-DNG raws and rejected fits still use a neutral matrix. Expand validated preview fitting and use matrices the files carry themselves; never Adobe data.
- 2. **LR-IMP-FORMATS** (P0): **CR3** first (every Canon body since ~2018), then compressed RAF / ORF, RW2 v4, Nikon
+ 1. **LR-PROF-CAMERACOLOR** (P0): our own camera colour calibration. Sony ARW, Nikon NEF and Panasonic RW2 now get a guarded file-local fit to their own embedded JPEG (colour matrix + hue/saturation/value table + tone and chroma curves, relative WB; per-model profiles pooled from many photos via `lightcraft-cli calibrate` for ARW and NEF; ARW: 7 of 10 public samples accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples from 6 bodies accepted, ΔE 13–46 → 3–8, one mixed-light scene 13 → 12; RW2: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0); measured calibration and fidelity remain missing. Other non-DNG raws and rejected fits still use a neutral matrix. Expand validated preview fitting and use matrices the files carry themselves; never Adobe data.
+ 2. **LR-IMP-FORMATS** (P0): **CR3** first (every Canon body since ~2018), then compressed RAF / ORF, Nikon
"lossy after split" NEF, Canon sRAW; HEIC/AVIF decode. Clean-room, from prose descriptions only (see
`crates/raw/src/vendor/nefc.rs` for how compressed NEF was done). Until decoded, such photos are `preview_only`.
3. **LR-IMP-CAMERA-COVERAGE** (P0): per-model verification; grow the CC0 corpus and fix per-model bugs (like the CR2
diff --cc docs/whats-new.md
index be89ddbcb,ea0243f42..5964c07f6
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@@ -2,13 -2,10 +2,17 @@@
## October 2026
+### Library keyboard culling
+- Colour labels tint thumbnail surrounds in Square Grid and the Detail filmstrip, and the footer in Photo Grid. Label confirmations use a matching pale colour; the photo pixels retain their original appearance.
+- Setting or clearing a colour label shows a brief bottom confirmation, like rating a photo; custom label names appear in the message too.
+- On macOS, ratings `0–5`, labels `6–9` and pick/unflag `P/U` now reach the app even when shown in the native menu (issue #283; adapted from PR #261).
+- `Shift+6–9` labels and advances. `Shift+P` picks and advances in Photo Grid and Square Grid; it opens Presets in other views. With Auto Advance on, Shift still moves only once.
+- Help → Keyboard Shortcuts includes the number-key bindings. See [library shortcuts](library-shortcuts.md).
+
+ ### RAW decoding
+ - Sony ILCE-7M4 downsized lossless ARWs now decode subsampled YCbCr tiles into linear RGB,
+ preserving RAW editing & full-resolution export instead of using embedded JPEG previews.
+
### Presets and profiles
- Import presets from other editors: XMP presets, classic `.lrtemplate` files, "DNG presets" from mobile apps and `.zip`
bundles of any of these — whole folders at once, grouped by pack. Masks inside presets come along.