From f87a0c214c1eacb5abd84865582941fb0c2113ad Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 29 Mar 2026 13:42:21 +0000 Subject: [PATCH 1/2] feat(a11y): add aria attributes to mario game score - Add `aria-live="polite"` and `aria-atomic="true"` to `#score` in `src/views/mario-game.njk` to announce dynamic game status updates to screen readers. - Update `.Jules/palette.md` journal with critical accessibility learning regarding dynamic game status elements. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/views/mario-game.njk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..59c7034 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -12,3 +12,7 @@ ## 2025-03-23 - Game Key Scrolling **Learning:** Browsers natively scroll the page when users press Space or Arrow keys. When building a web-based game, this creates a frustrating UX where the game viewport jumps around while playing. **Action:** Always call `e.preventDefault()` on keydown events for typical game controls ("Space", "ArrowUp", etc.) when the focus is on a game container or the body. + +## 2025-03-26 - Dynamic Game Status Updates Accessibility +**Learning:** Dynamic status updates in web UI elements, like scores changing in a game, are completely invisible to screen readers by default. This creates a frustrating and exclusive experience for users relying on assistive technologies, as they miss critical real-time information. +**Action:** When implementing dynamic status elements (like scores, timers, or life counters) in web-based games or interactive widgets, always include `aria-live="polite"` and `aria-atomic="true"` to ensure screen readers announce these updates appropriately without aggressively interrupting the user. diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index 8a3c1fd..73ed317 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -58,7 +58,7 @@