Skip to content

Chat block: Enter sends, Shift+Enter inserts a newline#4

Merged
lezama merged 1 commit into
mainfrom
fix/textarea-enter-submit
May 7, 2026
Merged

Chat block: Enter sends, Shift+Enter inserts a newline#4
lezama merged 1 commit into
mainfrom
fix/textarea-enter-submit

Conversation

@lezama
Copy link
Copy Markdown
Owner

@lezama lezama commented May 7, 2026

Summary

Standard chat-app keyboard handling on the input textarea:

  • Enter → submits the form (same as clicking Send)
  • Shift+Enter → inserts a newline (default textarea behavior)
  • Modifier keys (Ctrl/Meta/Alt) and IME composing-state are excluded so dictation / accent picker / OS shortcuts don't accidentally submit

Verified

Synthesizing a real KeyboardEvent against the live block: `defaultPrevented: true`, transcript shows USER + the …thinking placeholder right after, REST POST goes out. Visual / UX-only change; no backend touched.

Test plan

  • Type a message in the chat textarea, press Enter → message submits
  • Type a message, press Shift+Enter → newline inserted, no submit
  • Hold Cmd/Ctrl/Alt + Enter — does NOT submit (so OS shortcuts keep working)

Quality gate results

Gate Result
php -l (no PHP changes) n/a
vendor/bin/phpunit ✅ unchanged
tests/smoke.php ✅ unchanged
Browser test against live chat

@lezama lezama marked this pull request as ready for review May 7, 2026 18:57
@lezama lezama merged commit bc1981c into main May 7, 2026
@lezama lezama deleted the fix/textarea-enter-submit branch May 7, 2026 18:57
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