LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
LR-IMP-ADD-DIALOG: keep import thumbnail review changes focused (#2237)
tylerphotos9ceeb853167d
diff --cc crates/ui-egui/locales/cs.jsonindex 1e84313ae,1e84313ae..e1b8e7f62--- a/crates/ui-egui/locales/cs.json+++ b/crates/ui-egui/locales/cs.json@@@ -2063,5 -2063,5 +2063,7 @@@"Open Settings": "Otevřít nastavení","Select none": "Zrušit celý výběr","Select all": "Vybrat vše",-- "Visualize HDR": "Zobrazit rozsah HDR"++ "Visualize HDR": "Zobrazit rozsah HDR",++ "Thumbnail size": "Velikost miniatur",++ "Import Thumbnail Size": "Velikost miniatur při importu"}diff --cc crates/ui-egui/locales/de.jsonindex 000aea2d4,000aea2d4..31ad71666--- a/crates/ui-egui/locales/de.json+++ b/crates/ui-egui/locales/de.json@@@ -2341,5 -2341,5 +2341,7 @@@"Checking the GPU…": "GPU wird geprüft …","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "Ein Gesichtsmodell nutzt die GPU nur, wenn eine Prüfung zeigt, dass sie dieselben Ergebnisse schneller liefert.",-- "Checking the GPU for faces": "GPU für Gesichter wird geprüft"++ "Checking the GPU for faces": "GPU für Gesichter wird geprüft",++ "Thumbnail size": "Vorschaubildgröße",++ "Import Thumbnail Size": "Vorschaubildgröße beim Import"}diff --cc crates/ui-egui/locales/es.jsonindex 77ba4c08e,77ba4c08e..91ff5ee25--- a/crates/ui-egui/locales/es.json+++ b/crates/ui-egui/locales/es.json@@@ -2340,5 -2340,5 +2340,7 @@@"Checking the GPU…": "Comprobando la GPU…","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "Un modelo de caras usa la GPU solo cuando una comprobación muestra que da los mismos resultados más rápido.",-- "Checking the GPU for faces": "Comprobando la GPU para las caras"++ "Checking the GPU for faces": "Comprobando la GPU para las caras",++ "Thumbnail size": "Tamaño de las miniaturas",++ "Import Thumbnail Size": "Tamaño de las miniaturas de importación"}diff --cc crates/ui-egui/locales/fr.jsonindex fa57e373e,fa57e373e..bcfe1956f--- a/crates/ui-egui/locales/fr.json+++ b/crates/ui-egui/locales/fr.json@@@ -2338,5 -2338,5 +2338,7 @@@"Checking the GPU…": "Vérification du GPU…","CPU": "Processeur","A face model uses the GPU only when a check shows it gives the same results faster.": "Un modèle de visages n’utilise le GPU que si une vérification montre qu’il donne les mêmes résultats plus vite.",-- "Checking the GPU for faces": "Vérification du GPU pour les visages"++ "Checking the GPU for faces": "Vérification du GPU pour les visages",++ "Thumbnail size": "Taille des vignettes",++ "Import Thumbnail Size": "Taille des vignettes d’importation"}diff --cc crates/ui-egui/locales/it.jsonindex 382fb80c9,382fb80c9..c82236aae--- a/crates/ui-egui/locales/it.json+++ b/crates/ui-egui/locales/it.json@@@ -1990,5 -1990,5 +1990,8 @@@"Test Face Model": "Testa il modello dei volti","This build cannot run recognition models: they can be added and chosen, not used.": "Questa versione non può eseguire modelli di riconoscimento: si possono aggiungere e scegliere, non usare.","This build has nowhere to keep face models, so the model list is not available. (The desktop app has.)": "Questa versione non ha dove tenere i modelli dei volti, quindi l'elenco dei modelli non è disponibile. (L'app desktop ce l'ha.)",-- "Unnamed Faces": "Volti senza nome"++ "Unnamed Faces": "Volti senza nome",++ "Thumbnail size": "Dimensione delle miniature",++ "Import Thumbnail Size": "Dimensione delle miniature di importazione",++ "Click to type a value, drag to change it": "Fai clic per digitare un valore, trascina per modificarlo"}diff --cc crates/ui-egui/locales/ja.jsonindex 2dc80934f,2dc80934f..7a4e06d08--- a/crates/ui-egui/locales/ja.json+++ b/crates/ui-egui/locales/ja.json@@@ -2340,5 -2340,5 +2340,7 @@@"Checking the GPU…": "GPU を確認中…","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "顔モデルが GPU を使うのは、同じ結果をより速く出せると確認できた場合だけです。",-- "Checking the GPU for faces": "顔用の GPU を確認中"++ "Checking the GPU for faces": "顔用の GPU を確認中",++ "Thumbnail size": "サムネイルのサイズ",++ "Import Thumbnail Size": "読み込みサムネイルのサイズ"}diff --cc crates/ui-egui/locales/ka.jsonindex f6530929d,f6530929d..bf0cab098--- a/crates/ui-egui/locales/ka.json+++ b/crates/ui-egui/locales/ka.json@@@ -2718,5 -2718,5 +2718,8 @@@"≥ at least": "≥ არანაკლებ","⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-გადათრევა გასასწორებლად, ⇧G მართვადი Upright, ბადე გარდაქმნისას.","日本語": "日本語",-- "繁體中文(台灣)": "繁體中文(台灣)"++ "繁體中文(台灣)": "繁體中文(台灣)",++ "Thumbnail size": "მინიატურების ზომა",++ "Import Thumbnail Size": "იმპორტის მინიატურების ზომა",++ "Click to type a value, drag to change it": "დააწკაპუნეთ მნიშვნელობის შესაყვანად, გადაათრიეთ მის შესაცვლელად"}diff --cc crates/ui-egui/locales/pl.jsonindex 7416ce241,7416ce241..0c4dbfa8f--- a/crates/ui-egui/locales/pl.json+++ b/crates/ui-egui/locales/pl.json@@@ -2157,5 -2157,5 +2157,7 @@@"This is a Lightroom catalog, not a LightCraft library. Import it into a LightCraft library instead?": "To jest katalog Lightrooma, a nie biblioteka LightCraft. Zaimportować go zamiast tego do biblioteki LightCraft?","Unnamed Faces": "Nienazwane twarze","Vertical inset (% of short edge)": "Margines pionowy (% krótszego boku)",-- "not added to Apple Photos (cancelled)": "nie dodano do aplikacji Zdjęcia (anulowano)"++ "not added to Apple Photos (cancelled)": "nie dodano do aplikacji Zdjęcia (anulowano)",++ "Thumbnail size": "Rozmiar miniatur",++ "Import Thumbnail Size": "Rozmiar miniatur importu"}diff --cc crates/ui-egui/locales/pt-br.jsonindex 85a0ae039,2c9e9da05..2c7c994ec--- a/crates/ui-egui/locales/pt-br.json+++ b/crates/ui-egui/locales/pt-br.json@@@ -2180,5 -2180,11 +2180,13 @@@"Checking the GPU…": "Verificando a GPU…","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "Um modelo de rostos só usa a GPU quando uma verificação mostra que ela dá os mesmos resultados mais rápido.",- "Checking the GPU for faces": "Verificando a GPU para rostos"+ "Checking the GPU for faces": "Verificando a GPU para rostos",+ "Include selected photos": "Incluir fotos selecionadas",+ "Color Overlay": "Sobreposição de cor",+ "Color Overlay on B&W": "Sobreposição de cor em P&B",+ "Image on Black": "Imagem sobre preto",+ "Image on White": "Imagem sobre branco",- "White on Black": "Branco sobre preto"++ "White on Black": "Branco sobre preto",++ "Thumbnail size": "Tamanho das miniaturas",++ "Import Thumbnail Size": "Tamanho das miniaturas de importação"}diff --cc crates/ui-egui/locales/ru.jsonindex 5ead5101f,5ead5101f..a1a675a63--- a/crates/ui-egui/locales/ru.json+++ b/crates/ui-egui/locales/ru.json@@@ -2333,5 -2333,5 +2333,7 @@@"Checking the GPU…": "Проверка ГП…","CPU": "ЦП","A face model uses the GPU only when a check shows it gives the same results faster.": "Модель лиц использует ГП, только если проверка показала, что он даёт те же результаты быстрее.",-- "Checking the GPU for faces": "Проверка ГП для лиц"++ "Checking the GPU for faces": "Проверка ГП для лиц",++ "Thumbnail size": "Размер миниатюр",++ "Import Thumbnail Size": "Размер миниатюр при импорте"}diff --cc crates/ui-egui/locales/uk.jsonindex fbdef1c5f,fbdef1c5f..88dfbd225--- a/crates/ui-egui/locales/uk.json+++ b/crates/ui-egui/locales/uk.json@@@ -2338,5 -2338,5 +2338,7 @@@"Checking the GPU…": "Перевірка ГП…","CPU": "ЦП","A face model uses the GPU only when a check shows it gives the same results faster.": "Модель облич використовує ГП, лише якщо перевірка показала, що він дає ті самі результати швидше.",-- "Checking the GPU for faces": "Перевірка ГП для облич"++ "Checking the GPU for faces": "Перевірка ГП для облич",++ "Thumbnail size": "Розмір мініатюр",++ "Import Thumbnail Size": "Розмір мініатюр імпорту"}diff --cc crates/ui-egui/locales/zh-hans.jsonindex 2750dd4c8,2750dd4c8..7a8a1da7a--- a/crates/ui-egui/locales/zh-hans.json+++ b/crates/ui-egui/locales/zh-hans.json@@@ -2179,5 -2179,5 +2179,7 @@@"Checking the GPU…": "正在检查 GPU…","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "只有检查表明 GPU 能更快给出相同结果时,人脸模型才会使用 GPU。",-- "Checking the GPU for faces": "正在检查用于人脸的 GPU"++ "Checking the GPU for faces": "正在检查用于人脸的 GPU",++ "Thumbnail size": "缩略图大小",++ "Import Thumbnail Size": "导入缩略图大小"}diff --cc crates/ui-egui/locales/zh-hant.jsonindex a1723fc22,a1723fc22..4880ca22b--- a/crates/ui-egui/locales/zh-hant.json+++ b/crates/ui-egui/locales/zh-hant.json@@@ -2141,5 -2141,5 +2141,7 @@@"Checking the GPU…": "正在檢查 GPU…","CPU": "CPU","A face model uses the GPU only when a check shows it gives the same results faster.": "只有在檢查顯示 GPU 能更快得出相同結果時,臉孔模型才會使用 GPU。",-- "Checking the GPU for faces": "正在檢查用於臉孔的 GPU"++ "Checking the GPU for faces": "正在檢查用於臉孔的 GPU",++ "Thumbnail size": "縮圖大小",++ "Import Thumbnail Size": "匯入縮圖大小"}diff --cc crates/ui-egui/src/import.rsindex 7c202c1a7,e851463d1..5de6890bf--- a/crates/ui-egui/src/import.rs+++ b/crates/ui-egui/src/import.rs@@@ -35,23 -35,6 +35,43 @@@ const CONTENT_BOTTOM: &str = "import-co/// Room below the grid before it has been measured (more than the options and buttons take).const DEFAULT_BELOW_GRID: f32 = 360.0;+pub(crate) const THUMB_SIZE_MIN: f32 = 80.0;+pub(crate) const THUMB_SIZE_MAX: f32 = 320.0;+pub(crate) const THUMB_SIZE_DEFAULT: f32 = 116.0;++/// Bound values from saved preferences and the control channel before laying out the grid.+pub(crate) fn thumb_size(size: f32) -> f32 {+ if size.is_finite() { size.clamp(THUMB_SIZE_MIN, THUMB_SIZE_MAX) } else { THUMB_SIZE_DEFAULT }+}++/// A few physical-pixel sizes avoid decoding on every point of a slider drag. The engine caps+/// candidate previews at 1024 pixels; this covers the largest tile at up to 3× display density.+fn thumb_edge(size: f32, pixels_per_point: f32) -> usize {+ let scale = if pixels_per_point.is_finite() && pixels_per_point > 0.0 { pixels_per_point } else { 1.0 };+ let pixels = (thumb_size(size) - 8.0) * scale;+ [192, 384, 512, 768, 1024].into_iter().find(|edge| *edge as f32 >= pixels).unwrap_or(1024)+}+++/// Use the shared control contract for pointer, keyboard, exact-value entry and reset interactions.++fn thumb_size_slider(app: &mut LightcraftApp, ui: &mut egui::Ui) {++ use lightcraft_develop::controls::{ControlSpec, Section, Track};++ const SIZE: ControlSpec = ControlSpec {++ id: "importThumbSize",++ label: "Thumbnail size",++ section: Section::Light,++ min: THUMB_SIZE_MIN as f64,++ max: THUMB_SIZE_MAX as f64,++ default: THUMB_SIZE_DEFAULT as f64,++ step: 1.0,++ decimals: 0,++ track: Track::Plain,++ };++ let out = crate::widgets::slider(ui, &SIZE, f64::from(thumb_size(app.ui.import_thumb_size)), true, None);++ if let Some(size) = out.value {++ let _ = app.run("view.importThumbSize", json!({"size": SIZE.clamp(size)}));++ }++}++/// Height of the photo grid: what is `available` once `below` (options and buttons) is left free,/// in whole points so the window never grows by a fraction each frame, and at least one `row`.pub(crate) fn grid_height(available: f32, below: f32, row: f32) -> f32 {@@@ -1043,18 -1026,8 +1063,9 @@@ pub fn body(app: &mut LightcraftApp, ui}});}- ui.horizontal(|ui| {- let mut size = thumb_size(app.ui.import_thumb_size);- let response =- ui.add(egui::Slider::new(&mut size, THUMB_SIZE_MIN..=THUMB_SIZE_MAX).text(crate::i18n::tr("Thumbnail size")).show_value(false));- // Slider's response includes its label; automation addresses the track itself.- register(ui.ctx(), "slider:importThumbSize", Rect::from_min_size(response.rect.min, vec2(ui.spacing().slider_width, response.rect.height())));- if response.changed() {- let _ = app.run("view.importThumbSize", json!({"size": size}));- }- });++ thumb_size_slider(app, ui);// candidate grid- let cell = 116.0;+ let cell = thumb_size(app.ui.import_thumb_size).min(ui.available_width().max(1.0));let avail = ui.available_width();let cols = ((avail + 6.0) / (cell + 6.0)).floor().max(1.0) as usize;let rows = n.div_ceil(cols);diff --cc crates/ui-egui/src/state.rsindex 0b6b28ccc,f8c8cc0d4..70c915981--- a/crates/ui-egui/src/state.rs+++ b/crates/ui-egui/src/state.rs@@@ -1263,6 -1261,6 +1263,7 @@@ pub struct SyncCounts}impl Default for UiState {++ /// Initialize the library and import review sizes as independent app preferences.fn default() -> Self {UiState {window: None,diff --cc crates/ui-egui/src/tests_import_thumbnails.rsindex 1e0b669d8,000000000..6817b72ecmode 100644,000000..100644--- a/crates/ui-egui/src/tests_import_thumbnails.rs+++ b/crates/ui-egui/src/tests_import_thumbnails.rs@@@ -1,159 -1,0 +1,208 @@@+//! Import review sizes change the real grid and its preview resolution, preserving culling.++use std::time::Duration;++use serde_json::json;++use crate::headless::Headless;+use crate::import::ImportDialog;+use crate::render::Slot;+use crate::state::{Dialog, UiState};+use crate::{LightcraftApp, Services};+use lightcraft_engine::import::ImportCandidate;++const T: Duration = Duration::from_secs(30);++/// An isolated import dialog with real preview jobs and a disposable procedural source file.+struct Review {+ h: Headless,+ dir: std::path::PathBuf,+}++impl Review {+ /// Open sixty candidates at the requested display density, including duplicate/error badges.+ fn new(scale: f32) -> Self {+ let dir = std::env::temp_dir().join(format!("lc-import-thumbnails-{}-{}", std::process::id(), lightcraft_preview::next_tick()));+ std::fs::create_dir_all(&dir).unwrap();+ let image = lightcraft_raster::Rgba8 {+ width: 1600,+ height: 1200,+ data: (0..1600 * 1200).map(|i| [((i % 1600) / 7) as u8, ((i / 1600) / 5) as u8, 100, 255]).collect(),+ };+ let bytes = lightcraft_codecs::encode_png(&lightcraft_codecs::EncodeImage::rgba8(&image), &Default::default()).unwrap();+ let path = dir.join("original.png");+ std::fs::write(&path, &bytes).unwrap();+ let mut candidates: Vec<_> = (0..60)+ .map(|i| ImportCandidate {+ path: path.to_string_lossy().into(),+ name: format!("a-long-photo-name-{i:02}.png"),+ format: "PNG".into(),+ width: 1600,+ height: 1200,+ file_size: bytes.len() as u64,+ ..Default::default()+ })+ .collect();+ candidates[1].duplicate = Some("content".into());+ candidates[2].error = Some("Unreadable test candidate".into());+ let mut app = LightcraftApp::new(lightcraft_engine::Session::new().with_fs(), Services::default());+ app.ui.dialog = Some(Dialog::Import { opts: Box::new(ImportDialog::new(candidates)) });+ let mut h = Headless::new(app, [1366.0, 1000.0], scale);+ assert!(h.settle(T));+ Self { h, dir }+ }++ /// Find an automation widget, failing the test if the dialog no longer exposes it.+ fn rect(&self, id: &str) -> egui::Rect {+ self.h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r).unwrap_or_else(|| panic!("missing {id}"))+ }++ /// Snapshot every candidate's checked state while requiring the review to remain open.+ fn checks(&self) -> Vec<bool> {+ let Some(Dialog::Import { opts }) = &self.h.app.ui.dialog else { panic!("import review closed") };+ opts.checked.clone()+ }++ /// Drive the real control dispatcher and fail on any unsuccessful response.+ fn request(&mut self, method: &str, params: serde_json::Value) {+ let response = self.h.request(method, params, T);+ assert_eq!(response["ok"], true, "{method}: {response}");+ }++ /// Set thumbnail size through its command and wait for the resulting previews to settle.+ fn size(&mut self, size: f32) {+ self.request("engine.execute", json!({"command": "view.importThumbSize", "params": {"size": size}}));+ assert!(self.h.settle(T));+ }+}++impl Drop for Review {+ /// Release import preview jobs before removing the temporary source directory.+ fn drop(&mut self) {+ self.h.app.ui.dialog = None;+ self.h.app.renderer.forget_imports();+ self.h.settle(T);+ let _ = std::fs::remove_dir_all(&self.dir);+ }+}++/// Pointer input must resize and reflow tiles without changing culling, badges or saved size.+#[test]+fn import_thumbnail_slider_reflows_without_changing_selection_or_badges() {+ let mut review = Review::new(1.0);+ assert_eq!(review.rect("import:0").width(), 116.0);+ review.request("ui.clickWidget", json!({"id": "import:0"}));+ let checked = review.checks();+ assert!(!checked[0] && !checked[1] && !checked[2]);+ // Real pointer input on the slider, including its end stops.+ review.request("ui.clickWidget", json!({"id": "slider:importThumbSize", "fx": 0.0}));+ assert!(review.h.settle(T));+ assert_eq!(review.rect("import:0").width(), 80.0);+ let slider = review.rect("slider:importThumbSize");+ review.request("ui.dragWidget", json!({"id": "slider:importThumbSize", "toX": slider.right(), "toY": slider.center().y}));+ assert!(review.h.settle(T));+ assert_eq!(review.rect("import:0").width(), 320.0);+ assert_eq!(review.checks(), checked);+ let text = review.h.painted_text().join("\n");+ assert!(text.contains("Duplicate") && text.contains("Unreadable"), "badges remain visible: {text}");+ assert!(review.rect("import:3").top() > review.rect("import:0").top(), "larger tiles wrap into more rows");+ review.size(80.0);+ assert_eq!(review.rect("import:3").top(), review.rect("import:0").top());+ assert_eq!(review.checks(), checked);+ // The preference survives closing/reopening the review and a settings round trip.+ let saved = serde_json::to_value(&review.h.app.ui).unwrap();+ let restored: UiState = serde_json::from_value(saved).unwrap();+ assert_eq!(restored.sanitized().import_thumb_size, 80.0);+}++/// Dense displays need sharper previews; shrinking reuses them and scrolling bounds retention.+#[test]+fn import_thumbnail_previews_upgrade_for_density_and_stay_bounded_when_scrolling() {+ let mut review = Review::new(2.0);+ assert_eq!(review.h.app.renderer.textures[&Slot::Import(0)].size, [384, 288]);+ review.size(320.0);+ assert_eq!(review.h.app.renderer.textures[&Slot::Import(0)].size, [768, 576]);+ // Shrinking keeps the sharp preview instead of replacing it with a smaller decode.+ let sharp = review.h.app.renderer.textures[&Slot::Import(0)].key;+ review.size(116.0);+ assert_eq!(review.h.app.renderer.textures[&Slot::Import(0)].key, sharp);+ review.size(320.0);+ // Scrolling a large card retains only the nearby tiles and drops obsolete requests.+ review.request("ui.hoverWidget", json!({"id": "import:0"}));+ review.request("ui.scroll", json!({"dy": -20000.0}));+ assert!(review.h.settle(T));+ assert!(!review.h.app.renderer.textures.contains_key(&Slot::Import(0)));+ let imports: Vec<_> = review.h.app.renderer.textures.keys().filter_map(|s| if let Slot::Import(i) = s { Some(*i) } else { None }).collect();+ assert!(!imports.is_empty() && imports.len() < 20, "bounded visible previews: {imports:?}");+ for i in imports {+ assert!(review.h.app.widgets.iter().any(|(w, _)| w == &format!("import:{i}")));+ }+}++/// Invalid commands preserve the setting; legacy and non-finite preferences restore safely.+#[test]+fn import_thumbnail_size_rejects_bad_commands_and_restores_old_preferences() {+ let mut app = LightcraftApp::new(lightcraft_engine::Session::new(), Services::default());+ assert_eq!(app.run("view.importThumbSize", json!({})).unwrap()["size"], 116.0);+ for bad in [json!("large"), json!(null), json!([120]), json!(1e300)] {+ assert!(app.run("view.importThumbSize", json!({"size": bad})).is_err());+ assert_eq!(app.ui.import_thumb_size, 116.0);+ }+ assert_eq!(app.run("view.importThumbSize", json!({"size": -10})).unwrap()["size"], 80.0);+ assert_eq!(app.run("view.importThumbSize", json!({"size": 1e6})).unwrap()["size"], 320.0);+ let legacy: UiState = serde_json::from_value(json!({})).unwrap();+ assert_eq!(legacy.import_thumb_size, 116.0);+ for bad in [f32::NAN, f32::INFINITY, f32::NEG_INFINITY] {+ let state = UiState { import_thumb_size: bad, ..Default::default() }.sanitized();+ assert_eq!(state.import_thumb_size, 116.0);+ }+}++++/// A selected import slider keeps keyboard nudges after idle frames without changing candidate checks.++#[test]++fn import_thumbnail_slider_keeps_the_shared_keyboard_contract() {++ let mut review = Review::new(1.0);++ let checked = review.checks();++ review.request("ui.clickWidget", json!({"id": "slider:importThumbSize", "fx": 0.4}));++ assert!(review.h.settle(T));++ for _ in 0..6 {++ review.h.step();++ }++ let before = review.h.app.ui.import_thumb_size;++ review.request("ui.key", json!({"key": "ArrowUp"}));++ assert!(review.h.settle(T));++ assert_eq!(review.h.app.ui.import_thumb_size, before + 1.0);++ assert_eq!(review.checks(), checked);++}++++/// Every shipped language translates the slider and command labels, with the real control visible at high density.++#[test]++fn import_thumbnail_labels_are_localized_in_every_shipped_language() {++ use crate::i18n::Locale;++ let command =++ crate::menus::UI_COMMANDS.iter().find(|command| command.0 == "view.importThumbSize").expect("the import-size command is registered");++ assert_eq!(command.1, "Import Thumbnail Size", "the catalog key matches the command's actual label");++ for theme in ["charcoal", "paper"] {++ for scale in [1.0, 2.25] {++ let mut app = LightcraftApp::new(lightcraft_engine::Session::new(), Services { png: None, ..Default::default() });++ app.ui.dialog = Some(Dialog::Import { opts: Box::new(ImportDialog::new(Vec::new())) });++ let mut h = Headless::new(app, [960.0, 720.0], scale);++ assert!(h.app.run("view.theme", json!({"theme": theme})).is_ok());++ for locale in Locale::ALL {++ for source in ["Thumbnail size", "Import Thumbnail Size", "Click to type a value, drag to change it"] {++ assert!(!locale.tr(source).is_empty());++ if *locale != Locale::En {++ assert_ne!(locale.tr(source), source, "{locale:?}: {source}");++ }++ }++ let result = h.request("ui.set", json!({"language": locale.code()}), T);++ assert_eq!(result["ok"], true, "{result}");++ assert!(h.settle(T));++ assert!(h.painted_text().iter().any(|text| text == locale.tr("Thumbnail size")), "{locale:?}: translated slider label");++ let track = h.app.widgets.iter().find(|(id, _)| id == "slider:importThumbSize").expect("the import slider is visible").1;++ let viewport = egui::Rect::from_min_size(egui::Pos2::ZERO, h.size);++ assert!(viewport.contains_rect(track), "{locale:?} {theme} {scale}: slider stays inside the viewport");++ }++ }++ }++}diff --cc docs/control-protocol.mdindex f67bd4fcd,31ecbf8c2..a9288904b--- a/docs/control-protocol.md+++ b/docs/control-protocol.md@@@ -239,12 -239,6 +239,16 @@@ For MCP, use `lightcraft-cli mcp --conn`lightcraft://controls` ([mcp.md](mcp.md#resources)). Headless CLI/MCP mode owns a separate enginesession; use connect mode for feedback from edits in the desktop app.+The import review's **Thumbnail size** slider is `slider:importThumbSize` in `ui.widgets`.+`engine.execute {command: "view.importThumbSize", params: {size: 240}}` sets its size in points+(80–320, clamped); omitting `size` reads it. Both return `{size}`. Non-numeric or non-finite+values are refused. The preference is `importThumbSize` in the UI state, independent of the+library grid's `thumbSize`; resizing keeps the import checkboxes and duplicate markers.++The shared slider also exposes `sliderValue:importThumbSize` for exact entry and++`sliderLabel:importThumbSize` for double-click reset to 116 pt. Up/Down nudges the selected++slider by 1 pt; Return commits typed values and Escape cancels them. Slider and command++labels, including edit/reset feedback, are localized in every shipped catalog.+## Headless rendering (no window, no GPU)The egui UI can be rasterized on the CPU (`crates/ui-egui/src/softpaint.rs`, driven bydiff --cc docs/gaps.mdindex 2de817113,1b4a385fa..79ff45e9e--- a/docs/gaps.md+++ b/docs/gaps.md@@@ -1,6 -1,6 +1,6 @@@# Gaps: where LightCraft falls short of Lightroom- > **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-18 · **Change:** minor (import grid thumbnail size adjustable; gap 30 tracks the remaining pre-import loupe, #2056; upstream Print Page Options and camera updates retained)-> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-15 · **Change:** minor (gap 15: Print Page Options — page numbers, page info, crop marks)++> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-21 · **Change:** patch (import thumbnail localization and shared slider interactions; gap/status counts unchanged)Every known shortfall, one entry each, ranked by user impact (how many Lightroom users hit it, andhow hard it blocks them), then by effort. **Agents pick work from the top** (the first entry nobody is@@@ -81,7 -77,6 +81,8 @@@ Beta-blocking gaps (B) total **~230–4| Date | Change | Summary ||---|---|---|++| 2026-10-21 | patch | LR-IMP-ADD-DIALOG: translate the import thumbnail labels in all 13 catalogs; use the shared ControlSpec slider for keyboard, exact entry and reset; retain the remaining pre-import loupe gap and unchanged counts |+| 2026-10-17 | minor | Import thumbnail-size slider (part of #2056); gap 30 records the remaining pre-import loupe and keyboard culling || 2026-10-18 | patch | Gap 1: six X-Trans CMOS 4 Fujifilm bodies (X-T30 …) take the X-T3's spectral matrices instead of the neutral matrix || 2026-10-15 | minor | Gap 15 shrinks: the Page panel's Page Options (Page Numbers, Page Info, Crop Marks) print on Single Image and Contact Sheet pages; identity plate, watermark, photo info, Cut Guides, direct printing and JPEG output remain || 2026-10-14 | minor | Gap 26: at 100k photos stack and album lookups are indexed, so an "In a Stack" or "Album" smart album counts in ~14 ms (was 0.6–2.7 s); open time unchanged |diff --cc docs/parity-checklist.mdindex b8d8438ef,4e0531793..085c3cba6--- a/docs/parity-checklist.md+++ b/docs/parity-checklist.md@@@ -1,6 -1,6 +1,6 @@@# Lightroom parity checklist- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (import grid thumbnail-size slider, #2056; upstream Print Page Options and raw/export updates retained; status and summary counts unchanged) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (LRC-PRINT-PAGE: Print Page Options) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** patch (import thumbnail localization and shared slider interactions; gap/status counts unchanged) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what wehave and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good@@@ -797,7 -797,6 +797,8 @@@ Latin stays upright. Advanced Japanese| Date | Change | Summary ||---|---|---|++| 2026-10-21 | patch | LR-IMP-ADD-DIALOG: translate the import thumbnail labels in all 13 catalogs; use the shared ControlSpec slider for keyboard, exact entry and reset; retain the remaining pre-import loupe gap and unchanged counts |+| 2026-10-17 | minor | LR-IMP-ADD-DIALOG: import grid thumbnail-size slider, density-aware previews, bounded visible textures and preserved culling; remaining loupe tracked in gap 30 (#2056); status and summary counts 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 (🟡) |