Skip to content

fix(a11y): show one keyboard focus ring on every control - #378

Merged
Hakanbaban53 merged 1 commit into
Zarestia-Dev:masterfrom
repires:fix/focus-rings
Nov 25, 2026
Merged

Hakanbaban53 merged 1 commit into
Zarestia-Dev:masterfrom
repires:fix/focus-rings

Conversation

@repires

@repires repires commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Part of #354, following the keyboard testing there: focus indicators were missing or hard to see on some elements.

What

I measured it first: Tab through seven screens (home, Quick Add Remote, Preferences, About, file browser, Flow, remote detail) and compare each tab stop's screenshot focused vs. not focused. On master, of 103 stops, 50 showed only a faint tint (Material's focus state layer) and 21 showed nothing: icon buttons, expansion panel headers, Material text buttons, the file browser sidebar, the view tabs in the title bar, Preferences' selects. Pills and some plain buttons had a ring.

Now every focusable control shows the same :focus-visible ring, as libadwaita draws it:

  • a 2px outline in the accent colour (so it follows the system accent from feat: follow the system accent color #363), drawn just inside the control so lists, sidebars and cards that clip their overflow can't cut it off;
  • on filled buttons, tone-filled buttons and solid pills, in the label colour instead, which is readable on the fill (a blue ring on a blue button would vanish);
  • keyboard focus only (:focus-visible), so mouse clicks look as before;
  • text fields keep their own focus style (the field's outline or underline) and menu items their highlight;
  • pills drop their own 40% inset ring for this one, so everything matches.

It's one rule in custom-theme.scss with --focus-ring-color and --focus-ring-width, so the look is easy to adjust.

Tests

  • Same measurement after the change: 102 of 103 stops show a clear ring in both light and dark. The remaining one is the file list, where the ring (around the whole pane) is visible but too small a share of that big area for my threshold.
  • Full suite (3674 tests; the list lasso test timed out once under load and passes on its own), Prettier and ng build pass. There's no unit test: jsdom can't evaluate :focus-visible or render outlines.

Keyboard testing found focus hard to follow (Zarestia-Dev#354): of 103 tab stops on
seven screens, 50 showed only a faint state-layer tint and 21 showed
nothing (icon buttons, panel headers, Material buttons, the file
browser sidebar, the view tabs, selects).

Every focusable control now shows the same :focus-visible ring, as
libadwaita draws it: a 2px outline in the accent colour, inset so
containers that clip their overflow keep it. Filled buttons and solid
pills draw it in their label colour, which is readable on the fill.
Text fields keep their own focus style and menu items their highlight.
Pills drop their separate 40% inset ring for this one.
@Hakanbaban53
Hakanbaban53 merged commit 4a4ec35 into Zarestia-Dev:master Nov 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants