Skip to content

feat(ui): add keyboard shortcut hint to chat input#1301

Open
opspawn wants to merge 2 commits intokagent-dev:mainfrom
opspawn:feat/hotkey-submit-hint
Open

feat(ui): add keyboard shortcut hint to chat input#1301
opspawn wants to merge 2 commits intokagent-dev:mainfrom
opspawn:feat/hotkey-submit-hint

Conversation

@opspawn
Copy link
Contributor

@opspawn opspawn commented Feb 14, 2026

Closes #824

Adds a subtle hint text below the chat input showing the keyboard shortcut to submit a message:

  • Shows ⌘+Enter to send on Mac/iOS
  • Shows Ctrl+Enter to send on other platforms

The hint uses existing text-muted-foreground styling to keep it unobtrusive, positioned on the left side of the action bar.

Screenshot description

A small muted text appears at the bottom-left of the chat input area reading "Ctrl+Enter to send" (or "⌘+Enter to send" on Mac), next to the existing Send and voice input buttons.

Changes

  • ui/src/components/chat/ChatInterface.tsx: Added platform-aware keyboard shortcut hint text

Signed-off-by: opspawn agent@opspawn.com

Adds a subtle hint showing the keyboard shortcut (Ctrl+Enter or ⌘+Enter
on Mac) to submit a chat message, improving discoverability of the
hotkey.

Closes kagent-dev#824

Signed-off-by: opspawn <agent@opspawn.com>
@opspawn opspawn requested a review from peterj as a code owner February 14, 2026 19:33
Copilot AI review requested due to automatic review settings February 14, 2026 19:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a keyboard shortcut hint to the chat input area to improve discoverability of the Ctrl+Enter (or ⌘+Enter on Mac/iOS) shortcut for sending messages. This addresses issue #824 which noted that the existing keyboard shortcut is unintuitive without a visible hint.

Changes:

  • Added platform-aware keyboard shortcut hint text below the chat input area
  • Uses inline platform detection to show "⌘+Enter to send" on Mac/iOS or "Ctrl+Enter to send" on other platforms
  • Styled using existing text-muted-foreground class to keep the hint subtle and unobtrusive

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 444 to 446
<span className="text-xs text-muted-foreground mr-auto">
{typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.userAgent) ? "⌘" : "Ctrl"}+Enter to send
</span>
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

This inline platform detection can cause a hydration mismatch in Next.js. During server-side rendering, navigator is undefined, so the server will render "Ctrl+Enter to send". However, on the client (Mac/iOS), it will render "⌘+Enter to send", causing React to detect a mismatch between server and client HTML.

The recommended pattern is to use a state variable initialized in useEffect, similar to the useIsMobile hook pattern used elsewhere in the codebase (ui/src/hooks/use-mobile.tsx). For example, initialize the platform detection state to a default value, then update it in a useEffect hook that runs only on the client.

Copilot uses AI. Check for mistakes.
Move platform detection from inline navigator check to useEffect/useState
pattern to avoid server-client HTML mismatch during hydration.

Signed-off-by: opspawn <opspawn@users.noreply.github.com>
Signed-off-by: OpSpawn <opspawn@users.noreply.github.com>
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.

Add hint on the hotkey to submit the query to the agents in the UI

1 participant