From c3da58d3151d8f136839015d4748f4110b054012 Mon Sep 17 00:00:00 2001 From: Shin5hi <200498632+Shin5hi@users.noreply.github.com> Date: Mon, 20 Apr 2026 18:55:22 +0000 Subject: [PATCH] feat(ux): add keyboard shortcuts to primary action button - Adds visual `` hint and `aria-keyshortcuts` to the action button - Implements global Ctrl/Cmd+Enter keyboard shortcut listener - Fixes state restoration to use `replaceChildren` instead of `textContent` to preserve nested HTML elements - Updates CSP SHA-256 hash - Documents findings in `.jules/palette.md` Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- .jules/palette.md | 4 ++++ index.html | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.jules/palette.md b/.jules/palette.md index fa2fd8c..e87e1a1 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,3 +1,7 @@ ## 2024-05-23 - Accessible Toast Notifications **Learning:** Toast notifications often disappear too quickly for some users. Implementing a 5000ms minimum duration AND a manual close button ensures compliance with accessibility standards (WCAG 2.2.1 Timing Adjustable) and improves usability for everyone. **Action:** When implementing temporary feedback messages, always include a visual close button and ensure the timeout is sufficient (>= 5000ms), or allow user preference to extend it. + +## 2024-05-24 - Preserving DOM Structure during State Changes +**Learning:** When adding structural visual hints like `` tags to buttons, updating button state via `textContent` inadvertently strips out these important nested HTML elements, breaking the UX enhancement. +**Action:** Use `Array.from(element.childNodes)` to save the actual DOM nodes before a state change (like a loading spinner), and restore them using `element.replaceChildren(...originalNodes)` to preserve the structural integrity and accessibility without risking XSS through `innerHTML`. diff --git a/index.html b/index.html index c11f76f..989ea56 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - + 5ive - UX Sample