Skip to content

feat(chat): stop button + cmd/ctrl+K shortcut + IME guard#178

Merged
blove merged 1 commit into
mainfrom
claude/chat-stop-shortcut-ime
May 2, 2026
Merged

feat(chat): stop button + cmd/ctrl+K shortcut + IME guard#178
blove merged 1 commit into
mainfrom
claude/chat-stop-shortcut-ime

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 2, 2026

Three more copilotkit-parity behaviors

chat-input

  • Stop button while `agent.isLoading()` (square icon, aria-label "Stop generating"). Calls `agent.stop()`. New `showStopButton` input (default true) and `stopped` output.
  • Textarea no longer disabled during streaming — users can compose the next prompt while the assistant is responding (copilotkit pattern).
  • IME composition guard: tracks `compositionstart`/`compositionend` plus `event.isComposing` and `keyCode === 229` so Enter doesn't submit mid-IME and discard CJK / dead-key / autocorrect candidates.

chat-popup

  • Cmd/Ctrl + K shortcut to toggle (configurable via `shortcut` input, `null` disables). Mac → cmd, others → ctrl.
  • Escape closes when open (configurable via `closeOnEscape`).

Verified live

  • ✅ Stop button appears mid-stream, hidden when stream is done
  • ✅ Click stop → stream halts, button reverts to send, action controls render
  • ✅ Cmd+K opens the popup with custom header
  • ✅ Lint + tests green

Versions

  • `@ngaf/chat`: 0.0.11 → 0.0.12

🤖 Generated with Claude Code

…uard

Three more copilotkit-parity behaviors landed in the input + popup
primitives.

## chat-input
- **Stop button**: while \`agent.isLoading()\` the send button switches
  to a square stop button (aria-label="Stop generating"). Click calls
  \`agent.stop()\` and emits a \`stopped\` output. Adds a \`showStopButton\`
  input (default true) to opt out.
- **Textarea no longer disables during streaming** — copilotkit pattern.
  Users can keep composing the next prompt while the assistant is
  responding.
- **IME composition guard**: tracks \`compositionstart\`/\`compositionend\`
  and additionally checks \`event.isComposing\` and the legacy
  \`event.keyCode === 229\`. Prevents Enter from submitting mid-IME
  (CJK input methods, dead-key accents, autocorrect popups), which
  otherwise discards the in-progress character.

## chat-popup
- **Cmd/Ctrl + K shortcut** to toggle the popup (configurable via the
  \`shortcut\` input, set to \`null\` to disable). Mac uses cmd, others
  use ctrl, detected from \`navigator.platform\`/\`userAgent\`.
- **Escape closes** when open (configurable via \`closeOnEscape\`).

## styling
- New \`.chat-input__send--stop\` rule: filled dark square button with
  inverted color, distinct from the disabled-send muted look.

Bumps @ngaf/chat 0.0.11 → 0.0.12.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 2, 2026 3:47pm

Request Review

@blove blove merged commit 03150f3 into main May 2, 2026
14 checks passed
@blove blove deleted the claude/chat-stop-shortcut-ime branch May 7, 2026 16:30
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