From 742c4874476904f88df617e7f1392df690fc4e03 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sat, 17 Oct 2026 00:31:36 +1000 Subject: [PATCH 01/14] LR-COLOR-MIXER-HSL: the Color Mixer's HSL mode, laid out as in Lightroom Classic The Color Mixer only had its Color mode (a dot per colour, one colour's three sliders), and Point Color was a separate flyout. It now has "Mixer | Point Color" tabs, then Adjust: HSL / Color. HSL shows Hue | Saturation | Luminance | All: eight colour sliders per group, labelled by the colour, on the coloured tracks the mixer controls already have (neighbouring hues, grey to the colour, dark to light); All stacks the three groups, each with its heading. Each group has its targeted adjustment button. Color mode is unchanged as the second choice; a B&W photo shows its B&W mix. HSL is the default and the tab, mode and group are remembered with the UI settings. The sliders are the same mixer.. develop controls (no new settings). view.colorMixer {tab, adjust, group, band} sets the layout from the console, MCP or a script. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 4a5b26756ca9c37a46e2303a18504b688bd9291c) --- crates/ui-egui/locales/cs.json | 6 +- crates/ui-egui/locales/de.json | 6 +- crates/ui-egui/locales/es.json | 6 +- crates/ui-egui/locales/fr.json | 6 +- crates/ui-egui/locales/it.json | 6 +- crates/ui-egui/locales/ja.json | 6 +- crates/ui-egui/locales/pl.json | 6 +- crates/ui-egui/locales/pt-br.json | 6 +- crates/ui-egui/locales/ru.json | 6 +- crates/ui-egui/locales/uk.json | 6 +- crates/ui-egui/locales/zh-hans.json | 6 +- crates/ui-egui/locales/zh-hant.json | 6 +- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/menus.rs | 44 +++++++++ crates/ui-egui/src/panels/detail.rs | 3 +- crates/ui-egui/src/panels/edit.rs | 126 ++++++++++++++++++++++-- crates/ui-egui/src/state.rs | 14 ++- crates/ui-egui/src/tests_color_mixer.rs | 117 ++++++++++++++++++++++ docs/parity-checklist.md | 5 +- docs/whats-new.md | 9 ++ 20 files changed, 366 insertions(+), 26 deletions(-) create mode 100644 crates/ui-egui/src/tests_color_mixer.rs diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 52ca94a524..95947dcb59 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -2408,5 +2408,9 @@ "Import dropped files without review": "Importovat přetažené soubory bez kontroly", "An import is running": "Import už běží", "An import is running. Drop photos when it has finished": "Import už běží. Fotky přetáhněte, až skončí", - "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky" + "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky", + "Mixer": "Směšovač", + "HSL": "HSL", + "Adjust": "Upravit", + "Color Mixer Layout": "Rozvržení směšovače barev" } diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index e2205db782..e51cdb9921 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -3440,5 +3440,9 @@ "Import dropped files without review": "Abgelegte Dateien ohne Prüfung importieren", "An import is running": "Ein Import läuft", "An import is running. Drop photos when it has finished": "Ein Import läuft. Lege die Fotos ab, wenn er fertig ist", - "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst" + "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst", + "Mixer": "Mischer", + "HSL": "HSL", + "Adjust": "Anpassen", + "Color Mixer Layout": "Farbmischer-Ansicht" } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 888af077ff..46947b6d62 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2358,5 +2358,9 @@ "Import dropped files without review": "Importar los archivos soltados sin revisión", "An import is running": "Hay una importación en curso", "An import is running. Drop photos when it has finished": "Hay una importación en curso. Suelta las fotos cuando termine", - "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos" + "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos", + "Mixer": "Mezclador", + "HSL": "HSL", + "Adjust": "Ajustar", + "Color Mixer Layout": "Disposición del mezclador de color" } diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 3278d6ccda..a68aeea89a 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -2390,5 +2390,9 @@ "Checking recent libraries": "Vérification des bibliothèques récentes", "The photos are imported once a library is open": "Les photos seront importées dès qu'une bibliothèque sera ouverte", "Open a library first, then drop the presets again": "Ouvrez d'abord une bibliothèque, puis déposez à nouveau les préréglages", - "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :" + "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :", + "Mixer": "Mélangeur", + "HSL": "TSL", + "Adjust": "Régler", + "Color Mixer Layout": "Disposition du mélangeur de couleurs" } diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index e159fd47d1..3fb994a8cb 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2361,5 +2361,9 @@ "Import dropped files without review": "Importa i file rilasciati senza revisione", "An import is running": "Un'importazione è in corso", "An import is running. Drop photos when it has finished": "Un'importazione è in corso. Trascina le foto quando è finita", - "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto" + "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto", + "Mixer": "Miscelatore", + "HSL": "HSL", + "Adjust": "Regola", + "Color Mixer Layout": "Disposizione del miscelatore colore" } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index e1834555bd..ddac72db9a 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -2356,5 +2356,9 @@ "Import dropped files without review": "ドロップしたファイルを確認せずに読み込む", "An import is running": "読み込み中です", "An import is running. Drop photos when it has finished": "読み込み中です。完了してから写真をドロップしてください", - "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください" + "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください", + "Mixer": "ミキサー", + "HSL": "HSL", + "Adjust": "調整", + "Color Mixer Layout": "カラーミキサーの表示" } diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index adac22e62a..b96c6fe4d7 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -2283,5 +2283,9 @@ "Import dropped files without review": "Importuj upuszczone pliki bez przeglądu", "An import is running": "Import jest w toku", "An import is running. Drop photos when it has finished": "Import jest w toku. Upuść zdjęcia, gdy się zakończy", - "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia" + "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia", + "Mixer": "Mikser", + "HSL": "HSL", + "Adjust": "Dostosuj", + "Color Mixer Layout": "Układ miksera kolorów" } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index e84fb7615b..00bc55714d 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -2202,5 +2202,9 @@ "Import dropped files without review": "Importar arquivos soltos sem revisão", "An import is running": "Uma importação está em andamento", "An import is running. Drop photos when it has finished": "Uma importação está em andamento. Solte as fotos quando ela terminar", - "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos" + "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos", + "Mixer": "Misturador", + "HSL": "HSL", + "Adjust": "Ajustar", + "Color Mixer Layout": "Disposição do misturador de cores" } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 306804df04..8527c57cf7 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -2349,5 +2349,9 @@ "Import dropped files without review": "Импортировать перетащенные файлы без проверки", "An import is running": "Импорт уже выполняется", "An import is running. Drop photos when it has finished": "Импорт уже выполняется. Перетащите фото, когда он закончится", - "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото" + "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото", + "Mixer": "Микшер", + "HSL": "HSL", + "Adjust": "Настройка", + "Color Mixer Layout": "Вид цветового микшера" } diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index ee694ed4fe..b2c4f9ec98 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2354,5 +2354,9 @@ "Import dropped files without review": "Імпортувати перетягнуті файли без перегляду", "An import is running": "Імпорт уже виконується", "An import is running. Drop photos when it has finished": "Імпорт уже виконується. Перетягніть фото, коли він завершиться", - "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото" + "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото", + "Mixer": "Змішувач", + "HSL": "HSL", + "Adjust": "Налаштування", + "Color Mixer Layout": "Вигляд змішувача кольорів" } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index 270af8a625..41ea1896ec 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -2200,5 +2200,9 @@ "Import dropped files without review": "不经检查直接导入拖入的文件", "An import is running": "正在导入", "An import is running. Drop photos when it has finished": "正在导入。导入完成后再拖放照片", - "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入" + "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入", + "Mixer": "混合器", + "HSL": "HSL", + "Adjust": "调整", + "Color Mixer Layout": "颜色混合器布局" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 0408e23ec8..108ed71f71 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -2157,5 +2157,9 @@ "Import dropped files without review": "不經檢查直接匯入拖放的檔案", "An import is running": "正在匯入", "An import is running. Drop photos when it has finished": "正在匯入。匯入完成後再拖放照片", - "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入" + "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入", + "Mixer": "混合器", + "HSL": "HSL", + "Adjust": "調整", + "Color Mixer Layout": "混色器版面" } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 4fc43172ce..886303d753 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -74,6 +74,8 @@ mod tests_canvas_pan; #[cfg(test)] mod tests_capture_time; #[cfg(test)] +mod tests_color_mixer; +#[cfg(test)] mod tests_compare; #[cfg(test)] mod tests_copy_paste_dialogs; diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 8c249dd365..4c945155d8 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -165,6 +165,9 @@ pub const UI_COMMANDS: &[UiCommand] = &[ ("panel.versions", "Versions", Some("Shift+V"), "Window"), ("panel.activity", "History", None, "Window"), ("panel.close", "Close Panel", None, ""), + // the Color Mixer's layout {tab?: mixer|point, adjust?: hsl|color, group?: hue|sat|lum|all, + // band?: red…magenta}: opens it in the Edit panel (the sliders are the mixer.* controls) + ("view.colorMixer", "Color Mixer Layout", None, ""), // {solo?}: true opens just that section (⌥-click on its header); otherwise opens or closes it ("section.light", "Light", Some("Cmd+1"), "Window>Edit Sections"), ("section.color", "Color", Some("Cmd+2"), "Window>Edit Sections"), @@ -306,6 +309,46 @@ fn panel(app: &mut LightcraftApp, ctx: &egui::Context, p: RightPanel, name: &str let _ = app.session.end_interaction(); } +/// `view.colorMixer`: the Color Mixer's tab, Adjust mode, HSL group and Color-mode band, each +/// optional; the Edit panel opens on it. Returns the layout now shown. +fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result { + use crate::panels::edit::{MIXER_ADJUST, MIXER_GROUPS, MIXER_TABS}; + let choose = |key: &str, items: &[(&str, &str)]| -> Result, String> { + match p.get(key) { + None | Some(Value::Null) => Ok(None), + Some(Value::String(v)) if items.iter().any(|(_, k)| k == v) => Ok(Some(v.clone())), + Some(other) => { + let keys: Vec<&str> = items.iter().map(|(_, k)| *k).collect(); + Err(format!("view.colorMixer: `{key}` must be one of {}, not {other}", keys.join(", "))) + } + } + }; + let bands: Vec<(&str, &str)> = lightcraft_develop::MIXER_BANDS.iter().map(|b| (*b, *b)).collect(); + let (tab, adjust, group, band) = + (choose("tab", &MIXER_TABS)?, choose("adjust", &MIXER_ADJUST)?, choose("group", &MIXER_GROUPS)?, choose("band", &bands)?); + if let Some(v) = tab { + app.ui.mixer_tab = v; + } + if let Some(v) = adjust { + app.ui.mixer_adjust = v; + } + if let Some(v) = group { + app.ui.mixer_group = v; + } + if let Some(v) = band { + app.ui.mixer_mode = v; + } + app.ui.right = RightPanel::Edit; + app.ui.view = ViewMode::Detail; + if !app.ui.section_open("color") { + app.ui.toggle_section("color"); + } + if !app.ui.flyout_open("mixer") { + app.ui.toggle_flyout("mixer"); + } + Ok(json!({"tab": app.ui.mixer_tab, "adjust": app.ui.mixer_adjust, "group": app.ui.mixer_group, "band": app.ui.mixer_mode})) +} + /// `[` / `]` (size ×`k`) and ⇧`[` / ⇧`]` (feather +`df`) for the brush in use: the Remove tool's /// (and its selected spot's) or the Masking brush's. fn adjust_brush(app: &mut LightcraftApp, k: f32, df: f32) -> Value { @@ -1311,6 +1354,7 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option color_mixer_layout(app, p), "panel.close" => { app.ui.right = RightPanel::None; app.ui.presets = false; diff --git a/crates/ui-egui/src/panels/detail.rs b/crates/ui-egui/src/panels/detail.rs index c77c96f42a..6654503f2d 100644 --- a/crates/ui-egui/src/panels/detail.rs +++ b/crates/ui-egui/src/panels/detail.rs @@ -1595,7 +1595,8 @@ pub(crate) fn view_overlay(app: &LightcraftApp, d: &DevelopSettings) -> lightcra return Overlay::Spots(app.ui.spots_threshold.clamp(0.0, 100.0).round() as u8); } let edit = app.ui.right == RightPanel::Edit; - if edit && app.ui.point_color_visualize && app.ui.flyout_open("pointColor") && app.ui.point_color < d.point_colors.len() { + if edit && app.ui.point_color_visualize && app.ui.flyout_open("mixer") && app.ui.mixer_tab == "point" && app.ui.point_color < d.point_colors.len() + { return Overlay::PointColorRange(app.ui.point_color as u8); } if edit && app.ui.hdr_visualize && d.hdr.enabled { diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index 2063580ae4..a5bbb7c971 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -293,15 +293,6 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) { if open { mixer(app, ui, d); } - if !crate::is_bw(d) { - let open = app.ui.flyout_open("pointColor"); - if flyout_row(ui, "pointColor", crate::i18n::tr("Point Color"), Icon::Picker, open).clicked() { - app.ui.toggle_flyout("pointColor"); - } - if open { - point_color(app, ui, d); - } - } let open = app.ui.flyout_open("grading"); if flyout_row(ui, "grading", crate::i18n::tr("Color Grading"), Icon::Presets, open).clicked() { app.ui.toggle_flyout("grading"); @@ -1398,7 +1389,124 @@ fn set_tat(app: &mut LightcraftApp, ctx: &egui::Context, tool: &str, active: boo // ------------------------------------------------------------------------------ colour mixer +/// The Color Mixer's tabs (Mixer | Point Color), the Mixer's Adjust choice (HSL | Color) and the +/// HSL groups (Hue | Saturation | Luminance | All), as (label, key). +pub(crate) const MIXER_TABS: [(&str, &str); 2] = [("Mixer", "mixer"), ("Point Color", "point")]; +pub(crate) const MIXER_ADJUST: [(&str, &str); 2] = [("HSL", "hsl"), ("Color", "color")]; +pub(crate) const MIXER_GROUPS: [(&str, &str); 4] = [("Hue", "hue"), ("Saturation", "sat"), ("Luminance", "lum"), ("All", "all")]; +/// The mixer bands' names, as the HSL sliders are labelled (parallel to `MIXER_BANDS`). +const BAND_NAMES: [&str; 8] = ["Red", "Orange", "Yellow", "Green", "Aqua", "Blue", "Purple", "Magenta"]; + +/// The Color Mixer, laid out as in Lightroom Classic: "Mixer | Point Color" tabs; the Mixer +/// adjusts by HSL (Hue | Saturation | Luminance | All: eight colour sliders per group, each group +/// with its targeted adjustment) or by Color (one colour at a time). The same develop controls +/// (`mixer..`) either way; a B&W photo shows its B&W mix. fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { + if crate::is_bw(d) { + mixer_by_color(app, ui, d); + return; + } + let pick = |ui: &mut egui::Ui, id: &str, items: &[(&str, &str)], current: &str| { + let at = items.iter().position(|(_, k)| *k == current).unwrap_or(0); + egui::Frame::NONE + .inner_margin(egui::Margin { left: 24, right: 22, top: 6, bottom: 2 }) + .show(ui, |ui| crate::widgets::segmented(ui, id, items, Some(at), items.len())) + .inner + .and_then(|i| items.get(i).map(|(_, k)| k.to_string())) + }; + if let Some(k) = pick(ui, "mixerTab", &MIXER_TABS, &app.ui.mixer_tab) { + app.ui.mixer_tab = k; + } + if app.ui.mixer_tab == "point" { + point_color(app, ui, d); + return; + } + let t = Tokens::get(ui.ctx()); + egui::Frame::NONE.inner_margin(egui::Margin { left: 24, right: 22, top: 4, bottom: 0 }).show(ui, |ui| { + ui.label(egui::RichText::new(crate::i18n::tr("Adjust")).color(t.text_dim).size(11.5)); + }); + if let Some(k) = pick(ui, "mixerAdjust", &MIXER_ADJUST, &app.ui.mixer_adjust) { + app.ui.mixer_adjust = k; + } + if app.ui.mixer_adjust == "color" { + mixer_by_color(app, ui, d); + return; + } + // HSL: Hue | Saturation | Luminance | All + egui::Frame::NONE.inner_margin(egui::Margin { left: 24, right: 22, top: 6, bottom: 2 }).show(ui, |ui| { + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 14.0; + for (label, key) in MIXER_GROUPS { + if group_tab(ui, &format!("mixerGroup-{key}"), crate::i18n::tr(label), app.ui.mixer_group == key).clicked() { + app.ui.mixer_group = key.to_string(); + } + } + }); + }); + let groups: &[(&str, &str)] = match app.ui.mixer_group.as_str() { + "sat" => &MIXER_GROUPS[1..2], + "lum" => &MIXER_GROUPS[2..3], + "all" => &MIXER_GROUPS[..3], + _ => &MIXER_GROUPS[..1], + }; + let all = groups.len() > 1; + for (label, key) in groups { + // the group's targeted adjustment (and, in All, its heading) + egui::Frame::NONE.inner_margin(egui::Margin { left: 20, right: 22, top: if all { 8 } else { 2 }, bottom: 0 }).show(ui, |ui| { + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 6.0; + let tool = format!("tat:{key}"); + let active = app.ui.tool == tool; + if crate::widgets::icon_button( + ui, + &format!("tatMixer-{key}"), + Icon::Target, + vec2(24.0, 24.0), + active, + true, + "Targeted adjustment: drag up/down on the photo to adjust the colours there", + ) + .clicked() + { + set_tat(app, ui.ctx(), &tool, active); + } + if all { + let r = ui.label(egui::RichText::new(crate::i18n::tr(label)).color(t.text).strong().size(12.0)); + register(ui.ctx(), format!("mixerHeading:{key}"), r.rect); + } + }); + }); + for (band, name) in lightcraft_develop::MIXER_BANDS.iter().zip(BAND_NAMES) { + let id = format!("mixer.{band}.{key}"); + let Some(spec) = controls::find(&id) else { continue }; + // labelled by the colour alone: the group says what it adjusts + let v = controls::get(d, &id).unwrap_or(spec.default); + let out = slider(ui, spec, v, true, Some(name)); + apply_slider_out(app, spec, out, |app, v| app.run("develop.set", json!({"control": id, "value": v}))); + } + } +} + +/// A word tab (Hue, Saturation…): bright and underlined when it is the one shown. +fn group_tab(ui: &mut egui::Ui, id: &str, label: &str, active: bool) -> egui::Response { + let t = Tokens::get(ui.ctx()); + let font = t.semibold(11.5); + let (r, resp) = { + let galley = ui.painter().layout_no_wrap(label.to_string(), font.clone(), t.text); + ui.allocate_exact_size(vec2(galley.size().x, 20.0), Sense::click()) + }; + crate::widgets::announce_selected(&resp, label.to_string(), active); + register(ui.ctx(), format!("button:{id}"), r); + let colour = if active || resp.hovered() { t.text } else { t.text_dim }; + ui.painter().text(pos2(r.left(), r.center().y), Align2::LEFT_CENTER, label, font, colour); + if active { + ui.painter().line_segment([pos2(r.left(), r.bottom() - 1.0), pos2(r.right(), r.bottom() - 1.0)], Stroke::new(1.5, t.text)); + } + resp +} + +/// The Mixer by colour (and a B&W photo's mix): a dot per colour, then that colour's sliders. +fn mixer_by_color(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { let t = Tokens::get(ui.ctx()); let bands = lightcraft_develop::MIXER_BANDS; let sel = bands.iter().position(|b| *b == app.ui.mixer_mode).unwrap_or(0); diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 0bbd619d81..fa2d0607f0 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -977,8 +977,15 @@ pub struct UiState { pub dragging_section: Option, /// Selected curve channel in the Curve flyout. pub curve_channel: String, - /// Selected mixer mode: "hue" | "saturation" | "luminance" | "all". + /// The colour band shown in the Color Mixer's Color mode (one of `MIXER_BANDS`). pub mixer_mode: String, + /// The Color Mixer's tab: "mixer" | "point" (Point Color). Remembered. + pub mixer_tab: String, + /// What the Mixer adjusts by: "hsl" (eight sliders per Hue / Saturation / Luminance) | + /// "color" (one colour at a time). Remembered; HSL by default. + pub mixer_adjust: String, + /// The HSL group shown: "hue" | "sat" | "lum" | "all". Remembered. + pub mixer_group: String, /// Selected colour grading tab: "3way" | "shadows" | "midtones" | "highlights". pub grading_mode: String, /// Colour grading wheels (shadows, midtones, highlights) hidden for viewing by their eye, and @@ -1562,7 +1569,10 @@ impl Default for UiState { dragging_album: None, dragging_section: None, curve_channel: "parametric".into(), - mixer_mode: "hue".into(), + mixer_mode: "red".into(), + mixer_tab: "mixer".into(), + mixer_adjust: "hsl".into(), + mixer_group: "hue".into(), grading_mode: "3way".into(), grading_hidden: None, tool: String::new(), diff --git a/crates/ui-egui/src/tests_color_mixer.rs b/crates/ui-egui/src/tests_color_mixer.rs new file mode 100644 index 0000000000..b863c949b7 --- /dev/null +++ b/crates/ui-egui/src/tests_color_mixer.rs @@ -0,0 +1,117 @@ +//! The Color Mixer laid out as in Lightroom Classic (item 13 of the evening retest): "Mixer | +//! Point Color" tabs, Adjust HSL / Color, and in HSL the Hue | Saturation | Luminance | All groups +//! of eight colour sliders, each with its targeted adjustment. HSL is the default and the choice +//! is remembered; the sliders are the same `mixer.*` controls. + +use std::time::Duration; + +use serde_json::json; + +use crate::headless::Headless; +use crate::{LightcraftApp, Services}; + +const T: Duration = Duration::from_secs(20); +const SETTLE: Duration = Duration::from_secs(120); +const BANDS: [&str; 8] = ["red", "orange", "yellow", "green", "aqua", "blue", "purple", "magenta"]; + +fn mixer() -> Headless { + let services = Services { png: None, ..Default::default() }; + let app = LightcraftApp::new(lightcraft_engine::Session::with_demo(), services); + let mut h = Headless::new(app, [1300.0, 2600.0], 1.0); + let r = h.request("ui.set", json!({"view": "detail", "right": "edit"}), T); + assert_eq!(r["ok"], true, "{r}"); + run(&mut h, "view.colorMixer", json!({})); + h.settle(SETTLE); + h +} + +fn run(h: &mut Headless, command: &str, params: serde_json::Value) -> serde_json::Value { + let r = h.request("engine.execute", json!({"command": command, "params": params}), T); + assert_eq!(r["ok"], true, "{command}: {r}"); + h.step(); + h.step(); + r["result"].clone() +} + +fn click(h: &mut Headless, id: &str) { + let r = h.request("ui.clickWidget", json!({"id": id}), T); + assert_eq!(r["ok"], true, "{id}: {r}"); + h.step(); + h.step(); +} + +fn has(h: &Headless, id: &str) -> bool { + h.app.widgets.iter().any(|(w, _)| w == id) +} + +fn sliders(h: &Headless, part: &str) -> usize { + BANDS.iter().filter(|b| has(h, &format!("slider:mixer.{b}.{part}"))).count() +} + +#[test] +fn hsl_is_the_default_with_eight_sliders_per_group() { + let mut h = mixer(); + for id in ["button:mixerTab-mixer", "button:mixerTab-point", "button:mixerAdjust-hsl", "button:mixerAdjust-color"] { + assert!(has(&h, id), "{id}"); + } + for g in ["hue", "sat", "lum", "all"] { + assert!(has(&h, &format!("button:mixerGroup-{g}")), "{g}"); + } + assert_eq!((h.app.ui.mixer_adjust.as_str(), h.app.ui.mixer_group.as_str()), ("hsl", "hue"), "HSL, Hue first"); + assert_eq!((sliders(&h, "hue"), sliders(&h, "sat"), sliders(&h, "lum")), (8, 0, 0), "eight Hue sliders"); + assert!(has(&h, "icon:tatMixer-hue"), "with its targeted adjustment"); + click(&mut h, "button:mixerGroup-sat"); + assert_eq!((sliders(&h, "hue"), sliders(&h, "sat"), sliders(&h, "lum")), (0, 8, 0)); + assert!(has(&h, "icon:tatMixer-sat")); + click(&mut h, "button:mixerGroup-lum"); + assert_eq!((sliders(&h, "hue"), sliders(&h, "sat"), sliders(&h, "lum")), (0, 0, 8)); + // All: the three groups stacked, each with a heading and its targeted adjustment + click(&mut h, "button:mixerGroup-all"); + assert_eq!((sliders(&h, "hue"), sliders(&h, "sat"), sliders(&h, "lum")), (8, 8, 8)); + let at = |h: &Headless, id: &str| h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| r.top()).unwrap_or_else(|| panic!("no {id}")); + for g in ["hue", "sat", "lum"] { + assert!(has(&h, &format!("mixerHeading:{g}")) && has(&h, &format!("icon:tatMixer-{g}")), "{g}"); + } + assert!(at(&h, "mixerHeading:hue") < at(&h, "slider:mixer.red.hue")); + assert!(at(&h, "slider:mixer.magenta.hue") < at(&h, "mixerHeading:sat")); + assert!(at(&h, "slider:mixer.magenta.sat") < at(&h, "mixerHeading:lum")); + // a group's targeted adjustment arms its tool + click(&mut h, "icon:tatMixer-sat"); + assert_eq!(h.app.ui.tool, "tat:sat"); +} + +#[test] +fn the_sliders_are_the_mixer_controls() { + let mut h = mixer(); + run(&mut h, "develop.set", json!({"control": "mixer.orange.hue", "value": -30})); + let id = h.app.session.active().expect("a photo"); + assert_eq!(h.app.session.develop_of(id).expect("settings").mixer.orange.hue, -30.0); + // the same value in Color mode, Orange + run(&mut h, "view.colorMixer", json!({"adjust": "color", "band": "orange"})); + h.settle(SETTLE); + assert!(has(&h, "mixerBand:orange"), "the colour dots"); + assert_eq!((sliders(&h, "hue"), sliders(&h, "sat"), sliders(&h, "lum")), (1, 1, 1), "one colour's three sliders"); + assert!(has(&h, "slider:mixer.orange.hue")); +} + +#[test] +fn the_choice_is_remembered_and_point_color_is_a_tab() { + let mut h = mixer(); + click(&mut h, "button:mixerAdjust-color"); + assert_eq!(h.app.ui.mixer_adjust, "color"); + assert!(has(&h, "mixerBand:red")); + // kept with the UI settings (a restart) + let saved = serde_json::to_value(&h.app.ui).expect("ui state"); + let back: crate::UiState = serde_json::from_value(saved).expect("reads back"); + assert_eq!(back.mixer_adjust, "color"); + // older settings without it start in HSL + let old: crate::UiState = serde_json::from_value(json!({})).expect("defaults"); + assert_eq!((old.mixer_tab.as_str(), old.mixer_adjust.as_str(), old.mixer_group.as_str()), ("mixer", "hsl", "hue")); + // Point Color is the second tab + click(&mut h, "button:mixerTab-point"); + assert!(has(&h, "icon:pointColorPicker"), "Point Color's eyedropper"); + assert_eq!(sliders(&h, "hue") + sliders(&h, "sat") + sliders(&h, "lum"), 0); + // the command checks what it is given + let r = h.request("engine.execute", json!({"command": "view.colorMixer", "params": {"group": "chroma"}}), T); + assert_eq!(r["ok"], false, "{r}"); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 080680b9ff..74b3032f17 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-24 · **Change:** minor (KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (LR-EDIT-COLOR-MIXER-HSL: the Color Mixer laid out as in Lightroom Classic, with an HSL mode; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -195,7 +195,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-EDIT-COLOR-TINT | Tint | P0 | ✅ | `ctl:wb.tint`, `docs/tint-direction.md` | DNG / Lightroom sign: negative (left) adds green, positive (right) magenta; XMP `crs:Tint` values render as in Lightroom (issue #188); CPU/GPU regression tests | | LR-EDIT-COLOR-VIBRANCE | Vibrance | P0 | ✅ | `ctl:color.vibrance` | | | LR-EDIT-COLOR-SATURATION | Saturation | P0 | ✅ | `ctl:color.saturation` | | -| LR-EDIT-COLOR-MIXER-HSL | 8-band colour mixer | P0 | ✅ | `ctl:mixer.*` | no targeted (drag-on-image) mode | +| LR-EDIT-COLOR-MIXER-HSL | 8-band colour mixer | P0 | ✅ | `ctl:mixer.*`, `cmd:view.colorMixer`, `crates/ui-egui/src/panels/edit.rs` (`mixer`), `crates/ui-egui/src/tests_color_mixer.rs` | Lightroom Classic's layout: Mixer \| Point Color tabs, then Adjust HSL / Color; HSL shows Hue \| Saturation \| Luminance \| All (the three stacked with headings), eight sliders per group with coloured tracks and a targeted adjustment per group; Color shows one colour at a time; HSL by default, remembered | | LR-EDIT-COLOR-MIXER-BW | B&W mix | P1 | ✅ | `ctl:bw.*`, `cmd:develop.autoBwMix` | eight bands; Auto pushes each hue band's colourful pixels away from the mean lightness (own rule) | | LR-EDIT-COLOR-POINTCOLOR | Point colour | P1 | ✅ | `cmd:pointColor.pick`, `cmd:pointColor.delete` | | | LR-EDIT-COLOR-GRADING | Colour grading wheels | P0 | ✅ | `ctl:grading.*`, `crates/ui-egui/src/panels/edit.rs` (`grading`) | 3-Way / Shadows / Midtones / Highlights tabs; a range tab shows one large wheel with Hue, Saturation and Luminance sliders; Blending and Balance in every tab; 3-Way shows the hovered wheel's hue and saturation; every wheel marks its neutral centre; wheel modifiers as in Lightroom: Shift-drag keeps the puck's hue and changes saturation only (the spoke is the guide; a puck at the centre has no hue, so it takes the angle where the pointer pressed), Cmd/Ctrl-drag keeps the saturation and changes hue only (the circle is the guide), Alt/Option-drag fine-adjusts at 0.1x and combines with either lock, and a hover tooltip lists them (issues #559, #1160; tests `shift_dragging_across_the_tangent_keeps_the_hue_and_moves_saturation`, `shift_drag_keeps_the_pucks_hue_wherever_the_pointer_grabs`, `cmd_drag_keeps_the_saturation_and_changes_only_the_hue`, `alt_drag_fine_adjusts_to_a_tenth_of_the_pointers_travel`, `alt_works_with_shift_and_cmd_constraints` in `crates/ui-egui/src/tests_grading.rs`); a wheel drag holds the pointer as in Lightroom: hidden while dragging (the puck follows the mouse's travel; on macOS the pointer is locked in place), back where the button went down on release, and given back at once on Esc, a lost window focus or a wheel that goes away mid-drag; the browser can't move the pointer, so there it only shows again where the drag ended (issue #1899; tests `a_held_wheel_follows_the_mouses_motion_not_where_the_pointer_sits`, `a_wheel_drag_hides_the_pointer_and_releasing_puts_it_back_where_it_was_pressed`, `escape_or_losing_focus_gives_the_pointer_back_mid_drag`, `a_wheel_that_goes_away_mid_drag_gives_the_pointer_back`); the large wheel adds 25/50/75 % saturation rings (issue #559); each wheel's eye hides its effect for viewing only (`RenderJob::with_hidden_grading`, not saved, export unaffected) (issue #737). No Global wheel tab yet | @@ -799,6 +799,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | Date | Change | Summary | |---|---|---| +| 2026-10-25 | minor | LR-EDIT-COLOR-MIXER-HSL: Lightroom Classic's layout (Mixer \| Point Color tabs, Adjust HSL / Color, Hue \| Saturation \| Luminance \| All with a targeted adjustment per group), `view.colorMixer`; status unchanged (✅) | | 2026-10-24 | minor | KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 (`keyword.nextSet`, `keyword.previousSet`) go to the next / previous keyword set; status counts unchanged (KEYC-METADATA stays 🟡) | | 2026-10-24 | minor | KEYC-METADATA: ⌘K / Ctrl+K (`panel.addKeywords`, Add Keywords) shows the Keywords panel, opens Keywording and puts the cursor in the Add keyword box; status counts unchanged (KEYC-METADATA stays 🟡) | | 2026-10-24 | patch | LR-LIB-RATING, LR-LIB-DELETE: a slider drag still open when a rating, flag or label takes the photo out of the view, or when the photo is deleted, ends as its own undo step before the selection moves on, as moving to the next photo does; LR-BEHAV-LOCALIZE lists all 18 languages; status unchanged | diff --git a/docs/whats-new.md b/docs/whats-new.md index c6c2592003..b6bf0e00b2 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -1,5 +1,14 @@ # What's new in LightCraft +## 2026-10-25 + +### Color Mixer: HSL +- **Color Mixer: HSL**, laid out as in Lightroom Classic: **Mixer | Point Color** tabs, then + **Adjust: HSL / Color**. HSL shows **Hue, Saturation, Luminance** or **All** (the three stacked, + each with its heading): eight colour sliders each, with coloured tracks, and a targeted + adjustment per group. HSL is the default and your choice is remembered. Point Color is now the + Color Mixer's second tab. + ## 2026-10-24 ### Relative-date filters and smart albums follow the clock From 88b92cd71da3e547c4f85a3d8e809c0aca4c5e19 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 26 Oct 2026 03:02:52 +1000 Subject: [PATCH 02/14] LR-EDIT-COLOR-MIXER-HSL: review fixes (hidden targeted adjustment, full-screen preview, B&W Point Color view) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/menus.rs | 4 +++ crates/ui-egui/src/panels/detail.rs | 8 +++++- crates/ui-egui/src/panels/edit.rs | 18 +++++++++++++ crates/ui-egui/src/tests_color_mixer.rs | 36 +++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 4c945155d8..68db948a6a 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -338,8 +338,12 @@ fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result lightcra return Overlay::Spots(app.ui.spots_threshold.clamp(0.0, 100.0).round() as u8); } let edit = app.ui.right == RightPanel::Edit; - if edit && app.ui.point_color_visualize && app.ui.flyout_open("mixer") && app.ui.mixer_tab == "point" && app.ui.point_color < d.point_colors.len() + // (a B&W photo's mixer shows its B&W mix, not Point Color) + if edit + && app.ui.point_color_visualize + && app.ui.flyout_open("mixer") + && app.ui.mixer_tab == "point" + && !crate::is_bw(d) + && app.ui.point_color < d.point_colors.len() { return Overlay::PointColorRange(app.ui.point_color as u8); } diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index a5bbb7c971..3f93dd28b0 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -1397,11 +1397,26 @@ pub(crate) const MIXER_GROUPS: [(&str, &str); 4] = [("Hue", "hue"), ("Saturation /// The mixer bands' names, as the HSL sliders are labelled (parallel to `MIXER_BANDS`). const BAND_NAMES: [&str; 8] = ["Red", "Orange", "Yellow", "Green", "Aqua", "Blue", "Purple", "Magenta"]; +/// A Color Mixer targeted adjustment (`tat:hue|sat|lum`) whose button the mixer's layout no +/// longer shows is put down: Point Color shows none, HSL only the chosen group's (all three in +/// All), Color mode all three. Dragging on the photo would otherwise change a hidden group. +pub(crate) fn drop_hidden_mixer_tool(app: &mut LightcraftApp) { + let Some(key) = app.ui.tool.strip_prefix("tat:") else { return }; + if !matches!(key, "hue" | "sat" | "lum") { + return; + } + let shown = app.ui.mixer_tab != "point" && (app.ui.mixer_adjust == "color" || app.ui.mixer_group == "all" || app.ui.mixer_group == key); + if !shown { + app.ui.tool.clear(); + } +} + /// The Color Mixer, laid out as in Lightroom Classic: "Mixer | Point Color" tabs; the Mixer /// adjusts by HSL (Hue | Saturation | Luminance | All: eight colour sliders per group, each group /// with its targeted adjustment) or by Color (one colour at a time). The same develop controls /// (`mixer..`) either way; a B&W photo shows its B&W mix. fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { + // (the B&W mix keeps its own Luminance targeted adjustment) if crate::is_bw(d) { mixer_by_color(app, ui, d); return; @@ -1417,6 +1432,7 @@ fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { if let Some(k) = pick(ui, "mixerTab", &MIXER_TABS, &app.ui.mixer_tab) { app.ui.mixer_tab = k; } + drop_hidden_mixer_tool(app); if app.ui.mixer_tab == "point" { point_color(app, ui, d); return; @@ -1427,6 +1443,7 @@ fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { }); if let Some(k) = pick(ui, "mixerAdjust", &MIXER_ADJUST, &app.ui.mixer_adjust) { app.ui.mixer_adjust = k; + drop_hidden_mixer_tool(app); } if app.ui.mixer_adjust == "color" { mixer_by_color(app, ui, d); @@ -1439,6 +1456,7 @@ fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { for (label, key) in MIXER_GROUPS { if group_tab(ui, &format!("mixerGroup-{key}"), crate::i18n::tr(label), app.ui.mixer_group == key).clicked() { app.ui.mixer_group = key.to_string(); + drop_hidden_mixer_tool(app); } } }); diff --git a/crates/ui-egui/src/tests_color_mixer.rs b/crates/ui-egui/src/tests_color_mixer.rs index b863c949b7..40ccb29bc3 100644 --- a/crates/ui-egui/src/tests_color_mixer.rs +++ b/crates/ui-egui/src/tests_color_mixer.rs @@ -115,3 +115,39 @@ fn the_choice_is_remembered_and_point_color_is_a_tab() { let r = h.request("engine.execute", json!({"command": "view.colorMixer", "params": {"group": "chroma"}}), T); assert_eq!(r["ok"], false, "{r}"); } + +/// A Color Mixer targeted adjustment whose button the layout no longer shows is put down (it would +/// change a hidden group); the command leaves full-screen preview, where the mixer can't be seen. +#[test] +fn a_hidden_groups_targeted_adjustment_is_put_down_and_the_command_shows_the_mixer() { + let mut h = mixer(); + click(&mut h, "icon:tatMixer-hue"); + assert_eq!(h.app.ui.tool, "tat:hue"); + click(&mut h, "button:mixerGroup-all"); + assert_eq!(h.app.ui.tool, "tat:hue", "All shows the Hue group's button too"); + click(&mut h, "button:mixerGroup-sat"); + assert_eq!(h.app.ui.tool, "", "Saturation hides Hue's"); + click(&mut h, "icon:tatMixer-sat"); + run(&mut h, "view.colorMixer", json!({"adjust": "color"})); + assert_eq!(h.app.ui.tool, "tat:sat", "Color mode shows all three"); + run(&mut h, "view.colorMixer", json!({"tab": "point"})); + assert_eq!(h.app.ui.tool, "", "Point Color shows none"); + h.app.ui.fullscreen = true; + run(&mut h, "view.colorMixer", json!({"tab": "mixer"})); + assert!(!h.app.ui.fullscreen); +} + +/// A B&W photo's mixer shows its B&W mix: Point Color's range view can't stay on the photo. +#[test] +fn point_colors_range_view_is_off_for_a_bw_photo() { + let mut h = mixer(); + run(&mut h, "view.colorMixer", json!({"tab": "point"})); + h.app.ui.point_color_visualize = true; + h.app.ui.point_color = 0; + let id = h.app.session.active().expect("a photo"); + let mut d = (*h.app.session.develop_of(id).expect("settings")).clone(); + d.point_colors.push(Default::default()); + assert!(matches!(crate::panels::detail::view_overlay(&h.app, &d), lightcraft_pipeline::Overlay::PointColorRange(0))); + d.treatment = lightcraft_develop::Treatment::Bw; + assert!(!matches!(crate::panels::detail::view_overlay(&h.app, &d), lightcraft_pipeline::Overlay::PointColorRange(_))); +} From 57da3cfe1d38ba982c00884409db5041111eac73 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 26 Oct 2026 03:26:26 +1000 Subject: [PATCH 03/14] LR-EDIT-COLOR-MIXER-HSL: a B&W photo keeps its Luminance targeted adjustment Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/edit.rs | 10 ++++++++-- crates/ui-egui/src/tests_color_mixer.rs | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index 3f93dd28b0..012a1840f2 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -1398,14 +1398,20 @@ pub(crate) const MIXER_GROUPS: [(&str, &str); 4] = [("Hue", "hue"), ("Saturation const BAND_NAMES: [&str; 8] = ["Red", "Orange", "Yellow", "Green", "Aqua", "Blue", "Purple", "Magenta"]; /// A Color Mixer targeted adjustment (`tat:hue|sat|lum`) whose button the mixer's layout no -/// longer shows is put down: Point Color shows none, HSL only the chosen group's (all three in +/// longer shows is put down: a B&W photo shows Luminance's only, Point Color none, HSL only the chosen group's (all three in /// All), Color mode all three. Dragging on the photo would otherwise change a hidden group. pub(crate) fn drop_hidden_mixer_tool(app: &mut LightcraftApp) { let Some(key) = app.ui.tool.strip_prefix("tat:") else { return }; if !matches!(key, "hue" | "sat" | "lum") { return; } - let shown = app.ui.mixer_tab != "point" && (app.ui.mixer_adjust == "color" || app.ui.mixer_group == "all" || app.ui.mixer_group == key); + // a B&W photo's mixer is its B&W mix, with only the Luminance targeted adjustment + let bw = app.session.active().and_then(|id| app.session.develop_of(id)).is_some_and(|d| crate::is_bw(&d)); + let shown = if bw { + key == "lum" + } else { + app.ui.mixer_tab != "point" && (app.ui.mixer_adjust == "color" || app.ui.mixer_group == "all" || app.ui.mixer_group == key) + }; if !shown { app.ui.tool.clear(); } diff --git a/crates/ui-egui/src/tests_color_mixer.rs b/crates/ui-egui/src/tests_color_mixer.rs index 40ccb29bc3..b344b924c4 100644 --- a/crates/ui-egui/src/tests_color_mixer.rs +++ b/crates/ui-egui/src/tests_color_mixer.rs @@ -151,3 +151,16 @@ fn point_colors_range_view_is_off_for_a_bw_photo() { d.treatment = lightcraft_develop::Treatment::Bw; assert!(!matches!(crate::panels::detail::view_overlay(&h.app, &d), lightcraft_pipeline::Overlay::PointColorRange(_))); } + +/// A B&W photo's mixer always shows its Luminance targeted adjustment: the command keeps it. +#[test] +fn a_bw_photos_luminance_targeted_adjustment_stays() { + let mut h = mixer(); + run(&mut h, "develop.treatment", json!({"bw": true})); + h.app.ui.tool = "tat:lum".into(); + run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.tool, "tat:lum"); + h.app.ui.tool = "tat:hue".into(); + run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.tool, "", "no Hue on a B&W photo"); +} From 41d90a0d6972c17da8c27079316c01755e1ba8da Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 26 Oct 2026 11:53:53 +1000 Subject: [PATCH 04/14] LR-EDIT-COLOR-MIXER-HSL: widgets::register takes the Ui on egui 0.37 Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/edit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index eb39769d21..ac4415827c 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -1497,7 +1497,7 @@ fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { } if all { let r = ui.label(egui::RichText::new(crate::i18n::tr(label)).color(t.text).strong().size(12.0)); - register(ui.ctx(), format!("mixerHeading:{key}"), r.rect); + register(ui, format!("mixerHeading:{key}"), r.rect); } }); }); @@ -1521,7 +1521,7 @@ fn group_tab(ui: &mut egui::Ui, id: &str, label: &str, active: bool) -> egui::Re ui.allocate_exact_size(vec2(galley.size().x, 20.0), Sense::click()) }; crate::widgets::announce_selected(&resp, label.to_string(), active); - register(ui.ctx(), format!("button:{id}"), r); + register(ui, format!("button:{id}"), r); let colour = if active || resp.hovered() { t.text } else { t.text_dim }; ui.painter().text(pos2(r.left(), r.center().y), Align2::LEFT_CENTER, label, font, colour); if active { From af0ec224456f132d9326d523c849dd739c21dc05 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 26 Oct 2026 12:16:55 +1000 Subject: [PATCH 05/14] LR-EDIT-COLOR-MIXER-HSL: Point Color's picker is put down when its tab is left Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/edit.rs | 11 +++++++++-- crates/ui-egui/src/tests_color_mixer.rs | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index ac4415827c..745b1a0b22 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -1402,12 +1402,19 @@ const BAND_NAMES: [&str; 8] = ["Red", "Orange", "Yellow", "Green", "Aqua", "Blue /// longer shows is put down: a B&W photo shows Luminance's only, Point Color none, HSL only the chosen group's (all three in /// All), Color mode all three. Dragging on the photo would otherwise change a hidden group. pub(crate) fn drop_hidden_mixer_tool(app: &mut LightcraftApp) { + // a B&W photo's mixer is its B&W mix, with only the Luminance targeted adjustment + let bw = app.session.active().and_then(|id| app.session.develop_of(id)).is_some_and(|d| crate::is_bw(&d)); + // Point Color's picker lives on its own tab, which a B&W photo doesn't have + if app.ui.tool == "pointColor" { + if bw || app.ui.mixer_tab != "point" { + app.ui.tool.clear(); + } + return; + } let Some(key) = app.ui.tool.strip_prefix("tat:") else { return }; if !matches!(key, "hue" | "sat" | "lum") { return; } - // a B&W photo's mixer is its B&W mix, with only the Luminance targeted adjustment - let bw = app.session.active().and_then(|id| app.session.develop_of(id)).is_some_and(|d| crate::is_bw(&d)); let shown = if bw { key == "lum" } else { diff --git a/crates/ui-egui/src/tests_color_mixer.rs b/crates/ui-egui/src/tests_color_mixer.rs index b344b924c4..3391aafcff 100644 --- a/crates/ui-egui/src/tests_color_mixer.rs +++ b/crates/ui-egui/src/tests_color_mixer.rs @@ -164,3 +164,15 @@ fn a_bw_photos_luminance_targeted_adjustment_stays() { run(&mut h, "view.colorMixer", json!({})); assert_eq!(h.app.ui.tool, "", "no Hue on a B&W photo"); } + +/// Point Color's picker is put down when its tab is left, so a click on the photo picks no colour. +#[test] +fn point_colors_picker_is_put_down_when_its_tab_is_left() { + let mut h = mixer(); + run(&mut h, "view.colorMixer", json!({"tab": "point"})); + h.app.ui.tool = "pointColor".into(); + run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.tool, "pointColor", "still on its tab"); + run(&mut h, "view.colorMixer", json!({"tab": "mixer"})); + assert_eq!(h.app.ui.tool, "", "the Mixer tab puts it down"); +} From 9a58eced99a66c043616f0027f3fa24b8fae2836 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 26 Oct 2026 12:24:03 +1000 Subject: [PATCH 06/14] LR-EDIT-COLOR-MIXER-HSL: Color Mixer ends a slideshow and a drag properly, reports a B&W photo's mixer; B&W profiles' targeted Luminance moves the B&W mix Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/color.rs | 3 ++- crates/engine/src/tests_color.rs | 5 +++++ crates/ui-egui/src/menus.rs | 13 ++++++++++--- crates/ui-egui/src/tests_color_mixer.rs | 11 +++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/color.rs b/crates/engine/src/cmd/color.rs index 111159e7a2..9935ac9b3f 100644 --- a/crates/engine/src/cmd/color.rs +++ b/crates/engine/src/cmd/color.rs @@ -138,7 +138,8 @@ fn targeted(s: &mut Session, p: &Value) -> Result { let [_, _, h] = encoded_to_oklch(e); let w = lightcraft_pipeline::colorops::band_weights(h); let top = w.iter().cloned().fold(0.0f32, f32::max).max(1e-6); - let bw = d.treatment == Treatment::Bw || d.profile.id == "lc.mono"; + // (a B&W profile, as the Color Mixer panel shows it: its B&W mix) + let bw = d.treatment == Treatment::Bw || d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw."); label = if bw { "B&W Mix" } else { "Color Mixer" }; for (i, band) in MIXER_BANDS.iter().enumerate() { let k = (w[i] / top) as f64; diff --git a/crates/engine/src/tests_color.rs b/crates/engine/src/tests_color.rs index e526d4c47b..a8e5820ce3 100644 --- a/crates/engine/src/tests_color.rs +++ b/crates/engine/src/tests_color.rs @@ -120,6 +120,11 @@ fn targeted_adjustment_on_curve_and_mixer() { assert!(o.values().any(|v| v.as_f64() == Some(-30.0)), "{r}"); assert!(o.values().all(|v| v.as_f64().unwrap() < 0.0)); assert!(s.execute("develop.targeted", &json!({"target": "nope", "x": 0.5, "y": 0.5, "delta": 1})).is_err()); + // a B&W profile's photo: the Luminance targeted adjustment moves its B&W mix, as the panel shows + s.execute("develop.profile", &json!({"id": "lc.bw.mono-rich"})).unwrap(); + let r = s.execute("develop.targeted", &json!({"target": "lum", "x": 0.5, "y": 0.1, "delta": 10})).unwrap(); + let o = r.as_object().unwrap(); + assert!(!o.is_empty() && o.keys().all(|k| k.starts_with("bw.")), "{r}"); } /// Issue #730: on a raw whose camera has measured colour matrices the white-balance commands write Kelvin, mark diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 00acb6dc02..4eddc13311 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -340,18 +340,25 @@ fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result Date: Mon, 26 Oct 2026 14:49:51 +1000 Subject: [PATCH 07/14] LR-EDIT-COLOR-MIXER-HSL: the targeted adjustment samples a B&W profile's photo in colour Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/color.rs | 4 ++++ crates/engine/src/tests_color.rs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/crates/engine/src/cmd/color.rs b/crates/engine/src/cmd/color.rs index 9935ac9b3f..da3501efc7 100644 --- a/crates/engine/src/cmd/color.rs +++ b/crates/engine/src/cmd/color.rs @@ -134,6 +134,10 @@ fn targeted(s: &mut Session, p: &Value) -> Result { d.mixer = Default::default(); d.bw_mix = Default::default(); after_mixer_neutral(d); + // (a B&W profile turns the render grey again: sample the source colour) + if d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw.") { + d.profile = Default::default(); + } })?; let [_, _, h] = encoded_to_oklch(e); let w = lightcraft_pipeline::colorops::band_weights(h); diff --git a/crates/engine/src/tests_color.rs b/crates/engine/src/tests_color.rs index a8e5820ce3..3fc7d9d07d 100644 --- a/crates/engine/src/tests_color.rs +++ b/crates/engine/src/tests_color.rs @@ -119,12 +119,19 @@ fn targeted_adjustment_on_curve_and_mixer() { assert!(!o.is_empty() && o.keys().all(|k| k.starts_with("mixer.") && k.ends_with(".sat")), "{r}"); assert!(o.values().any(|v| v.as_f64() == Some(-30.0)), "{r}"); assert!(o.values().all(|v| v.as_f64().unwrap() < 0.0)); + let top_band = |o: &serde_json::Map| { + let (k, _) = o.iter().max_by(|a, b| a.1.as_f64().unwrap().abs().total_cmp(&b.1.as_f64().unwrap().abs())).unwrap(); + k.split('.').nth(1).unwrap().to_string() + }; + let sky_band = top_band(o); assert!(s.execute("develop.targeted", &json!({"target": "nope", "x": 0.5, "y": 0.5, "delta": 1})).is_err()); // a B&W profile's photo: the Luminance targeted adjustment moves its B&W mix, as the panel shows s.execute("develop.profile", &json!({"id": "lc.bw.mono-rich"})).unwrap(); let r = s.execute("develop.targeted", &json!({"target": "lum", "x": 0.5, "y": 0.1, "delta": 10})).unwrap(); let o = r.as_object().unwrap(); assert!(!o.is_empty() && o.keys().all(|k| k.starts_with("bw.")), "{r}"); + // ... the band of the sky's own colour, not of the grey the profile renders + assert_eq!(top_band(o), sky_band, "{r}"); } /// Issue #730: on a raw whose camera has measured colour matrices the white-balance commands write Kelvin, mark From 3e0efdf929c3ed46309096be2c65edd0dce4dcb0 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sat, 31 Oct 2026 13:19:40 +1000 Subject: [PATCH 08/14] LR-EDIT-COLOR-MIXER-HSL: the HSL group sliders name their imports after main's explicit-import refactor Main (6774d1419) replaced the edit panel's wildcard imports with explicit lists; the HSL group rows' `slider`, `apply_slider_out` and `controls` were no longer in scope. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/edit/mixer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/edit/mixer.rs b/crates/ui-egui/src/panels/edit/mixer.rs index 52d60bfa9d..4c078e32bc 100644 --- a/crates/ui-egui/src/panels/edit/mixer.rs +++ b/crates/ui-egui/src/panels/edit/mixer.rs @@ -1,6 +1,10 @@ use super::curve::set_tat; use super::sliders::{control, sub_title}; -use super::{BAND_COLORS, Color32, DevelopSettings, Icon, LightcraftApp, Sense, Stroke, Tokens, hex, json, paint, register, text_button, vec2}; +use super::{ + BAND_COLORS, Color32, DevelopSettings, Icon, LightcraftApp, Sense, Stroke, Tokens, apply_slider_out, controls, hex, json, paint, register, + slider, text_button, vec2, +}; +use egui::{Align2, pos2}; // ------------------------------------------------------------------------------ colour mixer From 3c9a695345ce5299aa5866f68258892922528aa3 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 09:30:43 +1000 Subject: [PATCH 09/14] LR-EDIT-COLOR-MIXER-HSL: B&W targeting sees the mixer's shifts; hidden pickers put down; HSL controls named by group (CodeRabbit, #2955) - The targeted adjustment on a B&W photo samples the colour after the colour mixer (the B&W mix comes after it), so it moves the band that colours the pixel. - view.colorMixer from another panel puts that panel's tool down (Masking's colour picker), as a panel switch does. - The B&W mix view puts down a picker it doesn't show (Point Color) before it draws. - A screen reader hears each HSL slider and targeted adjustment with its group ('Red (Hue)'). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/color.rs | 11 +++++---- crates/engine/src/tests/color.rs | 12 ++++++++++ crates/ui-egui/src/menus/run.rs | 6 +++++ crates/ui-egui/src/panels/edit/mixer.rs | 23 ++++++++++++------- crates/ui-egui/src/tests/color_mixer.rs | 30 +++++++++++++++++++++++++ crates/ui-egui/src/widgets.rs | 8 ++++++- 6 files changed, 77 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/color.rs b/crates/engine/src/cmd/color.rs index da3501efc7..f384ae3355 100644 --- a/crates/engine/src/cmd/color.rs +++ b/crates/engine/src/cmd/color.rs @@ -129,9 +129,14 @@ fn targeted(s: &mut Session, p: &Value) -> Result { } } "hue" | "sat" | "lum" => { - // the hue the colour mixer sees there (the mixer and everything after it neutralized) + // (a B&W profile, as the Color Mixer panel shows it: its B&W mix) + let bw = d.treatment == Treatment::Bw || d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw."); + // the hue the colour mixer sees there (the mixer and everything after it neutralized); the B&W mix + // comes after the mixer, so for it the mixer's own adjustments stay let e = probe(s, c, x, y, |d| { - d.mixer = Default::default(); + if !bw { + d.mixer = Default::default(); + } d.bw_mix = Default::default(); after_mixer_neutral(d); // (a B&W profile turns the render grey again: sample the source colour) @@ -142,8 +147,6 @@ fn targeted(s: &mut Session, p: &Value) -> Result { let [_, _, h] = encoded_to_oklch(e); let w = lightcraft_pipeline::colorops::band_weights(h); let top = w.iter().cloned().fold(0.0f32, f32::max).max(1e-6); - // (a B&W profile, as the Color Mixer panel shows it: its B&W mix) - let bw = d.treatment == Treatment::Bw || d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw."); label = if bw { "B&W Mix" } else { "Color Mixer" }; for (i, band) in MIXER_BANDS.iter().enumerate() { let k = (w[i] / top) as f64; diff --git a/crates/engine/src/tests/color.rs b/crates/engine/src/tests/color.rs index 12409ed291..4c9fff6736 100644 --- a/crates/engine/src/tests/color.rs +++ b/crates/engine/src/tests/color.rs @@ -138,6 +138,18 @@ fn targeted_adjustment_on_curve_and_mixer() { assert!(!o.is_empty() && o.keys().all(|k| k.starts_with("bw.")), "{r}"); // ... the band of the sky's own colour, not of the grey the profile renders assert_eq!(top_band(o), sky_band, "{r}"); + // the B&W mix comes after the colour mixer: a mixer hue shift moves the colour the B&W mix sees there, so the + // same drag shares itself out over the bands differently + let neutral = o.clone(); + let zero: serde_json::Map = neutral.keys().map(|k| (k.clone(), json!(0))).collect(); + s.execute("develop.set", &json!({ "values": zero })).unwrap(); + let shift: serde_json::Map = + lightcraft_develop::MIXER_BANDS.iter().map(|b| (format!("mixer.{b}.hue"), json!(100))).collect(); + s.execute("develop.set", &json!({ "values": shift })).unwrap(); + let r = s.execute("develop.targeted", &json!({"target": "lum", "x": 0.5, "y": 0.1, "delta": 10})).unwrap(); + let shifted = r.as_object().unwrap(); + assert!(shifted.keys().all(|k| k.starts_with("bw.")), "{r}"); + assert_ne!(shifted, &neutral, "the mixer's hue shift is part of what the B&W mix sees"); } /// Issue #730: on a raw whose camera has measured colour matrices the white-balance commands write Kelvin, mark diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 6864998d52..2f9b6f11e4 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -48,6 +48,12 @@ fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result.`) either way; a B&W photo shows its B&W mix. pub(super) fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) { - // (the B&W mix keeps its own Luminance targeted adjustment) + // (the B&W mix keeps its own Luminance targeted adjustment; a picker it doesn't show is put down first) if crate::is_bw(d) { + drop_hidden_mixer_tool(app); mixer_by_color(app, ui, d); return; } @@ -107,7 +108,7 @@ pub(super) fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSetti ui.spacing_mut().item_spacing.x = 6.0; let tool = format!("tat:{key}"); let active = app.ui.tool == tool; - if crate::widgets::icon_button( + let button = crate::widgets::icon_button( ui, &format!("tatMixer-{key}"), Icon::Target, @@ -115,9 +116,14 @@ pub(super) fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSetti active, true, "Targeted adjustment: drag up/down on the photo to adjust the colours there", - ) - .clicked() - { + ); + // (named by its group for a screen reader: All shows three of them) + crate::widgets::announce_selected( + &button, + crate::i18n::tr_format!("Targeted adjustment ({group})", group = crate::i18n::tr(label)), + active, + ); + if button.clicked() { set_tat(app, ui.ctx(), &tool, active); } if all { @@ -129,9 +135,10 @@ pub(super) fn mixer(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSetti for (band, name) in lightcraft_develop::MIXER_BANDS.iter().zip(BAND_NAMES) { let id = format!("mixer.{band}.{key}"); let Some(spec) = controls::find(&id) else { continue }; - // labelled by the colour alone: the group says what it adjusts + // labelled by the colour alone: the group says what it adjusts (a screen reader hears both) let v = controls::get(d, &id).unwrap_or(spec.default); - let out = slider(ui, spec, v, true, Some(name)); + let spoken = crate::i18n::tr_format!("{color} ({group})", color = crate::i18n::tr(name), group = crate::i18n::tr(label)); + let out = crate::widgets::slider_named(ui, spec, v, true, Some(name), Some(&spoken)); apply_slider_out(app, spec, out, |app, v| app.run("develop.set", json!({"control": id, "value": v}))); } } diff --git a/crates/ui-egui/src/tests/color_mixer.rs b/crates/ui-egui/src/tests/color_mixer.rs index aa3a885410..7738539ed3 100644 --- a/crates/ui-egui/src/tests/color_mixer.rs +++ b/crates/ui-egui/src/tests/color_mixer.rs @@ -187,3 +187,33 @@ fn a_bw_photo_reports_the_mixer_it_shows() { assert_eq!(r["tab"], "mixer", "{r}"); assert_eq!(h.app.ui.mixer_tab, "point", "kept for colour photos"); } + +/// Opening the Color Mixer from Masking puts the Masking colour picker down, so a click on the photo is the Edit +/// panel's again, not a colour sample for a mask. +#[test] +fn the_color_mixer_command_puts_down_the_masking_picker() { + let mut h = mixer(); + let r = h.request("ui.set", json!({"right": "masking"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.app.ui.tool = "colorRange".into(); + run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.tool, "", "the Masking picker is put down"); + // the White Balance picker is the Edit panel's own, and stays + let r = h.request("ui.set", json!({"right": "masking"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.app.ui.tool = "wbPicker".into(); + run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.tool, "wbPicker"); +} + +/// A photo turned B&W while Point Color's picker is out puts the picker down when the panel next shows its B&W +/// mix, so a click on the photo picks no colour. +#[test] +fn point_colors_picker_is_put_down_when_the_photo_turns_bw() { + let mut h = mixer(); + run(&mut h, "view.colorMixer", json!({"tab": "point"})); + h.app.ui.tool = "pointColor".into(); + run(&mut h, "develop.treatment", json!({"bw": true})); + h.settle(SETTLE); + assert_eq!(h.app.ui.tool, "", "no Point Color on a B&W photo"); +} diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 3101a93dc9..9e9b27041d 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -419,6 +419,12 @@ const THUMB_RING: f32 = 7.0; /// Esc keeps the old one. Drag the value sideways to scrub it, as if dragging the thumb (Shift: a tenth /// as far). pub fn slider(ui: &mut Ui, spec: &ControlSpec, value: f64, enabled: bool, label_override: Option<&str>) -> SliderOut { + slider_named(ui, spec, value, enabled, label_override, None) +} + +/// [`slider`] that a screen reader calls `spoken` (already translated) rather than by its short drawn label: the +/// Color Mixer's All view draws "Red" three times, once per group, and says "Red (Hue)", "Red (Saturation)"… +pub fn slider_named(ui: &mut Ui, spec: &ControlSpec, value: f64, enabled: bool, label_override: Option<&str>, spoken: Option<&str>) -> SliderOut { let t = Tokens::get(ui.ctx()); let w = ui.available_width(); let (row, _) = ui.allocate_exact_size(vec2(w, t.slider_row_h), Sense::hover()); @@ -432,7 +438,7 @@ pub fn slider(ui: &mut Ui, spec: &ControlSpec, value: f64, enabled: bool, label_ let resp = ui.interact(track_rect.expand2(vec2(8.0, 2.0)), id, if enabled { Sense::click_and_drag() } else { Sense::hover() }); let (wheel_armed, pointer_in_row) = update_wheel_arming(ui, id, &resp, row, enabled); // screen readers: a slider named after its control, with its value - let label_text = crate::i18n::tr(label_override.unwrap_or(spec.label)).to_string(); + let label_text = spoken.map_or_else(|| crate::i18n::tr(label_override.unwrap_or(spec.label)).to_string(), str::to_string); resp.widget_info(|| egui::WidgetInfo::slider(enabled, value, label_text.clone())); describe_slider(ui, &g, &resp); // the name: double-click it to reset, as the thumb (a disabled slider's name is only text) From 23617577ef85868cc7644f1e541bdbb0e9499ebb Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 13:28:48 +1000 Subject: [PATCH 10/14] LR-EDIT-COLOR-MIXER-HSL: B&W probe keeps its profile's adjustments; only the mixer's tools survive the command; its band is the one shown; spoken names translated (CodeRabbit, #2955) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/color.rs | 10 +++-- crates/ui-egui/src/menus/run.rs | 6 ++- crates/ui-egui/src/panels/edit/mixer.rs | 5 ++- crates/ui-egui/src/tests/color_mixer.rs | 53 +++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/color.rs b/crates/engine/src/cmd/color.rs index f384ae3355..3fef87a274 100644 --- a/crates/engine/src/cmd/color.rs +++ b/crates/engine/src/cmd/color.rs @@ -137,12 +137,14 @@ fn targeted(s: &mut Session, p: &Value) -> Result { if !bw { d.mixer = Default::default(); } + // (a B&W profile turns the render grey again: sample the source colour, with the profile's own + // adjustments before the mixer, its contrast say, and its other options kept) + if d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw.") { + *d = lightcraft_pipeline::profiles::effective(d).into_owned(); + d.profile.id = "lc.color".into(); + } d.bw_mix = Default::default(); after_mixer_neutral(d); - // (a B&W profile turns the render grey again: sample the source colour) - if d.profile.id == "lc.mono" || d.profile.id.starts_with("lc.bw.") { - d.profile = Default::default(); - } })?; let [_, _, h] = encoded_to_oklch(e); let w = lightcraft_pipeline::colorops::band_weights(h); diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 2f9b6f11e4..6059f3d96e 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -50,7 +50,7 @@ fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result Result = Vec::new(); + for (band, part) in [("red", "hue"), ("blue", "sat"), ("green", "lum")] { + let ctl = format!("mixer.{band}.{part}"); + let r = h.request("ui.dragWidget", json!({"id": format!("slider:{ctl}"), "fx": 0.5, "fy": 0.5, "dx": 40.0, "dy": 0.0, "steps": 8}), T); + assert_eq!(r["ok"], true, "{ctl}: {r}"); + h.settle(SETTLE); + moved.push(ctl.clone()); + let id = h.app.session.active().expect("a photo"); + let d = h.app.session.develop_of(id).expect("settings"); + for b in BANDS { + for p in ["hue", "sat", "lum"] { + let other = format!("mixer.{b}.{p}"); + let v = lightcraft_develop::controls::get(&d, &other).unwrap_or(0.0); + if moved.contains(&other) { + assert!(v > 0.0, "{other} moves with its own slider: {v}"); + } else { + assert_eq!(v, 0.0, "{other} stays when {ctl} is dragged"); + } + } + } + } +} From 9ec420bbe6566fb5246d21c5a0a9c12aa9a96355 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 15:29:53 +1000 Subject: [PATCH 11/14] LR-EDIT-COLOR-MIXER-HSL: in Solo Mode the Color Mixer puts down the Curve's targeted adjustment (CodeRabbit, #2955) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/menus/run.rs | 5 +++++ crates/ui-egui/src/tests/color_mixer.rs | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 6059f3d96e..9d0347523c 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -67,6 +67,11 @@ fn color_mixer_layout(app: &mut LightcraftApp, p: &Value) -> Result Date: Sun, 1 Nov 2026 23:34:55 +1000 Subject: [PATCH 12/14] LR-EDIT-COLOR-MIXER-HSL: the Solo Mode test covers a Curve on screen and checks that Light closes (CodeRabbit, #2955) The non-Solo check opens the Curve flyout first and asserts Light and the flyout stay open; the Solo run starts from Light alone and asserts Color is then the only open section. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests/color_mixer.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/color_mixer.rs b/crates/ui-egui/src/tests/color_mixer.rs index 8bbc2ea8eb..132745ccc8 100644 --- a/crates/ui-egui/src/tests/color_mixer.rs +++ b/crates/ui-egui/src/tests/color_mixer.rs @@ -276,10 +276,18 @@ fn an_hsl_slider_drag_sets_its_bands_control() { #[test] fn solo_mode_puts_down_the_curves_targeted_adjustment() { let mut h = mixer(); + // (the Curve on screen: Light open with its Curve flyout, its targeted adjustment picked up) + if !h.app.ui.flyout_open("curve") { + h.app.ui.toggle_flyout("curve"); + } h.app.ui.tool = "tat:curve".into(); run(&mut h, "view.colorMixer", json!({})); - assert_eq!(h.app.ui.tool, "tat:curve", "the Curve is still shown"); + assert!(h.app.ui.section_open("light") && h.app.ui.flyout_open("curve"), "the Curve is still shown"); + assert_eq!(h.app.ui.tool, "tat:curve", "and keeps its targeted adjustment"); + // Solo Mode from Light alone: the command opens Color and closes Light h.app.ui.single_panel = true; + h.app.ui.open_sections = vec!["light".into()]; run(&mut h, "view.colorMixer", json!({})); + assert_eq!(h.app.ui.open_sections, ["color"], "Solo Mode closes Light"); assert_eq!(h.app.ui.tool, "", "Solo Mode hides the Curve"); } From 37c950ae691c0fb758583d53f10806837e97e01e Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:26:27 +0700 Subject: [PATCH 13/14] docking: the Color Mixer command brings Tools forward like the other Tools commands --- crates/ui-egui/src/docking.rs | 1 + crates/ui-egui/src/tests/docking_acceptance.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/ui-egui/src/docking.rs b/crates/ui-egui/src/docking.rs index 67d972a750..6ad752e6a0 100644 --- a/crates/ui-egui/src/docking.rs +++ b/crates/ui-egui/src/docking.rs @@ -280,6 +280,7 @@ pub(crate) fn reveal_command(app: &mut crate::LightcraftApp, id: &str) -> Result Some(Panel::Library) } else if (id.starts_with("panel.") && id != "panel.close" && id != "panel.presets" || id == "view.rightPanel" + || id == "view.colorMixer" || id.starts_with("section.") || id.starts_with("tool.") && id != "tool.none") && app.ui.right != crate::state::RightPanel::None diff --git a/crates/ui-egui/src/tests/docking_acceptance.rs b/crates/ui-egui/src/tests/docking_acceptance.rs index 2056103f48..1ca10dbbae 100644 --- a/crates/ui-egui/src/tests/docking_acceptance.rs +++ b/crates/ui-egui/src/tests/docking_acceptance.rs @@ -68,6 +68,16 @@ fn window_menu_reopens_closed_panels_in_their_dock_columns() { assert_eq!(crate::docking::columns(h.app.ui.docking.as_ref().unwrap(), Side::Start), [(width, vec![vec![Panel::Library]])]); } +#[test] +fn the_color_mixer_command_brings_tools_forward() { + let mut h = app(); + dock(&mut h, json!({"operation":"move","panel":"tools","target":"library","zone":"center"})); + dock(&mut h, json!({"operation":"activate","panel":"library"})); + assert!(!crate::docking::exposed_in(h.app.ui.docking.as_ref().unwrap(), Panel::Tools)); + h.app.run("view.colorMixer", json!({})).unwrap(); + assert!(crate::docking::exposed_in(h.app.ui.docking.as_ref().unwrap(), Panel::Tools), "the mixer is shown, not left behind Library"); +} + #[test] fn inactive_same_mode_commands_reveal_without_closing_or_editing() { let mut h = app(); From 46532b68abffe59228174c42e6af82e8ccc82c1c Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:31:42 +0700 Subject: [PATCH 14/14] Format import/job.rs as main's gate requires (rustfmt) The #1995 merge left crates/engine/src/import/job.rs unformatted on main, so the gate fails at fmt for every branch; this is that file run through rustfmt, nothing else. --- crates/engine/src/import/job.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/import/job.rs b/crates/engine/src/import/job.rs index 7ff684a75a..1d6761531b 100644 --- a/crates/engine/src/import/job.rs +++ b/crates/engine/src/import/job.rs @@ -398,15 +398,13 @@ impl ImportJob { let external_sidecar = if skip_sidecar { None } else { - found_sidecar - .and_then(|f| std::fs::read_to_string(f).ok()) - .and_then(|x| match crate::sidecar::parse_sidecar(&x, target) { - Ok(sc) => Some(sc), - Err(e) => { - log::warn!("import {path}: XMP: {e}"); - None - } - }) + found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).and_then(|x| match crate::sidecar::parse_sidecar(&x, target) { + Ok(sc) => Some(sc), + Err(e) => { + log::warn!("import {path}: XMP: {e}"); + None + } + }) }; let sidecar = match (embedded_sidecar, external_sidecar) { (Some(mut embedded), Some(external)) => {