From 702cb295c6f4dd69cc3d26cabbe0e96aac52c1e7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 14:42:07 -0800 Subject: [PATCH] menu: Keyboard Shortcuts' tab strips have readable names The tab strips in the Keyboard Shortcuts dialog used their id salts as names, so a screen reader announced the area tabs as "shortcuts.area" and the app's page tabs as "shortcuts.tab". The area tabs are now named with the Show select's translated label, and the page tabs with the dialog's title. The id salts are unchanged. --- crates/menu/src/shortcuts/view.rs | 15 +++++++++++---- crates/menu/src/shortcuts/view/header.rs | 8 ++++---- crates/menu/tests/it/shortcuts/rows.rs | 7 +++++++ crates/menu/tests/it/shortcuts/tabs.rs | 10 ++++++++++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/crates/menu/src/shortcuts/view.rs b/crates/menu/src/shortcuts/view.rs index bf46aa4d2..3f24947b4 100644 --- a/crates/menu/src/shortcuts/view.rs +++ b/crates/menu/src/shortcuts/view.rs @@ -23,6 +23,7 @@ use craft_ui::contract::{BodyCx, CollectionEvent, Props as _, Scroll, Show as _, use craft_ui::display::Icon; use craft_ui::layout_components::{Grid, Row, Stack}; use craft_ui::primitives::IconSpec; +use craft_ui::runtime::env::Label; use craft_ui::runtime::motion::Animate as _; use craft_ui::tabs::{Tab, TabKind, TabStrip}; use egui::Ui; @@ -111,10 +112,10 @@ impl DisplayOrder for Titles<'_> { impl ItemSource for Titles<'_> {} -/// A strip of text tabs over `titles` with `shown` selected; the tab picked this pass. -pub(super) fn tab_strip(ui: &mut Ui, name: &'static str, titles: &[String], shown: usize) -> Option { +/// A strip of text tabs named `name`, keyed by `id`, over `titles` with `shown` selected; the tab picked this pass. +pub(super) fn tab_strip(ui: &mut Ui, id: &'static str, name: impl Into