feat(a11y): announce new DX spot arrivals via aria-live (#997)#1083
Merged
Conversation
Adds `useDXSpotAnnouncements` hook that watches the already-filtered DX spot list and emits a polite aria-live announcement when new spots arrive. Throttled to at most one announcement per 10 seconds to prevent flooding on active bands; text clears after 5 seconds. Single new spot: "New DX spot: G0ABC on 14.070 MHz"; multiple: "3 new DX spots, latest: …". Follows the same pattern as useLightningAnnouncements and useSatelliteAnnouncements. 9 unit tests covering baseline, announce, multi-spot, kHz conversion, cleardown, and throttle/cooldown behaviour.
accius
approved these changes
Jun 12, 2026
accius
left a comment
Owner
There was a problem hiding this comment.
Clean work, and the pattern reuse from the lightning/satellite announcers makes this an easy read. I verified the premise in useDXClusterData: applyFilters runs before setSpots, so the hook really does receive only spots matching the user's active filters, and polite is the right level for informational traffic (lightning stays assertive for the safety case). The null-baseline trick so the first non-empty fetch doesn't announce 500 spots at once is exactly the failure mode I would have probed for, and there's a test pinning it.
Two observations, neither blocking:
- Spots that arrive during the 10s cooldown are added to the seen set without ever being announced, so they're skipped permanently rather than queued. I think that's the right call for a polite region (a backlog of stale announcements is worse than a missed one), just confirming it's intentional since the test suite pins it.
- newSpots[0] as "latest" leans on the server list being newest-first, which it is today.
CI green including your 8 new tests on both Node versions.
K0CJH
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.
Summary
useDXSpotAnnouncementshook that watches the already-filtered spot list fromuseDXClusterDataand emits apolitearia-liveannouncement when new spots arriveuseLightningAnnouncementsanduseSatelliteAnnouncementsWhy
politeA new DX spot is interesting but not safety-critical.
assertivewould interrupt what the screen-reader is currently reading;politewaits for a natural pause, which is the right call here.Why the filtered list
The hook receives
dxClusterData.spots— the list already filtered by the user's active DX filters. A user who has narrowed to, say, EU stations on 20 m FT8 wants announcements only for those spots, not every spot that arrives on the cluster.Test plan
npm test— 488 passed, 0 regressionsCloses part of #997.