fix(webui): send edited user message on Enter, keep Shift+Enter as newline#615
Merged
Merged
Conversation
…wline The message edit textarea previously only submitted on Ctrl/Cmd+Enter, so both Enter and Shift+Enter inserted newlines. Align it with the composer behavior: Enter submits, Shift+Enter inserts a newline. Also guard against IME composition to avoid accidental submissions while selecting candidates. Co-Authored-By: Claude <noreply@anthropic.com>
pancacake
added a commit
that referenced
this pull request
Jul 18, 2026
…mmetric scrollbar gutter Follow-up to #615/#608/#634: the isComposingRef + composition-handler trio duplicated across five textareas (ComposerInput, SimpleComposerInput, ChatMessages edit, BookChatPanel, PartnerComposer) becomes one useImeComposing() hook; the citation-anchor fallback chain + <details> auto-open duplicated in both markdown renderers moves to lib/markdown-anchors.ts; and the chat scrollport reserves the scrollbar gutter on both edges so the message column centers on the same axis as header and composer on classic-scrollbar platforms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a user clicks the Edit button on a sent message, the inline
<textarea>previously only submitted onCtrl/Cmd + Enter. As a result, bothEnterandShift + Enterinserted a newline, which is inconsistent with the bottom composer input.This change makes the edit textarea use the same
shouldSubmitOnEnter()helper as the composer:Entersubmits the edited message.Shift + Enterinserts a newline (default textarea behavior).Esccancels editing (unchanged).Ctrl/Cmd + Enterstill submits as a fallback.onCompositionStart/onCompositionEndguards prevent accidental submission while an IME composition (e.g. Chinese/Japanese input) is active.The affected component is
UserMessageinweb/components/chat/home/ChatMessages.tsx.Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.Additional Notes
npx eslint components/chat/home/ChatMessages.tsx(no errors) andnpx tsc --noEmit(no type errors).pre-commit run --all-filestriggered theprettierhook, which reformatted a number of existing files (e.g.,web/components/chat/home/ChatMessages.tsx,web/components/memory/MemorySection.tsx, etc.). These formatting changes are auto-fixes applied byprettierto legacy code and are not caused by the functional changes in this PR.