Skip to content

fix: keep one screen reader route announcement - #47

Merged
banteg merged 1 commit into
mainfrom
fix/route-announcer
Oct 30, 2026
Merged

banteg merged 1 commit into
mainfrom
fix/route-announcer

Conversation

@banteg

@banteg banteg commented Oct 30, 2026

Copy link
Copy Markdown
Member

Found by an independent review of #45 and reproduced on temple.yearn.fi. Astro's client router announces each new page in a fresh aria-live="assertive" .astro-route-announcer element, relying on the default swap (which replaces <body>) to drop the old one. Our custom swap replaces only #content, so the announcers piled up: after three page changes there were three hidden live regions, and a screen reader reading to the end of the page heard every visited title.

The custom swap now removes the previous announcer before Astro adds the new one.

Checked on a local build: after five page changes and a back there's exactly one announcer, holding the current title, with no console errors. Lint, astro check and the build pass.

astro announces each page in a new live region and relies on swapping
the whole body to drop the last one. the custom swap only replaces the
content, so every visited title stayed behind for screen readers
@github-actions

Copy link
Copy Markdown

Deploy preview for y-fu ready!

Project:y-fu
Status: ✅  Deploy successful!
Preview URL:https://y-grfbg83sw-yearn.vercel.app
Latest Commit:50d4f09

Deployed with vercel-action

@banteg
banteg merged commit 42d53bb into main Oct 30, 2026
3 checks passed
@banteg
banteg deleted the fix/route-announcer branch October 30, 2026 11:18

This branch was successfully deployed

1 active deployment
preview — 50d4f09c Deployed Oct 30, 2026 by github-actions[bot]
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.

1 participant