Repository navigation
Commit 908c070
Keep accessible text honest and sleep between ticks
The visually-hidden text was written as HH:MM:SS but only refreshed when
the minute changed, so assistive technology was given seconds that could
be up to 59s stale. Format that text to the minute instead, matching the
rate at which it is actually refreshed, rather than announcing a
precision the value does not hold. Announcing every second would flood a
polite live region, so the refresh rate stays as it was.
Also drop aria-label from the <time> element: for an atomic live region
the label wins over the contents in the accessible name computation, so
it shadowed the very text it was meant to caption.
tick() re-armed via requestAnimationFrame, waking ~60x/sec to do nothing
in 59 of every 60 calls. Schedule the next tick on the second boundary
instead; measured within 2ms of the boundary with no drift.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U3vf9sKKuCRHkwhBhGLpY11 parent a5a3e2d commit 908c070
2 files changed
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
21 | 36 | | |
22 | 37 | | |
23 | 38 | | |
| |||
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
50 | 65 | | |
51 | 66 | | |
52 | 67 | | |
| |||
56 | 71 | | |
57 | 72 | | |
58 | 73 | | |
59 | | - | |
| 74 | + | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | | - | |
| 78 | + | |
63 | 79 | | |
0 commit comments