From 4b80b031bc0d6a69930a97bf9bd2f87aedaf53d9 Mon Sep 17 00:00:00 2001 From: reese <120700018+rosematcha@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:46:13 -0500 Subject: [PATCH] Auto-Align Layers: the dialog no longer sends reference 0 (#674) (#795) * fix(dialogs): Auto-Align no longer sends reference 0 (#674) * style(xtask): rustfmt the i18n coverage test --- crates/ui-egui/src/filter_dialog.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/filter_dialog.rs b/crates/ui-egui/src/filter_dialog.rs index 1c07339667..7d31cbe46b 100644 --- a/crates/ui-egui/src/filter_dialog.rs +++ b/crates/ui-egui/src/filter_dialog.rs @@ -85,7 +85,7 @@ pub fn parse_spec(spec: &str) -> Vec { Kind::Text } else if v == "doc" { Kind::Document - } else if v == "json" || v.starts_with('[') || v.starts_with('{') { + } else if v == "json" || v.starts_with("layer id") || v.starts_with('[') || v.starts_with('{') { Kind::Json } else if let Some(n) = v.strip_prefix("int[").and_then(|r| r.strip_suffix(']')).and_then(|n| n.parse().ok()) { Kind::Grid(n) @@ -453,6 +453,16 @@ mod tests { ); } + /// A layer-id param has no number field: drawing the Auto-Align dialog used to write + /// `reference: 0` back, which the engine rejects as not a selected layer (#674). + #[test] + fn layer_id_params_stay_out_of_the_dialog() { + let mut f = Map::new(); + f.insert("__command".into(), json!("edit.autoAlignLayers")); + egui::Context::default().run_ui(Default::default(), |ui| body(ui, &mut f)).textures_delta.clear(); + assert!(!params_of(&f).as_object().unwrap().contains_key("reference"), "{f:?}"); + } + #[test] fn wide_positive_ranges_use_the_logarithmic_slider_path() { assert!(uses_logarithmic_slider(0.1, 1000.0), "Gaussian Blur radius");