i18n, a11y, IME · palette copy reads i18n with builtin en/zh; dialog and palette Enter run on the field's key-down action, so an IME-kept Enter never submits; Button, IconButton, TextInput, Tabs, EditorTabs, StatusBarItem and palette rows name their role and label

This commit is contained in:
ZacharyZhang-NY committed 2026-10-02 12:58:43 -04:00
1 parent 8fd7b8ab87
commit 4580e3b075
15 files changed
+257 -75

No files matched your search

+8 -2
View File
@@ -1,6 +1,6 @@
use gpui::{
App, ClickEvent, ElementId, IntoElement, MouseButton, RenderOnce, SharedString, Window, div,
prelude::*,
App, ClickEvent, ElementId, IntoElement, MouseButton, RenderOnce, Role, SharedString, Window,
div, prelude::*,
};
use super::button::{ButtonVariant, ClickHandler, label_size, tone};
@@ -70,9 +70,15 @@ impl RenderOnce for IconButton {
let tone = tone(self.variant, &theme.colors);
let (_, icon_size) = label_size(self.size);
let side = theme.control_height(self.size);
let name: SharedString = self
.tooltip
.clone()
.unwrap_or_else(|| self.icon.name().into());
div()
.id(self.id)
.role(Role::Button)
.aria_label(name)
.flex()
.flex_none()
.items_center()