Repository navigation
feat(chat): add inline paste token composer - #8310
Conversation
998b4c4 to
3aed02a
Compare
First Principles Review (Fable 5.1, fork) — 🟡 CONCERNSPremise-level review of Confirmed: no prior Lexical or First-Principles-Verdict: CONCERNS Honestly-framed incremental migration, but the whole slice ships behind What this change shipsIntent: fix the textarea/mirror paste-highlight detach by representing pastes as real inline editor nodes — an ADDITION (author explicitly declines
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 64b5b67 |
Design Review (Fable 5.1, fork) — 🟡 CONCERNSDesign-level review of Verified two things before judging: Design assessment: this is a well-structured incremental migration — opt-in off by default, textarea kept as the declared rollback target with a lazy-load error boundary and recovery notice, paste policy and IME latch factored into shared modules, and an engine-neutral Design-Verdict: CONCERNS Sound, reversible migration-slice design; the real risk is two full composer implementations that must stay behavior-identical for an open-ended window with no parity harness pinning them. Watch
Suggestions
[DESIGN-REVIEWED] 64b5b67 |
UX Review (Fable 5.1, fork) — 🟡 CONCERNSUX-level review of This is the fork lane: PR is from owner Reconcile — user-visible surface this diff adds (all gated behind the default-off
None appears in a materialized screenshot; no first-time reader has seen any of them. The default textarea path (the production path) is behaviorally unchanged by this diff. Checks against the read-off BLOCK exits: no blind read → the primary-control exit cannot fire. The textarea↔Lexical substitution is gated on an opt-in flag / async lazy-load failure (lens-4 lifecycle), not a runtime flip of a persistent element the user identified — not a lens-13 hard swap. The fallback notice asserts what happened and the recovered state (draft unchanged) — it neither hedges nor is content-free. So no BLOCK; verdict is capped at CONCERNS by the evidence gaps. UX-Verdict: CONCERNS Every new user-visible control ships unseen — fork lane has no screenshots and no blind read, so comprehension of the paste-token chip and fallback notice is unverified. Watch
Evidence gaps
[UX-REVIEWED] 64b5b67 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
3aed02a to
bd8225a
Compare
Fix: |
bd8225a to
d803aad
Compare
Fix: the plugin now uses the repository's shared IME latch ( |
d803aad to
65ef15d
Compare
Fix: the boundary now logs the error and component stack via the repository's boundary convention ( |
65ef15d to
a025deb
Compare
Fix: |
a025deb to
6e1ebc7
Compare
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Add a default-off Lexical composer path with atomic inline paste nodes, editor-neutral selection and focus controls, shared clipboard policy, lazy-load rollback, and focused regression coverage while preserving the textarea fallback.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Builds on the inline paste-token composer shell from kirodotdev#8310 (Lexical 0.50, `ComposerControl`, `composerPastePolicy`, IME latch, lazy load + textarea fallback) and replaces its read-only `PasteTokenNode` with a richer pill: - `PasteBlockNode` carries the block itself (id/seq/lines/content) so undo, copy-expansion and the preview never depend on the host's block list; it is inline, atomic and not keyboard-selectable (arrows step over it, typing next to it never replaces it, Backspace/Delete remove it in one keystroke). - The pill label is the paste's first line (CSS-truncated) + line count. The accessible name leads with that snippet (voice control can say what it sees) and the hover title carries the WHOLE first line plus the two hidden actions, "Click to edit · drag to reorder", which is also the pill's accessible description; a small decorative pencil glyph beside the ✕ makes editability visible without hovering. - Click / Enter opens an EDITABLE preview anchored above the pill (below when there is no room): scrolls both axes, sized to content and clamped to the viewport, its own corner resize handle, Save writes the edit back into the block (token line count and snippet update), Cancel/Escape return the caret right after the pill. Dismissal never destroys an edit in one gesture: a click outside SAVES unsaved edits, Escape with unsaved edits shows a hint and only a second Escape (or Cancel) discards, Escape the IME owns is claimed by the shared latch, and every other key stops at the panel so the page's Ctrl+digit / Settings chords cannot unmount it mid-edit (the same boundary Modal and ui/dialog draw). - Pills drag to reorder: a live gap node opens in the text under the pointer, the source pill dims, a translucent drag image hangs below the cursor so the drop point stays visible; drop moves the node, the gap is cleaned up on drop/dragend/leave and by a watchdog, and a pill can never nest in another. - The `/`, `$` and `@` pickers anchor to whichever composer surface is live. - `lexicalComposer` is turned on for ChatPage, ChatPane and SideChat; the flag and the textarea fallback stay in place for the chunk-load-failure path. The page-level composer probes follow: `queryComposer()` and the keyboard-switch release resolve `[data-composer-input]` on either element (the Lexical root is a contenteditable div, so the textarea-only selector made Alt+Enter, `/`, quote-to-compose, widget prefill, post-create focus and search-close silent no-ops), and SideChat's Select-to-Ask seed places the caret through the root's `ComposerRootHandle` (`composerHandleOf`), the typed seam the test drivers already used. A source ratchet (`test/chatInputHosts.lexicalComposer.test.ts`) makes every product `<ChatInput>` mount name the prop, so a future host cannot fall back to the textarea by omission. Shell fixes found while porting: a composition abandoned without `compositionend` left Lexical's own composition key set and the editor deaf to every keydown (recovered on focusout alongside the shared IME latch); the test hook's `insertText` now appends when the editor was never focused and clears the selection for an empty string. Tests: the page-level suites that drove the `<textarea>` directly (`.value`, `fireEvent.change`, `getByPlaceholderText`) now go through the `composer*` drivers in `test/helpers.tsx`, which exercise the real editor via the `__composer` hook on its root and wait for the lazy chunk (`awaitComposer`). New unit suites cover the node, chip, preview editor and drag plugin; `scripts/capture-composer-pills.mjs` drives the real ChatInput in Chromium through 27 checks (paste, caret/arrow semantics, undo, keyboard focus, preview edit/save/cancel/resize, dirty-Escape guard, click-away save, IME-owned Escape, below-the-pill placement, drag reorder, IME, send, history, pickers, copy expansion) and records the screenshots + video. The Playwright E2E specs locate the composer through a shared helper (`playwright/helpers/composer.ts`: the `[data-composer-input]` hook plus a text reader that works on the Lexical root and the textarea) instead of `getByPlaceholder`/`toHaveValue`, which the contenteditable root never satisfied; `PillKeyboardPlugin` gets its own unit suite; the dev-only harness page is excluded from coverage like the Storybook fixtures.
Problem / Motivation
Collapsed paste markers are rendered in a native textarea while their background and hover hit area come from a separate mirrored div. Browser wrapping, resize, and scroll behavior can make those two layouts diverge, detaching the highlight and preview from the marker text.
Why it matters
A detached paste token is visually misleading and difficult to target. Additional mirror synchronization cannot guarantee parity because textarea layout is browser-owned.
What changed (motivation → approach → change)
This PR adds a default-off Lexical composer path that represents collapsed pastes as real atomic inline editor nodes. The existing serialized
[ Paste #N · M lines ]value andPasteBlock[]sidecar remain canonical, so textarea rollback and stored drafts remain compatible.The slice includes:
PasteTokenNodemarkComposerResize), so the transcript's bounce fix from perf(chat): reachable archived history and stable phone scrolling #7916 holds when the editor grows under typingNo production caller enables
lexicalComposer; the textarea remains the default and rollback path while broader rollout evidence is gathered.Tests
namespaceconfig identifier is exempted ineslint.i18n.config.jswith a measured rationale (single occurrence, no baseline handed back)Manual verification
A real Chromium harness verified that inline nodes remain inside the editor during wrapping, narrowing, and internal scrolling, previews anchor to the actual node rectangle, large pastes create new atomic nodes, no mirror is rendered, and no browser Lexical errors are emitted.
Screenshots / video
Before — the textarea/mirror path with the highlight detached from the marker text (identifying regions redacted):
After — the paste token as a real inline Lexical node laid out with the surrounding text:
After — the preview anchored to the token's own DOM element:
Related Issues
Related to #8309 — deliberately NOT
Fixes: this slice ships default-off with no production caller, so the defect remains user-visible until a rollout PR enableslexicalComposer; auto-closing the bug here would be dishonest.Pattern harvest
Rule candidate: review-prompt
Pattern: Do not style native textarea substrings through a separately laid-out mirror when alignment must survive wrapping and scrolling; use one editor-owned inline node.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)