Skip to content

🎨 Palette: Add keyboard shortcuts for generation prompts#6294

Draft
EffortlessSteven wants to merge 1 commit into
mainfrom
palette-keyboard-shortcuts-13938019123830368148
Draft

🎨 Palette: Add keyboard shortcuts for generation prompts#6294
EffortlessSteven wants to merge 1 commit into
mainfrom
palette-keyboard-shortcuts-13938019123830368148

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Jun 21, 2026

Copy link
Copy Markdown
Member

💡 What: Added visual <kbd> elements indicating that Ctrl+Enter can be used to submit prompts, and implemented the keyboard event listeners to support this shortcut across the Basic Inference, Streaming, and Web Workers tabs.
🎯 Why: Textareas capture the Enter key for multiline input, meaning users have to switch from their keyboard to their mouse to click the "Generate" button. Adding a standard Ctrl+Enter shortcut makes the interface more keyboard-friendly and efficient.
📸 Before/After: Visual shortcuts (Ctrl+Enter) are now displayed next to the "Prompt" labels.
♿ Accessibility: The visual <kbd> elements are hidden from screen readers using aria-hidden="true", while the actual textareas have been updated with aria-keyshortcuts="Control+Enter" to properly announce the shortcut to assistive technologies.


PR created automatically by Jules for task 13938019123830368148 started by @EffortlessSteven


Note

Low Risk
Changes are limited to the WASM browser example UI and client-side event handlers; no inference, auth, or data-path changes.

Overview
Adds Ctrl+Enter (and Cmd+Enter on macOS) to submit prompts from the WASM browser demo without leaving the keyboard, on the Basic, Streaming, and Web Worker tabs.

The demo shows a styled Ctrl+Enter hint next to each prompt label and wires setupKeyboardShortcuts() at startup so the shortcut clicks the same generate/stream/worker buttons when they are enabled. Textareas use aria-keyshortcuts="Control+Enter" while the visual <kbd> is aria-hidden so screen readers are not doubled up.

Documents the accessibility pattern in .jules/palette.md.

Reviewed by Cursor Bugbot for commit a77ece5. Bugbot is set up for automated code reviews on this repo. Configure here.

@google-labs-jules

Copy link
Copy Markdown

👋 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 Jun 21, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d13dea13-dc75-4261-9241-454bb969b290

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-shortcuts-13938019123830368148

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a Ctrl+Enter (or Cmd+Enter) keyboard shortcut to submit prompts in the WASM browser examples, including visual indicators, accessibility attributes (aria-hidden and aria-keyshortcuts), and documentation. The review feedback points out that e.preventDefault() should be called unconditionally when the shortcut is triggered, preventing unwanted newlines from being inserted into the textarea even when the submit button is disabled.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +696 to +704
const handleShortcut = (e, btnId) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
const btn = document.getElementById(btnId);
if (btn && !btn.disabled) {
e.preventDefault();
btn.click();
}
}
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When the user presses Ctrl+Enter (or Cmd+Enter), the default behavior of inserting a newline in the textarea should be prevented regardless of whether the submit button is currently enabled or disabled.

If the button is disabled (e.g., during active text generation), not preventing the default action will result in unwanted newlines being appended to the prompt, which degrades the user experience.

Suggested change
const handleShortcut = (e, btnId) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
const btn = document.getElementById(btnId);
if (btn && !btn.disabled) {
e.preventDefault();
btn.click();
}
}
};
const handleShortcut = (e, btnId) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
e.preventDefault();
const btn = document.getElementById(btnId);
if (btn && !btn.disabled) {
btn.click();
}
}
};

@cursor

cursor Bot commented Jun 21, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_fb265cb1-b996-4ba6-84aa-fb489f535e4c)

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