Announces pausing and resuming the hero slide show
The pause button only changed its name, which screen readers often do not read for the focused button. The live region now also says when the slide show is paused or plays again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,13 @@ The pause button's place and look were proposed in the diagnosis and accepted wi
|
||||
- `web/src/components/Hero/HeroPauseButton.tsx` (new): the pause/play button, bottom right at the socials' height, `iconControl` recipe (44 px target, white focus ring).
|
||||
- Tests: `Hero.test.tsx` (announcement, pause button, no button without autoplay, axe) and the new `useHeroSlider.test.tsx` (visitor vs. automatic change, wrap-around, resume clears hover and focus pause).
|
||||
|
||||
**Follow-up after the owner's test (2026-10-19)**: "Nou is er eigenlijk hetzelfde probleem met de pauzeer-knop en de afspelen-knop. Zodra je erop klikt krijg je geen feedback dat de diavoorstelling is gepauzeerd. Verder vind ik de knop op een goede plek staan en er netjes uitzien."
|
||||
- Same mechanism as the arrows: focus stays on the button and only its name changes; screen readers do not reliably read the new name of the focused button.
|
||||
- `useHeroSlider.ts`: the boolean became `announcement: 'slide' | 'paused' | 'playing' | null`; `toggleStopped` sets `paused` or `playing`, `advance` still clears it.
|
||||
- `Hero.tsx`: the same live region now also says "Diavoorstelling gepauzeerd" or "Diavoorstelling speelt weer af" (`announcementText`).
|
||||
- Tests: the pause test checks both messages; the hook test checks them and that the next automatic change clears them.
|
||||
- Placement and look of the button: approved by the owner.
|
||||
|
||||
**Why this and not something else**
|
||||
- *A live region that mirrors the active slide* (or toggling `aria-live` between `off` and `polite` as in the W3C example): it would speak automatic changes too, or depend on exactly when rotation is paused. Separating visitor and automatic changes in the hook states the intent directly.
|
||||
- *Moving focus to the new slide*: would take the visitor away from the arrow they are pressing.
|
||||
|
||||
@@ -48,8 +48,10 @@ if (pause) {
|
||||
await page.mouse.move(0, 0);
|
||||
const before = await slide();
|
||||
await wait(7000);
|
||||
console.log('5. gepauzeerd | slide blijft:', before, '->', await slide(), '| knoppen:', JSON.stringify(await buttons()));
|
||||
console.log('5. gepauzeerd | slide blijft:', before, '->', await slide(), '| live:', JSON.stringify(await live()), '| knoppen:', JSON.stringify(await buttons()));
|
||||
await pause.click();
|
||||
await wait(300);
|
||||
console.log('6a. na afspelen | live:', JSON.stringify(await live()));
|
||||
await page.mouse.move(0, 0);
|
||||
await wait(7000);
|
||||
console.log('6. hervat | slide nu:', await slide(), '| knoppen:', JSON.stringify(await buttons()));
|
||||
|
||||
Reference in New Issue
Block a user