Skip to content

fix(web): Enter inserts newline when composer is expanded - #1729

Open
techotaku39 wants to merge 2 commits into
tiann:mainfrom
techotaku39:fix/web-expanded-composer-enter-newline
Open

fix(web): Enter inserts newline when composer is expanded#1729
techotaku39 wants to merge 2 commits into
tiann:mainfrom
techotaku39:fix/web-expanded-composer-enter-newline

Conversation

@techotaku39

@techotaku39 techotaku39 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make plain Enter insert a newline when the composer is expanded, even when Chat settings use Enter to send.
  • Keep Ctrl/Cmd+Enter and the Send button as explicit submit actions.
  • Preserve collapsed-composer Enter behavior and the current main-branch Alt+Enter behavior.
  • Add regression coverage for expanded, collapsed, and modifier-key combinations.

Validation

  • bun typecheck — passed.
  • bun run --cwd web test src/components/AssistantChat/HappyComposer.expandEnter.test.tsx src/components/AssistantChat/HappyComposer.expandSelection.test.tsx src/components/AssistantChat/HappyComposer.richBridge.test.tsx src/components/AssistantChat/HappyComposer.sendError.test.tsx src/components/AssistantChat/HappyComposer.modelEffort.test.tsx src/components/AssistantChat/HappyComposer.modelEffortButtons.test.tsx src/components/AssistantChat/ComposerButtons.test.tsx src/components/AssistantChat/RichComposerInput.test.tsx src/components/AssistantChat/RichComposerInput.segments.test.ts src/hooks/useComposerEnterBehavior.test.ts src/lib/messageDelivery.test.ts src/lib/assistant-runtime.test.ts src/components/SessionChat.test.ts — 13 files, 196 tests passed.
  • pwsh -NoProfile -File .\scripts\Invoke-HapiTaskPlaywright.ps1 -Name fix-issue-1403-enter-newline -Suite Root -TestArgs terminal-wrap-fidelity.spec.ts — 2 tests passed.
  • pwsh -NoProfile -File .\scripts\Invoke-HapiTaskPlaywright.ps1 -Name fix-issue-1403-enter-newline -Suite Live — 2 tests passed against the built Full environment, covering rich composer and textarea fallback.
  • bun run build — passed.

Related Issues

Fixes #1403

AI Disclosure

Implemented with assistance from OpenAI Codex (GPT-5.6).

heavygee and others added 2 commits August 31, 2026 12:58
Expanded long-form mode should not submit on plain Enter even when
Settings prefer Enter=send; Ctrl/Cmd+Enter and the send button still send.
Collapsed composer continues to honor composerEnterBehavior.

Closes tiann#1403

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions 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.

Findings

  • None.

Summary

  • Review mode: initial
  • No Blocker, Major, Minor, or Nit issues found in the latest diff. Residual testing gap: web/src/components/AssistantChat/HappyComposer.expandEnter.test.tsx:236 verifies that plain Enter does not send, but jsdom does not perform the textarea default action, so the fallback textarea newline insertion is not directly asserted. The rich-editor line-break primitive has existing coverage at web/src/components/AssistantChat/RichComposerInput.test.tsx:241.

Testing

  • Not run (automation). GitHub integration passed; test was pending at review time.

HAPI Bot

@heavygee heavygee added area:web Web PWA / React client bug Something isn't working community-pr PR from non-collaborator contributor labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:web Web PWA / React client bug Something isn't working community-pr PR from non-collaborator contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: Enter should insert newline when composer is expanded

2 participants