mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-15 21:28:33 -05:00
[PR #1948] a11y(shared): make subscribe modal a real dialog for keyboard and screen-reader users #34672
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1948
Author: @farhan523
Created: 7/7/2026
Status: 🔄 Open
Base:
dev← Head:a11y/subscribe-modal-dialog📝 Commits (1)
e3bfd43a11y(shared): make subscribe modal a real dialog for keyboard and screen-reader users📊 Changes
6 files changed (+252 additions, -12 deletions)
View changed files
📝
book/quarto/assets/scripts/subscribe-modal.js(+42 -2)📝
kits/assets/scripts/subscribe-modal.js(+42 -2)📝
labs/assets/scripts/subscribe-modal.js(+42 -2)📝
mlsysim/docs/scripts/subscribe-modal.js(+42 -2)📝
shared/scripts/subscribe-modal.js(+42 -2)📝
site/assets/scripts/subscribe-modal.js(+42 -2)📄 Description
Problem
The shared subscribe modal (
shared/scripts/subscribe-modal.js, mirrored to the book, site, labs, kits, and mlsysim subsites) is a plain<div>overlay with several accessibility gaps:role="dialog",aria-modal, or accessible name. Screen-reader users get no announcement when it opens and can keep reading the page behind the overlay without knowing a form is blocking the view.prefers-reduced-motion: reduceset (WCAG 2.3.3).Fix (canonical file only, mirrors regenerated)
role="dialog" aria-modal="true" aria-labelledby="subscribe-modal-title"on.modal-container, id added to the existing title → announced as "Stay in the Loop, dialog".openModal()savesdocument.activeElement;closeModal()refocuses it.@media (prefers-reduced-motion: reduce)disables thefadeIn/slideUpanimations.Behavior
No visual or functional change for mouse users: same design, same animations (when motion is allowed), Escape and overlay-click still close it.
Mirrors were regenerated with
bash shared/scripts/sync-mirrors.sh(all six copies stay byte-identical for the CI drift check). Verified withnode --check.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.