Repository navigation
feat(composer): continue markdown lists on new line - #14754
Conversation
|
Intent: A new line on a markdown list line in the chat composer continues the list, and a new line on an empty item ends it, so users can type lists without retyping markers. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Manual verification was Chromium-only; confirm in real Safari that [DESIGN-REVIEWED] 5f88630 Description read[DESCRIPTION-READ] 00cd84249e753b4662875c6e876096dcb98e1f70d907b3822b85af8ff2d9c617 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) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Splitting mid-item in a numbered list duplicates the next ordinal, silently producing the mis-ordered steps this PR's motivation warns about. Watch
[UX-REVIEWED] 5f88630 Description read[DESCRIPTION-READ] af1949a807938546eab4fb1de8a9d442ded08964c9dd65d1abad0d8052e197d9 That sha256 names everything this verdict read: the PR description, plus the 5 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 Verify the WebKit claim on real Safari: "WebKit's beforeinput" → What this change shipsInventory (8 items) — 8 justifiedIntent: pressing the new-line key on a markdown list line in the chat composer starts the next list item — an ADDITION (Fixes #14753).
Notes a human may want: the md-notebook helpers ( [FIRST-PRINCIPLES-REVIEWED] 5f88630 Description read[DESCRIPTION-READ] b3620c259dd7634a1d3cebd41064c381e5cd75c2235c935f8491c3f26eb70d53 That sha256 names the PR description this verdict read. Recompute it with |
|
|
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
8bff26b to
648bb41
Compare
|
|
self-added: no
|
|
note (non-blocking): the two red Backend Tests (Windows) shards on 8bff26b fail in files this PR does not touch: |
648bb41 to
45a47ed
Compare
|
self-added: no
|
|
note (non-blocking): 45a47ed is rebased on current main and folds in the fix for GPT span 5c18d1d1ccad. The rebase brings in #14778, which fixes the |
45a47ed to
44885b3
Compare
|
self-added: yes
|
|
note (non-blocking): 44885b3 is rebased on current main and folds in the |
44885b3 to
727c133
Compare
|
note (non-blocking): same diff, rebased on current main as 727c133 to re-run CI. On 44885b3 both AI review lanes passed and the only red was Backend Tests (3.12, 2) in |
727c133 to
f566bab
Compare
|
|
|
|
self-added: yes
|
|
note (non-blocking): f566bab folds in the four review items above. It is based on main at a5466a0 rather than the tip: main now carries |
A new line on a bullet, numbered or task item starts the next item with the same indent and marker (next number, same delimiter and padding; tasks restart unchecked). A new line on an empty item removes the marker to end the list. The send key is unchanged, IME commits and a caret inside the marker or a mention token insert a plain newline, and undo reverts the continuation in one step.
f566bab to
5f88630
Compare
|
Rebased onto current main (f54747d) as 5f88630. No code change; the diff is the same four files under The three red checks on f566bab were not caused by this PR:
Composer tests (65), tsc and eslint pass on the new head. |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (readiness sweep 2026-09-29): readiness passed, the required PR Readiness check is green on this head, no live CHANGES_REQUESTED, no open blocking review threads; where the PR's files also moved on main since its merge-base, the PR's own tests were run on the main+PR merge tree and passed. Approving and squash-merging.
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.
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.
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.
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.
…5911) The list continuation from #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.
Problem / Motivation
Goal: Pressing the new-line key on a markdown list line in the chat composer starts the next list item.
Today a new line after
- itemor3. stepstarts empty. The user types every marker by hand, and ends a list by deleting a marker they just typed.Why it matters
Lists are a common way to write multi-part requests to an agent: steps, checklists, files to touch. Retyping
-or the next number on every line slows that down. A mistyped number also changes the order the agent reads.Not a goal
What changed (motivation → approach → change)
- item,* item,+ item3. step,3) step4.or4); zero padding kept (09.then10.)- [x] done- [ ]-(empty item)Every new-line path in the composer reaches Lexical as
INSERT_LINE_BREAK_COMMANDorINSERT_PARAGRAPH_COMMAND. That covers Shift+Enter, Enter inctrl-entermode, Ctrl+Enter inenter-ctrl-newlinemode and WebKit'sbeforeinput. The send key is handled earlier and never dispatches either command.LexicalComposerInput.tsxregisters a high-priority handler on both commands. It asks the new pure modulecomposerListContinuation.tsfor an edit and applies it in the same editor update, so the continuation is one undo step. When the module returnsnull, PlainTextPlugin inserts its usual line break.The module reads only the caret's line. Mention detection reuses
leadingMentionBoundaryfromutils/fileTokens.ts, so a mention starts a word, optionally after one opening wrapper. A marker needs a space or tab after it, so a line such as2024.or-on its own is plain text and keeps its characters on Enter. The handler declines while an IME composition is active, and for the caret-stays-put break (selectStart).Backwards compatibility
Compatible: only the new-line action on a list line changes. The send key, paste, history navigation and the stored plain-text prompt are unchanged.
Tests
website/src/test/composerListContinuation.test.tscovers the pure module: each bullet, both ordered delimiters, zero padding, the unsafe-integer repeat, task items, empty-item removal, mid-line splits, every plain-newline case (caret in the marker, non-list lines, mention tokens including wrapped ones such as(@file)and"$skill"while$PATHanda@b.comstill continue, chip ranges), and a 200k-character unbroken run.website/src/test/LexicalComposerInput.listContinuation.test.tsxdrives the real editor in all three send modes. It checks that the send key still sends and leaves the text alone, empty-item removal with caret placement, a mid-line split, a trailing paste chip, one-step undo, the IME latch, the paragraph command and theselectStartbreak.Manual verification
Typed lists with real keystrokes in Chromium against the real
LexicalComposerInput, in dark and light themes. The recording below shows each case being typed.Screenshots / video
Light theme
demo.webm
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Related Issues
Fixes #14753