feat(a11y): expose the sidebar's tabs and the detail panel's tabs to screen readers

Each is a tab with its full title and selected state, and pressable by
assistive tech. Before, VoiceOver saw the window, its buttons and the
terminal, and nothing between them.
This commit is contained in:
l0ng-ai
2026-09-30 02:12:13 +08:00
parent e96cad4858
commit 8f044924ab
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -981,6 +981,11 @@ impl Tty7App {
let row = h_flex()
.id(("tab-row", i))
// What a screen reader announces and presses: the full
// title, not the elided one drawn.
.role(gpui::Role::Tab)
.aria_label(SharedString::from(title_text.to_string()))
.aria_selected(is_active)
.group(SharedString::from(format!("tab-row-{i}")))
.cursor_pointer()
.on_drag(DragTab, {
+3
View File
@@ -1441,6 +1441,9 @@ impl Tty7App {
};
div()
.id(("right-panel-tab", tab as usize))
.role(gpui::Role::Tab)
.aria_label(t(label_key))
.aria_selected(current)
// The press must not start a window drag from the title bar
// the tabs sit in.
.occlude()