Repository navigation
Description
Summary
SegmentedControl (@tale/ui) exposes its options as a role="radiogroup" of role="radio" buttons, but the arrow keys only move focus: the checked option stays put until Space or Enter. For a radio group, the WAI-ARIA pattern (and what screen-reader users expect from "radio button, 2 of 3") is that arrow keys move focus and check.
The new pages filter in the website dialog (#4065) has the same problem. Its manual box KNOW-F36 expects "the arrow keys switch them". The phone Home view switcher, a radio group in the same app, does switch on arrows, and #3746 settled the same expectation for the shared filter radios.
Source and environment
- Source:
origin/mainat62df44379(2026-10-02), in a detached worktree with no local changes. - Stack: an isolated local stack started with
bun scripts/dev.ts. Vite runs onlocalhost:3621, the backend on127.0.0.1:3626, and the occurrence has its own PostgreSQL cluster on127.0.0.1:55362. - Browser: headless Chromium 1208 (
playwright-core1.58.2) at 1280×900,en-US. - Data: a synthetic website with failed and skipped pages (see the TALE-358 08:15 receipt), so the filter All · Failed (26) · Skipped (3) shows.
Reproduction
- Open Knowledge › Websites, open the site, and focus All in the pages filter ("Which pages to show").
- Press ArrowRight, then Space, then ArrowLeft, then Enter, checking which option is checked and what the list shows after each key.
Observed
The markup is radiogroup "Which pages to show" containing button role=radio aria-checked × 3, with roving tabindex.
| Key | Focus | Checked | List |
|---|---|---|---|
| (start) | All | All | indexed pages |
| ArrowRight | Failed (26) | All (unchanged) | indexed pages (unchanged) |
| Space | Failed (26) | Failed (26) | failed pages |
| ArrowLeft | All | Failed (26) (unchanged) | failed pages |
| Enter | All | All | indexed pages |
Expected
ArrowRight and ArrowLeft move focus and check the option, so the list switches as KNOW-F36 says. That is the radio-group contract and how the Home view switcher behaves:
- in the TALE-358 00:15 run, at 390 px, ArrowRight moved to and checked the next view;
- the same expectation is in Bug: shared filter radios ignore arrow keys and expose every option as a tab stop #3746's acceptance for
FilterPanelradios.
Alternatively, drop the radio roles in favour of a toggle-button group (aria-pressed). Then arrow keys moving focus only is the documented pattern, and the box would need updating.
Root cause
packages/ui/src/components/forms/segmented-control.tsx:71–96: the control is a Radix ToggleGroup (type="single"). Radix renders it with radio semantics but keeps roving focus separate from activation, which is the toggle-group behaviour, and SegmentedControl adds no selection-follows-focus handling.
There are two callers: the website view dialog's pages filter and website-create-dialog.tsx.
Acceptance checks
- In
SegmentedControl, ArrowRight, ArrowLeft, Home and End move focus and check, and the group stays a single Tab stop. Alternatively the roles change to a toggle group andKNOW-F36is updated. - In the website pages filter, ArrowRight from All shows the failed pages (
KNOW-F36). - A
packages/uitest drives the arrows and assertsaria-checkedandonValueChange.
Retained evidence
Evidence is retained locally under /agent/workspace/.tale358/r20261002T0815/, and attached as a tarball to Tale task TALE-358:
evidence/w3-keyboard.log(the roles and the key-by-key table);evidence/w2-pages-filter-B.log(the two ArrowRight presses that left All checked);scripts/w3-keyboard.ts.
Limits
- No screen reader was run; the roles and states come from the DOM.
- The create dialog's use of the control wasn't driven.
- Local stack only.
Activity
yannickmonney commentedon Oct 4, 2026
Post-merge recheck of #4163 against this issue's original key-by-key reproduction: fixed, on both callers. Run by the reporter, agent #3 (TALE-358 local-qa run
1f452e6a-3035-4cc9-a49b-d23d867a05ac), onorigin/main403a9a537.Setup: a fresh local stack and Chromium 1208 at 1280×900. This is the replay of
w3-keyboard.tsfrom r20261002T0815.The website pages filter ("Which pages to show"), on a site whose offline crawl failed (All · Failed (1) · Skipped (0)):
Add website › Source type (Whole website | URL list):
Evidence is in TALE-358's
r20261004T0415deliverables:scripts/x2-segmented-arrows-recheck.ts,evidence/x2-segmented-arrows-recheck.logandevidence/x2/*.png.