From de15d16c9b73b56462dc18ef4242db2dcbee8b32 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:17:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20accessibili?= =?UTF-8?q?ty=20updates=20and=20explicit=20keyboard=20hints=20to=20Mario?= =?UTF-8?q?=20Game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added `aria-live="polite"` and `aria-atomic="true"` to the score `#score` div to ensure score updates are smoothly announced to screen readers. * Extracted static keybindings instructions ("Press Space or Up Arrow to jump") out into a separate, visible `
` sibling, improving UX discoverability and keeping screen reader announcements focused purely on the dynamic score changes. * Added corresponding `#instructions` positioning CSS. * Logged a critical a11y learning to the Palette journal regarding `aria-live` region best practices. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/views/mario-game.njk | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..d32a7ae 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. + +## 2026-06-11 - Dynamic Content and Static Instructional Text +**Learning:** Placing static text (like instructions) inside an `aria-live` region forces screen readers to unnecessarily repeat the static text every time the dynamic content updates, which is highly disruptive to the UX. +**Action:** Always extract static instructional text into a separate sibling element outside of dynamic `aria-live` regions. diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index 67b6bd7..b9db338 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -52,13 +52,24 @@ font-size: 20px; font-family: Arial; } + + #instructions { + position: absolute; + top: 35px; + left: 10px; + color: white; + font-size: 14px; + font-family: Arial; + opacity: 0.8; + }
-
Score: 0
+
Score: 0
+
Press Space or Up Arrow to jump
From fff885671e8000389d5245636ec3b4a9e1447da2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:22:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20accessibili?= =?UTF-8?q?ty=20updates=20and=20explicit=20keyboard=20hints=20to=20Mario?= =?UTF-8?q?=20Game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added `aria-live="polite"` and `aria-atomic="true"` to the score `#score` div to ensure score updates are smoothly announced to screen readers. * Extracted static keybindings instructions ("Press Space or Up Arrow to jump") out into a separate, visible `
` sibling, improving UX discoverability and keeping screen reader announcements focused purely on the dynamic score changes. * Added corresponding `#instructions` positioning CSS. * Fixed CI failure by removing the invalid `venv` dependency from `requirements.txt`. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cfaa995..4ad1501 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ numpy pandas requests -venv