From aa86b0c32734d101d6e2f7ab327c0f731bc584d8 Mon Sep 17 00:00:00 2001 From: prxnvt <53838599+prxnvt@users.noreply.github.com> Date: Sat, 24 Oct 2026 02:13:39 -0400 Subject: [PATCH] UI: merge fallout from the UI kit and the recorder heads Icon buttons no longer carry an accessible name: the tests that came with main since the branch was written (menu hover, popup dismissal, the File menu, More Colors) find Copy, Save and Cancel by label, and the Quick Access Toolbar and formula bar icons gave those labels twice. The macro tests need the names of large, small and toggle ribbon buttons only. The chart menu test takes the menu's Delete, which is drawn after the ribbon's Home > Cells > Delete. The Trust Scripts row ported into the Macros dialog is formatted. --- crates/ui-egui/src/macro_ui.rs | 6 +++++- crates/ui-egui/src/widgets.rs | 3 --- crates/ui-egui/tests/it/chart_resize.rs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/macro_ui.rs b/crates/ui-egui/src/macro_ui.rs index 833973659..acbc77a2c 100644 --- a/crates/ui-egui/src/macro_ui.rs +++ b/crates/ui-egui/src/macro_ui.rs @@ -352,7 +352,11 @@ pub fn macros_dialog(app: &mut SheetApp, ui: &mut Ui, d: &mut Dialog, open: &mut return; } // Scripts that came with a file stay disabled until the user trusts the workbook (#2178). - let untrusted = d.result.as_ref().and_then(Json::as_array).is_some_and(|items| items.iter().any(|it| it.get("trusted").and_then(Json::as_bool) == Some(false))); + let untrusted = d + .result + .as_ref() + .and_then(Json::as_array) + .is_some_and(|items| items.iter().any(|it| it.get("trusted").and_then(Json::as_bool) == Some(false))); if untrusted { ui.horizontal(|ui| { ui.weak("Scripts in this workbook came from a file and are disabled."); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index b33daca05..dea0bcf5e 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -60,9 +60,6 @@ pub fn icon_button(ui: &mut Ui, icon: Icon, color: Color32, tip: &str, size: egu ui.painter().rect_filled(rect, 4.0, t.hover); } icons::paint(ui.painter(), Rect::from_center_size(rect.center(), vec2(16.0, 16.0)), icon, color); - let name = tr(ui, tip); - let enabled = ui.is_enabled(); - resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, enabled, name)); resp.on_hover_text(tip_text(ui, tip)) } diff --git a/crates/ui-egui/tests/it/chart_resize.rs b/crates/ui-egui/tests/it/chart_resize.rs index fb3e99165..30afcc17c 100644 --- a/crates/ui-egui/tests/it/chart_resize.rs +++ b/crates/ui-egui/tests/it/chart_resize.rs @@ -151,7 +151,8 @@ fn right_clicking_a_chart_opens_its_menu_not_the_cells() { let (mut h, id) = fixture(); let inside = corner(&h, id) - vec2(100.0, 80.0); right_click(&mut h, inside, vec2(0.0, 0.0)); - h.get_by_label("Delete").click(); + // Home › Cells › Delete has the same accessible name; the menu is drawn over the ribbon, last. + h.get_all_by_label("Delete").last().unwrap().click(); h.run_steps(3); assert!(h.state().session.doc().unwrap().wb.active().unwrap().charts.is_empty()); assert!(h.state().grid.object_menu.is_none());