mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-10-03 16:01:59 +00:00
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:
@@ -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, {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user