From ae34cc3e770ae680860cbe326d03cc91918eeebd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 17:00:33 -0800 Subject: [PATCH] Color Wheel: Show Out-of-Gamut Colors runs through the panel menu's command helper The item called the command function directly, so it skipped the app's command entry point and an error went unreported. It now uses the same helper as the other panel menu items. The menu test checks that one command runs. --- crates/ui-egui/src/panels/color_wheel.rs | 2 +- crates/ui-egui/src/panels/tests_color_wheel_gamut.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 84415d89ca..0e3df51203 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -318,7 +318,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { }); ui.separator(); if menu_item(ui, tl!("Show Out-of-Gamut Colors"), true, set.gamut) { - command(app, &json!({ "gamut": !set.gamut })).ok(); + run(app, json!({ "gamut": !set.gamut })); } let on = set.sliders == Sliders::Hsl; if menu_item(ui, tl!("HSL Sliders"), true, on) { diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs index da47fa684e..450d9b592e 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -214,9 +214,11 @@ fn the_panel_menu_switches_the_shading() { app, ); h.run_steps(3); + let commands = h.state().run_count; h.get_by_label(" Show Out-of-Gamut Colors").click(); h.run_steps(2); assert!(h.state().ui.color_wheel.gamut); + assert_eq!(h.state().run_count, commands.wrapping_add(1), "the item runs one ui.colorWheel command"); assert!(h.query_by_label("✓ Show Out-of-Gamut Colors").is_some()); h.get_by_label("✓ Show Out-of-Gamut Colors").click(); h.run_steps(2);