Skip to content

🎨 Palette: Add keyboard shortcut and preserve nested hints in state transitions#134

Draft
Shin5hi wants to merge 1 commit into
mainfrom
palette-keyboard-shortcut-2001672804434034578
Draft

🎨 Palette: Add keyboard shortcut and preserve nested hints in state transitions#134
Shin5hi wants to merge 1 commit into
mainfrom
palette-keyboard-shortcut-2001672804434034578

Conversation

@Shin5hi

@Shin5hi Shin5hi commented Apr 16, 2026

Copy link
Copy Markdown
Owner

💡 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 via replaceChildren without using innerHTML.

📸 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

  • Implements aria-keyshortcuts="Control+Enter Meta+Enter" on the button for screen reader support.
  • Enhances keyboard navigation by bringing programmatic focus to the element when triggered.

PR created automatically by Jules for task 2001672804434034578 started by @Shin5hi

- 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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 35c4e9f2-e4ac-4d29-b4a8-01b2978eb035

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-keyboard-shortcut-2001672804434034578

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant