Repository navigation
fix(composer): continue markdown lists on the textarea's new line - #15911
Conversation
|
Intent: A new line on a markdown list item (mobile Return, desktop Shift+Enter, Enter in ctrl-enter mode) continues or ends the list in the textarea composer that production renders, using #14754's existing list rules. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify once on a real Android/iOS keyboard: every mobile event sequence here was synthesized in Playwright, never produced by a physical virtual keyboard. [DESIGN-REVIEWED] 0367cf0 Description read[DESCRIPTION-READ] b952aa5d634a492c61ac9a3aba825ec8ee3a6627ee7701e0386b429e74a6a87c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Fable 5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Verify on a real phone (Gboard + iOS autocorrect) and a CJK IME — all mobile evidence here is synthesized Playwright events, not device keystrokes. The diff adds no new control, label, or string: it changes only what a line break does on a markdown list line in the existing composer, a universal editor convention. Before/after stills cover both postures (mobile 390px: attachment-01 [UX-REVIEWED] 0367cf0 Description read[DESCRIPTION-READ] dc9a1a9e6ea07b514c0c6dfcd397d9929dbe3007ddf07dcf7829917ced3d596d That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS All mobile-keyboard behaviour (Gboard/iOS keyCode 229, What this change shipsInventory (8 items) — 8 justifiedIntent: make the list continuation #14754 shipped actually run in the textarea composer every production host renders — a FIX (defect reproducible from base:
Reuse checked: both paths route to the existing pure [FIRST-PRINCIPLES-REVIEWED] 0367cf0 Description read[DESCRIPTION-READ] 5cacd274ceb6f9c28e6959fbf05df5f97b2eaedd319b536c49e735ebd7a93954 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
|
self-added: yes
|
|
499616e to
28d9dab
Compare
|
self-added: yes
|
|
|
28d9dab to
5116f1f
Compare
|
self-added: yes
|
|
self-added: yes
|
5116f1f to
ebf05f1
Compare
|
The list continuation from kirodotdev#14754 lived only in the opt-in Lexical editor, which no production host enables, so the textarea every user types in never continued a list: not on a mobile Return, not on desktop Shift+Enter. The textarea now continues or ends the list item on its native beforeinput insertLineBreak/insertParagraph, the one event every new-line path reaches, including a mobile keyboard whose keydown is Unidentified/keyCode 229. Ctrl+Enter in enter-ctrl-newline mode uses the same edit. The send key, IME composition and paste chips are unchanged.
ebf05f1 to
0367cf0
Compare
|
Rebased onto current main with no code change (ebf05f1 -> 0367cf0), to rerun Backend Tests (Windows) (3). Its only failure on ebf05f1 was |
bolichen97
left a comment
There was a problem hiding this comment.
Approved: PR Readiness green on this head, merges cleanly into current main, no outstanding blocking review.
…every send mode and the default textarea (#16071) Adds five cases to ChatInput.listContinuation.test.tsx that #15911's suite left to a local probe: a new line over a selection keeps the native break, Shift+Enter continues the list in ctrl-enter and enter-ctrl-newline modes, plain Enter still sends in enter-ctrl-newline, and the default composer renders the textarea rather than the Lexical editor.
Problem / Motivation
Goal: Typing
1. testand pressing Return on a phone starts the next line with2., the way #14754 promised.A user reported that numbered-list continuation does nothing when they press Enter in mobile view. It reproduces on current main, and not only on mobile. In every layout,
1. testfollowed by a new line gives a bare newline. That includes a 390px touch viewport, a 600px window with a physical keyboard, and desktop Shift+Enter.Why it matters
#14754 shipped list continuation, but no user can reach it. Anyone writing a numbered or bulleted prompt has to type every marker by hand. On a phone keyboard that is the slowest part of writing a list.
Not a goal
What changed (motivation → approach → change)
A new line on a markdown list item now continues the list in the composer people actually type in, on phones and on desktop. Before, the continuation from #14754 never ran there.
Every production host renders the textarea composer. The Lexical editor is opt-in (
lexicalComposerdefaults to false and no caller sets it), and #14754 put list continuation only in the Lexical editor. Mobile hosts run inctrl-entermode below 768px, so Return there is a plain textarea newline that nothing intercepts.A keydown check cannot fix this for phones. Android Gboard sends keydown
key: "Unidentified"with keyCode 229, and iOS sends keyCode 229 while autocorrect has marked text. What every new-line path does fire is a nativebeforeinputwith inputTypeinsertLineBreak(orinsertParagraphon some Android keyboards). That covers a mobile Return, desktop Shift+Enter and Enter inctrl-entermode. The send key never produces one, because its keydown is default-prevented.chat-input/listContinuation.tslistens for that event on the textarea and runs #14754's purelistLineBreakEditon the text and caret, with paste chips as protected ranges. When the line is a list item it cancels the native break and writes the edit itself, then fires aninputevent. React's onChange then records it as a normal user edit. It first ends the composer's current undo burst, so a Return typed right after the item's text is its own undo step and one Ctrl+Z removes only the new marker. A composingbeforeinputis left to the IME. So is the WebKit Enter that commits a CJK candidate: it arrives aftercompositionendwithisComposingfalse and keyCode 13, so the textarea's keydown asks the shared IME guard (useImeGuard) and marks that one line break as the IME's. A Gboard Return right after a composed word has keyCode 229 and still continues. The listener is attached through a callback ref, so a textarea that remounts (composer collapse and expand, the approval bar, a Lexical load failure) gets it too. Ctrl+Enter inenter-ctrl-newlinemode inserts its newline inkeyboard.tswithout abeforeinput, so that branch calls the same edit first, unless the IME guard says the key is the IME's.Backwards compatibility
Compatible: only a new line on a markdown list item changes. Plain lines, the send key in all three modes, IME commits and paste chips behave as before.
Tests
website/src/test/ChatInput.listContinuation.test.tsxrenders the realChatInputand dispatches the nativebeforeinputa browser sends. It covers:insertLineBreak(ctrl-enter mode)1.to2., no sendinsertParagraph9)continues to10)-continues and the rest of the line moves downcompositionend)compositionend)entermodeenter-ctrl-newlinemodeenter-ctrl-newlinemode while the IME owns the keyctrl-entermodeWith the production change removed, 13 of the 18 fail.
Manual verification
No physical phone was used. I drove the built dashboard (an isolated feature gateway) in Chromium with Playwright, in three contexts. One was 390x844 with
isMobile,hasTouchand an iPhone Safari user agent. One was 600x900 with a physical keyboard. One was a 1400x900 desktop. Each case typed1. testwith real key events and then made a new line as follows:keyboard.press('Enter')(Shift+Enter on desktop);Enter/13, thenbeforeinputinsertLineBreak;Enter/229 withisComposing,compositionend, theninsertLineBreak;Unidentified/229, theninsertLineBreak;insertParagraph.On main every case gave
1. test\nnext. With this change every case gives1. test\n2. next, in all three contexts. A second new line on the empty2.ends the list,- acontinues to-, and desktop plain Enter still sends the draft. The page renders the textarea in all three contexts.Screenshots / video
Mobile, 390px, after typing
1. test, Return,second:Desktop, 1400px, Shift+Enter
Related Issues
no linked issue: reported directly; follows up #14754, whose continuation only ran in the opt-in Lexical editor.
Pattern harvest
Rule candidate: review-prompt
Pattern: a composer behaviour added only to the opt-in Lexical editor never reaches users while the textarea is the production composer; ask whether the textarea path got the same change.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)