LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Merge remote-tracking branch 'origin/main' into claude/fix-316-section-eye
Claude57dc811a6a40
diff --cc crates/ui-egui/src/headless.rsindex fda3f3154,e9eb89e66..787e0d1ce--- a/crates/ui-egui/src/headless.rs+++ b/crates/ui-egui/src/headless.rs@@@ -1053,24 -1053,37 +1053,55 @@@ mod testsassert_ne!(h.app.session.active(), Some(first), "advanced");}+ /// Click a slider's value and type one (issue #322): Return sets it as one undo step, Esc+ /// keeps the old value, and the keys typed don't reach the shortcuts (1 = one star).+ #[test]+ fn slider_values_can_be_typed() {+ let mut h = demo([1300.0, 900.0]);+ let t = Duration::from_secs(10);+ h.request("ui.set", json!({"view": "detail", "right": "edit"}), t);+ h.settle(SETTLE);+ let active = h.app.session.active().unwrap();+ let exposure = |h: &Headless| h.app.session.develop_of(h.app.session.active().unwrap()).unwrap().light.exposure;+ let rating = |h: &Headless| h.app.session.catalog.photo(active).unwrap().rating;+ let (undo0, rating0) = (h.app.session.undo.len(), rating(&h));+ assert_eq!(h.request("ui.clickWidget", json!({"id": "sliderValue:light.exposure"}), t)["ok"], true);+ h.request("ui.text", json!({"text": "1,5"}), t);+ h.request("ui.key", json!({"key": "Enter"}), t);+ assert!((exposure(&h) - 1.5).abs() < 1e-9, "{}", exposure(&h));+ assert_eq!(h.app.session.undo.len(), undo0 + 1, "one undo step");+ assert_eq!(rating(&h), rating0, "typing 1 set no rating");+ // Esc keeps the value+ assert_eq!(h.request("ui.clickWidget", json!({"id": "sliderValue:light.exposure"}), t)["ok"], true);+ h.request("ui.text", json!({"text": "-2"}), t);+ h.request("ui.key", json!({"key": "Escape"}), t);+ assert!((exposure(&h) - 1.5).abs() < 1e-9, "{}", exposure(&h));+ // something that isn't a number changes nothing+ assert_eq!(h.request("ui.clickWidget", json!({"id": "sliderValue:light.exposure"}), t)["ok"], true);+ h.request("ui.text", json!({"text": "bright"}), t);+ h.request("ui.key", json!({"key": "Enter"}), t);+ assert!((exposure(&h) - 1.5).abs() < 1e-9, "{}", exposure(&h));+ assert_eq!(h.app.session.undo.len(), undo0 + 1);+ }++ /// The eye on a section header switches the section off and on again, one undo step each+ /// (issue #316).+ #[test]+ fn section_eye_switches_a_section_off() {+ let mut h = demo([1300.0, 900.0]);+ let t = Duration::from_secs(10);+ h.request("ui.set", json!({"view": "detail", "right": "edit"}), t);+ h.settle(SETTLE);+ let light_on = |h: &Headless| h.app.session.develop_of(h.app.session.active().unwrap()).unwrap().section_enabled("light");+ for expected in [false, true] {+ // the eye shows while the pointer is on the header+ assert_eq!(h.request("ui.hoverWidget", json!({"id": "section:light"}), t)["ok"], true);+ assert_eq!(h.request("ui.clickWidget", json!({"id": "sectionEye:light"}), t)["ok"], true);+ assert_eq!(light_on(&h), expected);+ }+ assert!(h.app.ui.section_open("light"), "the click didn't fold the section");+ }+/// Return commits a tool panel back to Edit; elsewhere it does nothing.#[test]fn return_commits_the_crop_tool() {diff --cc docs/whats-new.mdindex d70414fd8,72e4d7881..b4afbbd64--- a/docs/whats-new.md+++ b/docs/whats-new.md@@@ -12,12 -26,47 +26,51 @@@- Luminar looks: `.lmp` files and `.mplumpack` collections import as presets (grouped by collection); the sliderswith a counterpart here come along, the rest is listed.- 23 new built-in presets: Portrait, Landscape, Urban, Food, Seasons, Vintage and B&W toners.+ - Imported `.cube` LUT profiles appear in the Profile menu and the profile browser, grouped by their folder, and stay+ favourites across restarts (issue #328).++ ### Editing+ - The Tint slider works the right way round (issues #188, #321): left adds green, right adds magenta, as its track+ shows and as in Lightroom, and Tint values in Lightroom XMP sidecars now render as they do there. A custom Tint+ saved in an earlier version now shifts the other way; set it again (or re-run Auto / the white-balance picker).+ - Crop (issue #295): a Lock toggle keeps the aspect ratio on every handle, Custom takes your own ratio (Apply), and+ dragging a handle into the image edge stops there instead of pushing the crop out of shape.++ ### Library and views+ - Trackpads: pinch to zoom around the pointer and scroll with two fingers to pan the photo; panning keeps the photo+ inside the view. A plain mouse wheel over a zoomed photo pans it too.+ - A Folders section in the sidebar lists the folders your photos were imported from; choose one to see its photos.+ - Select All and multi-selection show every selected photo in the grid and filmstrip, not only the active one+ (issues #187, #298). Importing files that are in Recently Deleted asks whether to leave them there, restore them+ (with their edits) or import them as new; the trash view's Photo menu has Empty Recently Deleted.+ - The Import Photos review opens bigger and can be resized; its photo grid fills it (issue #337). Shift-click checks+ or unchecks a range of photos (issue #338).++ ### Languages+ - The interface is available in German and Russian (Edit ▸ Language), alongside English, Chinese (Simplified and+ Traditional), Japanese and Brazilian Portuguese.++ ### Editing+ - Type an exact value into any slider (issue #322): click the number next to its name, type (`1.5`, `-20`, `5600`)+ and press Return; Esc keeps the old value.+### Editing+- The eye on the Light, Color and Detail section headers now hides their adjustments, as it already did for Effects,+ Optics, Geometry and Calibration (issue #316).+### Reliability+ - On macOS, single-key shortcuts that appear in the menu bar now work: E, C, H, M, ⇧P, I, K, D, ratings 0–5,+ labels 6–9, P / U and the rest did nothing, because macOS only passes ⌘ / ⌃ combinations and function keys+ to the menu bar and the app ignored those keys, assuming the menu bar would handle them. Keys outside the menus+ (Space, G, X, ⌫) and ⌘ shortcuts were not affected.+ - `--memory` sessions keep their promise to save nothing (issues #164, #169): UI changes made in one no longer+ land in `ui.json` (where they replaced the saved settings), and the GPU crash sentinel no longer creates the+ settings folder there. The same goes for the temporary session offered when the library can't be opened.+ - The desktop app keeps a log file: `logs/lightcraft.log` in its settings folder (Linux `~/.config/lightcraft/logs/`),+ with the logs of the two previous runs beside it, so warnings and crashes of a run started from a desktop menu or the+ Dock can be attached to a bug report. `LIGHTCRAFT_LOG` works as before; `RUST_LOG` takes env_logger-style+ directives. See README → Quick start → Logs.+ - `lightcraft-cli` logs warnings on stderr too (issue #168); `LIGHTCRAFT_LOG` or `RUST_LOG` picks another level.- LightCraft no longer crashes at launch on Windows PCs whose Vulkan driver is broken (issue #136, e.g. some Intel UHD630 drivers): on Windows the window and GPU rendering use DirectX 12 only and never load the Vulkan driver unlessasked to. `LIGHTCRAFT_GPU_BACKEND=dx12 | vulkan | metal | off` (or wgpu's `WGPU_BACKEND`, which GPU rendering