🎨 Palette: Add keyboard shortcut and preserve nested hints in state transitions#134
🎨 Palette: Add keyboard shortcut and preserve nested hints in state transitions#134Shin5hi wants to merge 1 commit into
Conversation
- Adds `aria-keyshortcuts="Control+Enter Meta+Enter"` and visual `<kbd>` hint. - Listens for `Ctrl+Enter` / `Cmd+Enter` to trigger the button. - Updates inline state restoration logic to use `childNodes` to preserve `<kbd>` tag safely instead of `textContent` - Updates CSP SHA-256 script hash for inline script changes. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
💡 What
Added a global keyboard shortcut (
Cmd/Ctrl + Enter) to trigger the main "Click Me" button. The button now displays a visual hint (<kbd>⌘/Ctrl+Enter</kbd>), and the underlying script listens for these keystrokes, focusing and clicking the button.🎯 Why
Keyboard shortcuts dramatically improve efficiency for power users and are essential for robust keyboard accessibility. The visual hint helps discoverability. Furthermore, the previous implementation of state restoration during the async loading sequence (using
textContent) would strip out nested HTML structures like<kbd>. This PR safely preserves child nodes viareplaceChildrenwithout usinginnerHTML.📸 Before/After
(Visuals verified via Playwright screenshot. The button text now includes the
<kbd>⌘/Ctrl+Enter</kbd>hint and accurately returns to this state after a successful async action).♿ Accessibility
aria-keyshortcuts="Control+Enter Meta+Enter"on the button for screen reader support.PR created automatically by Jules for task 2001672804434034578 started by @Shin5hi