[Improvement]: A11y — focus-visible ring, aria-label on icon buttons, tablist for ActivityBar and TabBar#176
Open
matiaspalmac wants to merge 1 commit intoTrixtyAI:mainfrom
Conversation
…tablist for ActivityBar and TabBar
The app's shell had three overlapping a11y gaps in keyboard and AT
land:
1. Icon-only buttons (window controls, bottom-panel close,
ActivityBar entries) had no accessible name — AT announced them
as "button" with no further context.
2. There was no visible focus indicator. Every button used
`transition-colors` on hover but nothing on keyboard focus, so
keyboard users could not tell where they were.
3. ActivityBar and TabBar looked like tablists but lacked roles, so
AT had no grouping and no selection state.
Changes:
- **ActivityBar**: the container is `role=tablist aria-orientation=vertical`
with an `aria-label`; each entry (plugins, Extensions, Settings) is
`role=tab` with `aria-label` and `aria-selected`. Decorative
indicator pip and hover tooltips are `aria-hidden`.
- **TabBar**: `role=tablist` container, each open file is a `role=tab`
with `aria-selected`, `aria-label` (including an "unsaved" suffix
for modified files), `tabIndex=0`, and Enter/Space activation.
The per-tab close button now has `aria-label="Close {file}"`.
- **TitleBar**: `aria-label` on the right-panel toggle (with
`aria-pressed`), minimize, maximize/restore, and close buttons.
Decorative separator is `aria-hidden`.
- **BottomPanel**: `aria-label` on the close button.
- Global focus style: all five touched buttons/tabs now carry
`focus-visible:ring-2 focus-visible:ring-white/40` (inset on
titlebar controls and tab-bar items to stay inside their rail).
- New i18n keys: `activitybar.label`, `tabbar.label`, `tab.close_aria`
(EN + ES).
Closes TrixtyAI#104
|
Thanks for the contribution! I'll review it as soon as possible. If you have still changes, please mark this PR as draft and all reviews will be cancelled. Tests reviews will be re-run only when the PR is marked as ready for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The app's shell had three overlapping a11y gaps that together made the chrome unusable for keyboard and screen-reader users:
TitleBar,BottomPanel's close, everyActivityBarentry) had no accessible name — AT announced them as "button" with no further context.ActivityBarandTabBarlooked like tablists but were not — norole=tablist/role=tab, noaria-selected, no grouping — so AT got no structural cue and announced each button in isolation.Related Issue
Closes #104
Change
ActivityBar— container isrole="tablist" aria-orientation="vertical"with anaria-label; each entry (dynamic plugins, Extensions, Settings) isrole="tab"witharia-labelandaria-selected. Decorative active-indicator pip and hover tooltips arearia-hidden="true".TabBar—role="tablist"container, each open file is arole="tab"witharia-selected, anaria-labelthat appends an unsaved/modified cue,tabIndex={0}, and Enter/Space activation. The per-tab close button carriesaria-label="Close {file}".TitleBar—aria-labelon the right-panel toggle (plusaria-pressedso AT reflects the state), minimize, maximize/restore (label flips with state), and close. The vertical separator line isaria-hidden="true".BottomPanel—aria-labelon the close button.focus-visible:ring-2 focus-visible:ring-white/40(inset on titlebar controls and tab-bar items so the ring stays inside its rail).focus-visible(notfocus) keeps the ring out of the way on mouse click.New i18n keys:
activitybar.label,tabbar.label,tab.close_aria(EN + ES).Trade-offs
Tablands on each entry,Enter/Spaceactivates,aria-selectedannounces state — is a strict improvement that's safe to land now; arrow navigation is a clean follow-up.title={...}tooltips in parallel witharia-label={...}so hover tooltips still render for sighted users (titlealone is not exposed reliably to AT, which is whyaria-labelhad to be added).Verification
pnpm --filter @trixty/desktop lintpasses clean.npx tsc --noEmitpasses clean.Checklist