From f6ff2ff1392dc01d3c05aa12f1329682bdc4d116 Mon Sep 17 00:00:00 2001 From: GonMD Date: Sat, 24 Oct 2026 20:46:33 +0000 Subject: [PATCH] Sketch palette: the Tie button shows "Tie", not its catalog key (#4854) (#4857) * claim: #4854 Co-Authored-By: Claude Opus 5.5 * Sketch palette: the Tie button shows "Tie", not its catalog key (#4854) The button passed the key itself to ui_kit::button with Button::Normal, which draws its label as given; it now passes the translated label. The loose-ends test checks the button by its label. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/sketch_palette.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/sketch_palette.rs b/crates/ui-egui/src/sketch_palette.rs index 96842b0e3..b49551d9c 100644 --- a/crates/ui-egui/src/sketch_palette.rs +++ b/crates/ui-egui/src/sketch_palette.rs @@ -401,7 +401,8 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { ui.horizontal(|ui| { let text = crate::i18n::format("sketch.untied_ends", &[("count", &untied_ends.to_string())]); ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).on_hover_text(app.tr("ui.untied_ends_tip")); - let button = crate::ui_kit::button(ui, "ui.tie_ends", crate::ui_kit::Button::Normal).on_hover_text(app.tr("ui.tie_ends_tip")); + let button = + crate::ui_kit::button(ui, app.tr("ui.tie_ends"), crate::ui_kit::Button::Normal).on_hover_text(app.tr("ui.tie_ends_tip")); crate::scenario::publish_handle("sketch_palette:tie_ends", button.rect.center()); tie = button.clicked(); }); @@ -794,6 +795,7 @@ mod tests { h.settle(); assert!(h.widget("Open 2").is_some(), "the status counts the open ends"); assert!(h.widget("Untied 4").is_some(), "the status counts the untied ends"); + assert!(h.widget("Tie").is_some(), "the Tie button shows its label, not its catalog key"); let at = crate::scenario::handle_at("sketch_palette:tie_ends").unwrap(); h.call("ui.click", json!({"x": at.x, "y": at.y})); h.settle();