Skip to content

feat(chat): rich paste pills in the Lexical composer, on by default - #11100

Closed
qh2244 wants to merge 2 commits into
kirodotdev:mainfrom
qh2244:composer-pills
Closed

qh2244 wants to merge 2 commits into
kirodotdev:mainfrom
qh2244:composer-pills

Conversation

@qh2244

@qh2244 qh2244 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a paste marker you can read, edit, reorder and remove in place — a real pill in the composer that is on by default on fine-pointer devices — while the host keeps the exact value contract it already speaks (marker text plus paste blocks) and a send expands each pasted block exactly once.

A large paste into the chat composer collapses to a marker such as [ Paste #1 · 18 lines ]. Today that marker is opaque: you cannot see what landed, trim it before sending, or move it — only keep it blind or delete and re-paste. On the <textarea> path its highlight is a mirrored <div> that drifted off the text (#8309; #14002 fixed the drift, the marker is still not editable, movable or atomic). #8310 landed a Lexical paste-token composer that makes the marker a real node, but behind the lexicalComposer prop no host passes, and its pill is read-only.

Why it matters

Pasting logs, stack traces and code is the dominant way context enters a prompt. Every paste that cannot be verified or corrected before Send goes out slightly wrong, and every delete-and-re-paste to reorder is friction on the hottest input path in the product.

Not a goal

  • Changing how pastes are collapsed or thresholded, or how sent pastes render.
  • Deciding by text alone whether marker-shaped text is a pill — only a paste event, a tree node or a drag key knows that.
  • Any behaviour change on touch devices, which keep the <textarea> path.

What changed (motivation → approach → change)

Approach: keep #8310's shell — LexicalComposerInput, ComposerControl, the paste policy, the shared IME latch, the lazy chunk + <textarea> fallback — and replace its read-only PasteTokenNode (deleted; main's later #14798 hover-preview touch guard has no counterpart, the pill opens on click / Enter / Space only) with a node + plugin set under website/src/composer/. The value stays the marker string plus the PasteBlock sidecar, so drafts, history and the backend expansion are untouched.

Part What a user gets
PasteBlockNode + PasteBlockChip (src/composer/) An atomic inline pill labelled with the paste's first line and line count (read from a bounded 4 KiB prefix, memoized), a pencil cue and a ✕. Hover title and accessible description name the three hidden actions ("Click to edit · drag to reorder · Backspace removes"); both carry the paste's #N, spelled by the catalog (pasteBlockChip.seq, pasteBlockChip.seq_name — №2 in Russian), so twins stay distinguishable and AT never disagrees with the tooltip. Arrows step over it; Backspace removes exactly one pill; undo brings it back. Markdown list continuation reads pill positions from PasteBlockNode.
PastePreviewEditor + PillsPlugin Click / Enter opens an editable preview bound to the pill's node key: every keystroke writes through; Save is one undo step; Cancel or a second Escape restores; click-away commits; Tab cycles inside (the resize grip is a tab stop); IME-owned Escape never closes it; the panel follows the pill on resize and scroll, clamped by its real width.
PillDragPlugin + DropGapNode Drag to reorder with an insertion caret, no nesting; the transient gap's updates carry Lexical's historic tag, so undo never lands on a stranded gap.
PillKeyboardPlugin One-keystroke delete, ←/→ escape from a focused pill, Enter opens the preview.
ComposerControl.replaceText and the history invariant Optimize, ↑/↓ recall and picker insertions replace the draft as one undo step. ↑/↓ parks the draft with its paste blocks beside main's PromptHistoryCursor (#14756) and brings both back past the newest message, so expandAll never sends a marker where a body belongs. Every host-originated value change is an undo step (slash command, quote-to-compose, prefill, chip removal, dictation splice, send-clear — RFC Q6); history is cleared only when historyKey (the slot) changes. On main's split ChatInput (#15284) the engine (chat-input/engine.tsx) owns replaceLexicalText, the composerReady gate and the load-failure marker; ChatInput hands one replaceInSlot writer to chat-input/pickers.ts, attach.tsx, PickerMenus.tsx and optimizer.ts; + → /, @, $ and Optimize are disabled while the lazy chunk loads; the offline guard in chat-input/busySend.tsx's fireComposer makes an offline Enter leave the draft untouched, and the mid-turn Queue / split-send controls read disabled rather than swallowing the press.
splitDuplicateMarkers (src/utils/pasteTokens.ts) in ChatInput, plus PasteSeqInvariantPlugin No two markers share a seq and no two blocks share an id; both composers read one canonical pair.
allocateSeq / nextSeqIn and the reservation in carryPastes Every fresh seq steps past every marker already in its destination text, claimed or not. carryPastes requires the destination text: the chat-core Paste atom's carry (chat-core/composer/composerPastes.ts, wrapped by ChatPane), chat-core/composer/sideChatDrafts.ts, utils/chatPaneDrafts.ts, the send/create-failure recoveries in ChatPage, and the create-carry (moved by #17101 into pages/chat/page/composerDrafts.ts), which reserves against both candidate destinations — stored draft and launcher prefill. Hand-typed marker text stays inert; one block backs exactly one marker (the first occurrence). On the <textarea> path the paste event is the boundary: chat-input/paste.ts (repairTextareaPasteCollision) re-sequences an existing block whose seq the pasted text carries before the literal is inserted.
ChatPage, ChatPane, SideChat pass lexicalComposer={!touchDevice} Where neither (pointer: coarse) nor (hover: none) matches (utils/isTouchDevice.ts) the host gets the pill composer; touch, stylus-only and a failed chunk load keep the <textarea>. Read once at mount (useTouchDeviceAtMount, hooks/useIsTouchDevice.ts). A source ratchet (test/chatInputHosts.lexicalComposer.test.ts) requires every product mount — including main's StableChatInput wrapper — to name the prop and bind its gate from the mount-latched hook; a reactive useIsTouchDevice() read elsewhere (ChatPage's sendOnEnter, #16585) stays gated.
pages/chat/composerFocus.ts Page probes, including main's per-pane queryComposerForSlot (#16537), resolve [data-composer-input] on either element, so Alt+Enter, quote-to-compose, widget prefill, palette focus and the macOS keyboard-switch chain work on the default composer.

Product-shape decision. The default flip is recorded in RFC #12627 (rfc-inline-paste-composer.md, in-progress; amends rfc-chat-core-extraction §3). Splitting the flip out remains available — the diff is reachable behind the existing prop.

Also: ChatPane and SideChat carry the sidecar (#12915) and honour showFullPastes. styles/cli-mode.css indents the input, its placeholder overlay and the textarea's chip mirror (#14002) by the same 24px. Shell fixes: a composition abandoned without compositionend left Lexical deaf (recovered on focusout via the IME latch). Strings: pasteBlockChip.* / pastePreviewEditor.* in all 13 catalogs under website/src/i18n/locales/ plus pluralKeys.json. Feature map: docs/feature-map/README.md states the composer default and the pill row. Deps: @lexical/headless devDependency, lockfile updated; vite.config.ts excludes the dev harness (src/composer/__harness__/) from coverage. Bundle budget: unchanged (+7.3 KB in the all catalog chunk).

Backwards compatibility

Compatible: value string, block sidecar, drafts, history and send payload unchanged; a persisted draft with a duplicate seq or id is repaired on load. lexicalComposer={false} remains a supported per-host decision. Test drivers change shape (__composer hook and [data-composer-input] replace textarea reads); no assertion is weakened.

Tests

  • New unit suites (website/src/test/composer.*): PasteBlockNode / DropGapNode, PasteBlockChip (label, remove, keyboard, catalog-spelled #N in the name — red on the literal template under ru), chatInputHosts.lexicalComposer and .touchGuard, PillKeyboardPlugin, PastePreviewEditor, PillDragPlugin, splitDuplicateMarkers, allocateSeq / nextSeqIn, PasteSeqInvariantPlugin, ChatInput.canonicalPaste, ChatInput.textareaPasteSeqInvariant (before / after / over-the-marker / two copies — the before and over cases fail without the paste-event repair), ChatInput.lexical (host writes undo; offline Enter keeps the draft), ChatInput.lexicalReadyGate; pasteTokens pins the create-carry reservation, chatPaneDrafts and ChatPane.pasteSidecar the recovery and batched cases.
  • LexicalComposerInput.test.tsx: feat(chat): add inline paste token composer #8310's tests on click-opens-preview semantics; ↑/↓ round-trip restores the draft with its block; a slot switch or host value change ends browsing; twins survive ✕ and Save; write-through, Cancel, second Escape, one-step Save, resize follow; plus main's six cases (cursor recall surviving a list change, ending on scope change or edit; ⌘↑/Ctrl+↑ edit-last). main's two hover-preview cases (fix(website): keep touch taps from opening InstantTip hints #14798) are not carried: they exercise the deleted node's hover-opened preview.
  • Migrated page suites: every ChatPage / ChatPane / SideChat test that drove the <textarea> directly goes through the composer* drivers in test/helpers.tsx, including the suites main added through each rebase (file-chip parity, memory chip, follow-ups, draft carry, chip undo, palette pane focus, drop offsets, draft recovery, scroll chrome). Two expectations changed on purpose: a recovered queued message is re-sequenced to #2 by the one-seq-per-marker invariant, and TerminalRegistryCoverage asserts the snippet-first label instead of Paste #1 · 3 lines.
  • Playwright E2E (website/playwright/): chat, fork, navigation, member-memory, voice-recovery and new-session-draft-carry specs locate the composer through playwright/helpers/composer.ts; the offline driver passes.
  • Locally on 6a80dc7c4 (base 334335182): tsc, eslint at 0 warnings, i18n:check with the base ref, phantom-class / restyle / theme ratchets, focus-cue, decision-ledger, docs_lint.py, check_feature_map.py all green; every suite touching a composer surface — 1770 files / 9418 tests — passes.

Manual verification

website/scripts/capture-composer-pills.mjs drives the real ChatInput (via the dev-only harness) through 32 checks: paste → pill; arrows cross it; Backspace / undo; Tab focus; preview open / edit / save / cancel / resize; drag reorder; ✕; Chinese IME commit lands after the pill; Shift+Enter vs Enter; ↑ recall; /, $, @ pickers; copy expands; dirty Escape hint then discard; click-away saves; below-pill placement; live write-through; re-anchor on resize; whitespace-only paste; dark theme from computed colours. Chromium 145: 32/32 (0 page errors); Firefox 146: 30/31, 1 skipped (the IME step is CDP-only). WebKit could not be provisioned on the author's host; RFC #12627 Q5 asks the maintainers to run it or record it out of scope.

Screenshots / video

Full flow (captions per step):

4e1515b0ae8b39ad8e02d62d6a2c9f4e.webm

Big paste becomes an inline pill
Editable preview above the pill
Typing in the preview updates the pill at once
Mid-drag insertion caret
After drop, reordered
Preview opens below the pill when there is no room above
IME committed
Dark theme: pill and open preview follow the theme tokens
Firefox 146: editable preview with a live edit

CLI mode, the 280px minimum panel width and the narrow-pane one-line hint (committed under temp-screenshots/composer-pills/; a fork account cannot attach through the CLI, cli/cli#14302):

CLI mode: accent prompt left of the indented placeholder
CLI mode: typed text and a pill start right of the prompt
280px minimum panel width: the two-exit hint wraps on three lines, Cancel and Save clear
420px pane: the hint stays on one line with a faded tail

Frames recorded from 783c65341 (unchanged since; the evidence commit adds only these PNGs on top of the production commit), headless Chromium 145 / Playwright 1.58.2, 32/32 checks, real ChatInput harness on a local vite dev server.

More Chromium and Firefox frames

Small paste plain
Backspace removes pill
Undo restores pill
Pill keyboard focus
Preview long paste fills room
Two pills snippets
History recall
Skill picker
Select all copy
Click away saved
Snippet-less fallback pill
Firefox 146: big paste becomes an inline pill
Firefox 146: mid-drag insertion caret

Related Issues

Related to #8309 — resolved on mouse and trackpad surfaces, where the pill composer replaces the mirrored-<div> overlay; touch devices keep the <textarea> path, so the issue stays open for the touch follow-up.

no linked issue: #8309 closes with the touch follow-up, not with this PR; no other issue is resolved here.

Related: #8513 (the preview lets you read and trim a paste before sending). Builds on #8310. Decision record: #12627. Follow-up: #11122 (keyboard reorder). #11337 landed as #12915 and is absorbed by the rebase.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable) — the decision record is docs(rfc): record the inline paste-pill composer default-on decision #12627
  • No secrets, credentials, or internal references in the diff

@qh2244
qh2244 requested review from a team and krishdhasmana September 15, 2026 20:36
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of ace7f51c25d623e0d9d1c08143649dae8a35744b via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The pill composer becomes the default on the busiest input path in this PR, and the decision rests on an RFC that is still in-progress, not a recorded maintainer decision.

Watch

  • Default flip without a recorded decision. The description says "The default flip is recorded in RFC docs(rfc): record the inline paste-pill composer default-on decision #12627 (… in-progress; amends rfc-chat-core-extraction §3)". Every fine-pointer user moves from <textarea> to Lexical at once, through ChatPage, ChatPane and SideChat. Rollback is a revert of this whole large PR, not a one-line flag change. The engine is still reachable behind lexicalComposer, so splitting the flip into its own commit or PR would keep it reversible without losing the work.
    Clears when: RFC #12627 is merged or accepted by a maintainer, or the !touchDevice default moves to its own commit/PR.
  • Backwards-compatibility list cut off. ## Backwards compatibility is the last section before the [description TRUNCATED notice, so I could not check its reader list. I checked two take-aways myself and found no broken reader:
    • The deletion of PasteTokenNode: its only reader is LexicalComposerInput, which this patch rewrites.
    • The new required keepText argument on carryPastes: every caller (chatPaneDrafts, sideChatDrafts, composerPastes, ChatPage, composerDrafts) is updated in this patch.
      Clears when: the description is shortened so the full Backwards compatibility section fits under the cap.

[DESIGN-REVIEWED] ace7f51

Description read

[DESCRIPTION-READ] 2d63383e5b0ea555ab05afb4a13bd761a18c62aaf5ef9179c0a643fbc418a473

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🔴 BLOCK

Premise-level review of ace7f51c25d623e0d9d1c08143649dae8a35744b via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: BLOCK

product-shape change without accepted RFC: the Lexical pill composer becomes the default chat input, and the RFC it cites isn't on the base list.

Not justified as shipped

What this change ships

Inventory (8 items) — 7 justified

Intent: let a person see, edit, reorder and remove a collapsed paste before sending. This is an ADDITION.

  1. The pill composer replaces the <textarea> by default on fine-pointer devices in all three hosts — product shape, no recorded decision
  2. Clicking or pressing Enter on a pill opens an editable preview with write-through, Save and Cancel — justified
  3. Pills can be dragged to reorder, with an insertion caret — justified
  4. Backspace deletes a pill in one keystroke, and the arrow keys step over it — justified
  5. ↑/↓ recall and Optimize replace the draft as one undo step, keeping its paste blocks — justified
  6. Duplicate paste seqs or ids are repaired, including in persisted drafts — justified
  7. Alt+Enter, quote, prefill and focus now find the Lexical composer — justified
  8. The read-only PasteTokenNode is deleted — justified

Blockers

  • product-shape change without accepted RFC: Lexical composer on by default
    The description says "The default flip is recorded in RFC docs(rfc): record the inline paste-pill composer default-on decision #12627 (rfc-inline-paste-composer.md, in-progress…)". The base status list has no such entry. The only related entry is rfc-chat-core-extraction.md:status: partial, and its §3 and §4 cover extracting the composer atoms (a textarea Composer.Editor), not making Lexical the default.
    Clears when: an RFC covering the Lexical pill composer as the default is merged non-draft on the base, followed by a push or rebase; or a maintainer posts /ai-review override first-principles ace7f51c25d623e0d9d1c08143649dae8a35744b: <decision>.

[FIRST-PRINCIPLES-REVIEWED] ace7f51

Description read

[DESCRIPTION-READ] c4ee43eaad833ebbcafa3c524edff38b1ad5158315e0e23bde69423c5be623f1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🟡 CONCERNS

UX-level review of ace7f51c25d623e0d9d1c08143649dae8a35744b via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

No first-time reader has looked at the new pill or its editor; the 26 stills and one recording cover the main path but no blind read was run.

Watch

  • The unsaved-changes warning is hard to read where it matters. In attachment-25 the warning ("Unsaved changes — press Esc again to discard, click away to keep") is small amber text on white, wrapped over three lines beside Cancel/Save. That one line decides whether an edit is kept or lost, so faint text at the moment someone presses Esc puts the edit at risk. Rare but costly. Fix: use the warning text token at body contrast, and put the warning on its own line under the header instead of beside the buttons.
  • Two of the three pill actions are only in the hover title. "drag to reorder · Backspace removes" lives only in the pill's tooltip. The pencil shows that the pill can be edited, but nothing visible shows it can be dragged or removed with Backspace. This hits every pill, but it is low impact because ✕ also removes. Fix: change the cursor to a grab cursor while dragging.
  • Some new disabled states have no screenshot. These are the Queue button and the split-send button disabled while offline, and the + → /, @, $ rows plus Optimize disabled while the editor loads. They reuse the product's existing faded disabled style, so this is low risk. Fix: attach one still of the offline Queue button.

Suggestions

  • On a pill, show #N only when two pills have the same first line. Today twins can only be told apart by hovering.

[UX-REVIEWED] ace7f51

Description read

[DESCRIPTION-READ] 2122fe068d721647471311579d79f153c3b1a3d7bd6c4de4bcad19d5fdb1f42a

That sha256 names everything this verdict read: the PR description, plus the 29 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — 🔴 changes requested (blocking)

Reviewed ace7f51c25d623e0d9d1c08143649dae8a35744b via the fork AI-review pipeline; updated in place on each push.

1 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- website/src/composer/plugins/PasteSeqInvariantPlugin.tsx:72 -- Literal-collision repair defeats failed-send deduplication
group[index].setIdentity(makePasteId(), freshSeq)
Undo a pending send’s clear, insert its marker literally, then receive a refusal -> repair changes the restored block’s ID -> ChatPane recovery treats it as new -> retry sends the paste body twice.
Anchor: residual/crash-data-loss-corruption
Fix: Preserve existing IDs when resequencing for literal collisions; mint IDs only for genuinely duplicated nodes. Preserve the ID in website/src/components/chat-input/paste.ts:63 too.

BLOCKING -- website/src/test/helpers.tsx:122 -- Lazy-composer readiness uses the default one-second deadline
await rtlWaitFor(() => {
A cold Lexical import exceeding one second on a loaded runner -> migrated host tests call awaitComposer -> the default deadline rejects readiness while the composer is still loading correctly.
Anchor: frontend-tests-are-deterministic
Fix: Supply an explicit named lazy-load timeout here and in the equivalent newly added local composer-readiness waits.

[BLOCK-MERGE] ace7f51
[GPT-REVIEWED] ace7f51

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F2 is anchored to frontend-tests-are-deterministic, which has blocking: true (website/AUTOSDE.yaml:737-738). Its file pattern src/**/test/**/*.tsx (website/AUTOSDE.yaml:743) covers website/src/test/helpers.tsx. The rule flags any waitFor behind a lazy boundary that has no explicit timeout (website/AUTOSDE.yaml:783-786). The added awaitComposer calls rtlWaitFor with no timeout option (patch line 16840), and its own comment says it waits on the lazily loaded Lexical editor (patch lines 16833-16836). The rule outranks weighing.

F1 is fenced. The repair at patch line 3960 does mint a new id for every colliding pill whenever a literal carries the same seq (patch lines 3952-3960). I did not open the ChatPane failed-send recovery path this run, so I can't record a FLAG.

[ADJUDICATION] ace7f51c25d623e0d9d1c08143649dae8a35744b total=1 uphold=1 downgrade=0
UPHOLD F2 website/src/test/helpers.tsx:122 reason=autosde-blocking-rule
[GPT-ADJUDICATED] ace7f51c25d623e0d9d1c08143649dae8a35744b

[ADJUDICATION-FENCED] ace7f51c25d623e0d9d1c08143649dae8a35744b fenced=1 flagged=0
UPHOLD-FENCED F1 website/src/composer/plugins/PasteSeqInvariantPlugin.tsx:72 -- The repair always mints a fresh id for a pill that collides with a literal, and the ChatPane recovery path was not checked this run, so the duplicate-send claim stands as written.
[GPT-ADJUDICATED-FENCED] ace7f51c25d623e0d9d1c08143649dae8a35744b

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed ace7f51c25d623e0d9d1c08143649dae8a35744b via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] ace7f51

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions — GPT 5.6 Review of 51d5337

  • Keyboard shortcuts discard unsaved paste edits (website/src/composer/PastePreviewEditor.tsx:157) — fixed in ebaee4d7eb5878e79f228d1b9ae2b2a12eb11253.

The capture-phase document keydown that closed on any Escape is gone. Escape is handled on the panel's own React onKeyDown through the shared IME latch (useDocumentImeLatch(open).claimSyntheticKey), so an Escape the IME owns — mid-composition, keyCode 229, or inside the post-composition window — is consumed and never closes the panel; the document fallback for focus-outside-the-panel uses the same latch's claimKey. Every non-Escape key is stopped at the panel boundary, so a Ctrl+digit session jump or the Settings chord typed in the textarea no longer reaches useKeyboardShortcuts' bubble-phase document listener (same guard as Modal / ui/dialog). And the dismissal itself no longer discards: a pointerdown outside a dirty panel calls onSave(value) (PillsPlugin's updateBlock then closePreview, in the capture phase — before the click it belongs to can switch sessions), and a dirty Escape arms a visible hint and only a second Escape (or Cancel) discards. Tests in composer.PastePreviewEditor.test.tsx: IME-owned Escape inside/outside never closes; Ctrl+3 / Cmd+, typed inside never reach a document or window listener; dirty Escape → hint → second Escape discards; dirty pointerdown outside → onSave, not onClose. Each fails on 51d5337. Real-browser walk on the harness: Escape during a live compositionstart leaves the panel open; click-away after an edit lands the edit in the block.

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions — Opus 4.8 Review of 51d5337

  • queryComposer() still selects textarea[data-composer-input]; releaseComposerForKeyboardSwitch guards on HTMLTextAreaElement (website/src/pages/chat/composerFocus.ts:48,72,285) — fixed in ebaee4d7eb5878e79f228d1b9ae2b2a12eb11253.

Both lookups and the document-wide fallback now use the bare [data-composer-input] hook typed as HTMLElement (the Lexical root is a contenteditable <div> carrying the same attribute), queryComposerOrExpand's callback takes an HTMLElement, and the release guard is ae instanceof HTMLElement && ae.hasAttribute('data-composer-input'). Every non-test caller (useKeyboardShortcuts.ts:995, App.tsx:2257, focusComposer / revealComposer users in ChatPage, ChatPane, ChatSidebar, useMessageSearch, useChatPageSessionController) only calls focus() / scrollIntoView() on the result, which both elements support. composerFocus.test.ts gains a describe block that mounts the Lexical-shaped root and asserts resolution, focusComposer, revealComposer and the keyboard-switch blur against it — all four fail on 51d5337.

  • Ask→SideChat seed nudge queries textarea[data-composer-input] and uses textarea caret APIs (website/src/pages/chat/SideChat.tsx:548) — fixed in ebaee4d7eb5878e79f228d1b9ae2b2a12eb11253.

The nudge resolves [data-composer-input] and, on the Lexical root, places the caret through the composer's own control: composerHandleOf(el).setSelection(len, len, { focus: true }) with len = handle.getValue().length, in the editor's string-offset space (ComposerControlPlugin). The handle is the seam the test drivers already used as __composer, now typed and exported as ComposerRootHandle / composerHandleOf from components/composerControl.ts, so this is not a DOM-selection guess. The <textarea> path (setSelectionRange) is unchanged and consumeSideChatSeed still fires. SelectToAsk.test.tsx's seed test now asserts focus on the root and composerSelection(root) === { start: len, end: len } — it fails on 51d5337.

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Disposition — First Principles Review of 51d5337

  • Product-shape change without accepted RFC: lexicalComposer becomes the default on ChatPage, ChatPane and SideChat — needs-a-decision (maintainers).

The lane is right that a description is a proposal, not a decision, and this comment is not an attempt to argue past it: the default flip is the maintainers' call, and it will re-trigger on every head until the record exists. The RFC-shaped text is in the description under Default-on: the product-shape decision this PR asks the maintainers to record (summary, problem, proposal, non-goals, risks incl. the open mobile question, rollback). Three ways to clear it, any of which works for me:

  1. Merge the RFC first. Say the word and I open docs/request-for-change/rfc-inline-paste-composer.md as its own small PR (lifted verbatim from the description), then rebase this branch once it is on main.
  2. Override on this branch. A maintainer pushes this branch into kirodotdev/KiroCrew and records /ai-review override first-principles <head sha>: <decision>.
  3. Split the flip out. I drop the three one-line host props (ChatPage.tsx, ChatPane.tsx, SideChat.tsx); everything else in the diff stays reachable behind the existing flag and the default flip becomes its own PR behind the RFC.

I am not re-pushing to loop on this lane; I will act on whichever of the three you pick.

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Disposition — Design Review of 51d5337

  • Default composer flips for every chat surface with desktop-Chromium-only evidence; mobile soft-keyboard input on a contenteditable is a different, unverified path — needs-a-decision (maintainers).

Accurate on the facts: every check and the recording ran in headless desktop Chromium; on a soft keyboard ordinary typing arrives as composition events, so the IME latch and Enter-to-send sit on the hot path, and HTML5 dragstart never fires on touch, so pill reorder is pointer-only there (✕ removal and the editable preview still work). I cannot run an Android/iOS pass from this fork, and I will not claim one. The two ways the lane itself named to clear this are both decisions only the maintainers can take, so the question is now recorded in the RFC-shaped section of the description (Open question for the maintainers — mobile / touch) rather than in an issue nobody could act on:

  • Scope the default flip to non-touch devices: a one-line isTouchDevice() guard at the three hosts (lexicalComposer={!isTouchDevice()}), leaving touch on the textarea until a device pass exists. Say so and I push it in the next round.
  • Or record a smoke pass (type, paste→pill, edit preview, send) on one Android and one iOS browser by someone with devices, before merge.

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions — UX Review of 51d5337

  • Clicking outside the open paste preview silently discards edits — fixed in ebaee4d7eb5878e79f228d1b9ae2b2a12eb11253 (dirty-guard and save, per the two options named).

A pointerdown outside a preview with unsaved edits now saves them (onSave(value)) and closes — "click back into the composer and keep typing" keeps the trim. Escape with unsaved edits keeps the panel open and shows Unsaved changes — press Esc again to discard (translated in all 12 catalogs); only a second Escape or Cancel discards, and typing again withdraws the pending discard. Escape the IME owns never dismisses. Locked in by five tests in composer.PastePreviewEditor.test.tsx and walked in a real browser (edit → click composer → the block carries the edit; edit → Esc → hint, panel stays → Esc → discarded, content unchanged).

Agreed it is a gap: keyboard users can remove (Backspace/Delete) and re-paste but not move. The move needs a small design decision (which chord, what a "step" is next to text vs. next to another pill, how it is announced), and it is independent of the default flip this PR is about, so it is filed as its own task with a proposed contract (Alt+Arrow on a node-selected pill, word-boundary steps, aria-live announcement, shared move primitive with PillDragPlugin) rather than widening this diff after review. The resize handle stays pointer-only on purpose: the textarea already scrolls both axes, so keyboard users lose no content, only a larger view.

  • Below-the-pill placement (and the mirrored grip) appears in no still — fixed (evidence added, no code change).

The description's Screenshots section now carries a real-browser frame of a 40-line paste whose pill sits in the upper half of a 1600px viewport: the preview opens below the pill, all 40 lines visible, and the resize grip is on the bottom-right corner with no scaleY(-1) (asserted from computed geometry in the same walk: dialog.top > pill.bottom, grip class bottom-0, transform: none, panel inside the viewport).

  • Fork lane: no blind cold-read of the pill label / popover — needs-a-decision (maintainers).

The blind read runs only when the branch lives in the repository. Same remedy as the First Principles item: if a maintainer pushes this branch into kirodotdev/KiroCrew, the lane can run it; I cannot trigger it from the fork.

  • pastePreviewEditor.lines header stays "6 lines" while the textarea holds 3 (Suggestions) — fixed in ebaee4d7eb5878e79f228d1b9ae2b2a12eb11253.

The header count is countLines(value) while the textarea differs from the saved content (the same helper the pill's own count uses), so it follows every edit; test the header line count follows the edited text, and the real-browser walk reads "41 lines" after appending a line to a 40-line paste.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 15, 2026
@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions — UX Review of ebaee4d7e

  • Cannot evaluate: no attachment shows the "Unsaved changes — press Esc again to discard" state; no attachment shows the below-the-pill placement — fixed (evidence): both frames are now in the description's Screenshots / video section (the round-2 body edit that carried them landed after this verdict ran), and scripts/capture-composer-pills.mjs gained steps 22–25 so they are reproducible, not one-off: step 22 edits a paste, presses Escape once, asserts the hint text and that the panel is still open, and captures 29-unsaved-hint-after-escape.png; step 25 opens a 40-line paste in a 1600px-tall viewport, asserts dialog.top > pill.bottom, grip class bottom-0, transform: none, panel inside the viewport, and captures 31-preview-opens-below-pill.png. 27/27 on 9be89d1bd85f86d0126706e2a48fb083be4f66ef.

  • The pill's two actions are invisible: title={snippet} just repeats the visible label — fixed in 9be89d1bd85f86d0126706e2a48fb083be4f66ef.

The hover title is now <whole first line>\n<actions> with actions = "Click to edit · drag to reorder" (new key components.pasteBlockChip.actions, translated in all 12 catalogs), and the same hint is the pill's aria-describedby text (an sr-only span), so screen-reader users hear it too. Test: names the two hidden actions: hover title and accessible description say "Click to edit · drag to reorder"; acceptance step 13 asserts the title's tail.

  • Visible label is the snippet but the accessible name is the generic "Pasted text · 6 lines" — fixed in 9be89d1bd85f86d0126706e2a48fb083be4f66ef.

aria-label is now "<snippet> · Pasted text · N lines" (generic label alone only when the paste has no non-blank line), so a voice-control user can say what they see. Tests: PasteBlockChip snippet label (getByRole('button', { name: 'def main(): · Pasted text · 44 lines' })) and the LexicalComposerInput chip-activation test now asserts alpha · Pasted text · 4 lines.

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Disposition — GPT 5.6 Review of ebaee4d7e

  • line.slice(0, SNIPPET_MAX_CHARS) also truncates the hover title (website/src/composer/PasteBlockChip.tsx:19) — fixed in 9be89d1bd85f86d0126706e2a48fb083be4f66ef.

pasteFirstLine() now returns the uncapped, whitespace-normalized first non-blank line and feeds the chip's title through a new firstLine prop from PasteBlockNode; pasteSnippet() (the 80-char cap + ellipsis) still feeds only the visible label, so a 10k-char first line never lands in the DOM as text — the title attribute lays out nothing and React escapes it. Tests: the hover title carries the WHOLE first line even when the visible snippet is capped (200-char line: label 81 chars, title the full line) and pasteFirstLine (500-char line kept intact).

@qh2244

qh2244 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions — Design Review of ebaee4d7e

  • Default is three per-host opt-ins: a future ChatInput host that omits the prop silently regresses to the textarea/mirror path — fixed in 9be89d1bd85f86d0126706e2a48fb083be4f66ef, by the second of the two clears-when routes named ("a lint/test pins that every product mount passes it").

website/src/test/chatInputHosts.lexicalComposer.test.ts walks production .tsx under src/ (excluding src/test, the dev harness and ChatInput.tsx itself), strips comments, reads each <ChatInput …> opening tag brace-aware, and fails unless every mount names lexicalComposer; it also asserts the three current hosts are found so the scan cannot pass vacuously, and it was proven to fail with the prop removed from SideChat. An explicit lexicalComposer={false} remains allowed on purpose — it is a decision a reviewer can read, unlike an omission. The prop default itself stays off so a bare <ChatInput> (the chunk-load-failure fallback and the component-level tests) keeps its contract; the prop comment in ChatInput.tsx points at the ratchet. Flipping the default inside ChatInput was the alternative; it would have moved the fallback and every bare-mount test onto an opt-out and widened this diff for no user-visible gain, so the ratchet is the proportional fix.

  • The default-on decision has no record under docs/request-for-change/ — needs-a-decision (maintainers), unchanged from the reply on 51d5337 (#issuecomment-5688786041).

Your suggestion — land the RFC as its own tiny PR first, lifted verbatim from the description — is remedy 1 there, and I will open it the moment a maintainer says so; remedies 2 (maintainer override on the pushed branch) and 3 (split the three host one-liners out) stand as well. The fallback/opt-out contract from the first item above is worth recording in that RFC, as you note; the description's RFC-shaped section now carries it.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 15, 2026
@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author
  • Separate "land the editable pills behind the existing prop" from "flip the default" — needs-a-decision

This is alternative (e) of #12627: technically clean and still available; not chosen there because it repeats #8310's outcome — a composer on main that no user has — while the whole diff is already reachable behind lexicalComposer today, and the intent comment names the default as the thing this PR is for. The split costs three host lines plus the #8309 trailer moving to a follow-up, nothing else; the flip is then the one-line change you describe. Maintainer question: keep (e) rejected and merge the RFC as written, or ask for the split — I will carve the three lexicalComposer={!touchDevice} lines out in one push and re-title the PR.

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author
  • Click outside a dirty preview silently commits the edit; a user expecting dismissal keeps an accidental change, recoverable only via undo — needs-a-decision

Accurate description of the shipped model, and it is the model this lane asked for: round 7 ruled that a stray click must not destroy an edit (span 9e4d62ed6808), so the panel writes through and an outside pointerdown commits (PastePreviewEditor.tsx, dismissFromOutside), while the armed hint names both exits — "Unsaved changes — press Esc again to discard, click away to keep" — a wording this lane supplied verbatim (span 8445ca6af8bc). Both exits are pinned by composer.PastePreviewEditor.test.tsx and shown in committed frame 38; undo restores the pre-edit content after the panel closes. "Outside click must not destroy" and "outside click must not commit" cannot both hold; the hint plus one undo step is the compromise that ships. Maintainer question: keep commit-on-outside as recorded, or flip outside-click to discard (then the hint text and frame 38 change with it) — one ruling, applied on request.

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author
  • Two pastes sharing a first line render identical visible labels; the distinguishing #N lives only in the hover title and accessible name — needs-a-decision

Accurate: on this head the seq reaches hover and assistive tech (#2 · 44 lines as the title's middle line; <snippet> · #2 · Pasted text · 44 lines as the name) and the visible label stays snippet + count, deliberately, so the 37 attachments and four committed frames still show the shipped pill. Making the visible label seq-aware is not a chip-local change: PasteBlockChip does not know its siblings, so a twin detector would have to run where the pill list is known — the Lexical node/plugin layer and the textarea overlay — and pass a showSeq prop through both; the intent comment settled neither that mechanism nor a visible-label shape, and the label has moved in three rounds already. Maintainer question: accept hover + accessible name as the disambiguation for the first default (the preview shows the content on click, as you note), or ask for the conditional visible #N from the sibling suggestion — then I add the twin detection at both list layers in one push.

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author
  • Surface #N in the visible label only when two pills share snippet and count — needs-a-decision

The right shape if a visible cue is wanted: it costs the common case nothing and marks exactly the ambiguous pair. It is also a new mechanism — a twin detector over the pill list, computed in the Lexical plugin layer for the pill composer and in the textarea overlay for the fallback, feeding a showSeq prop — plus a visible-label variant the frames do not show, so it is held rather than shipped speculatively, per the same rule that held the other label changes this lane proposed. Same maintainer question as the Watch item above, recorded once per span: rule "yes" and it lands with the twin detection at both list layers in one push; rule "no" and hover + accessible name stay the disambiguation for the first default.

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: none new — carryPastes's destination-text parameter becomes required; the create-carry site reserves against both candidate destinations

  • create-carry can bind pasted content to prefill text — fixed, f2921bafb

Correct, and reachable: ?new=1 is a foreground create that arms create-carry and writes an arbitrary launcher prefill for the same slot; the carry at ChatPage.tsx passed no destination text, so a marker-shaped literal in that prefill sharing a carried block's seq sat before the carried marker and expandAll (first occurrence) bound the block to it. Self-added: the keepText reservation is this PR's, and this was its one unreserved caller.
Sixth hit of this span, so a read-only retrospective (Opus 4.8) ran before the repair. Its ruling on the six mechanisms of the class (findTokenRanges first-only, splitDuplicateMarkers, PasteSeqInvariantPlugin, carryPastes reservation, repairTextareaPasteCollision, pruneBlocks): none removable, each guards a distinct provenance surface (host value, Lexical tree, carry/recovery, textarea paste event); this hit is a missing application of the existing carry invariant, not a new mechanism. Invariant recorded: a carried block's seq is reserved against every marker seq in its FINAL destination text.
Fix closes the class, not the site: keepText: string is required (a caller omitting it no longer compiles; the five other call sites already pass their destination), and the create-carry site hoists its two candidate destinations — the stored draft and the launcher prefill's prompt, read once — above the carry and reserves against both, since over-reserving only yields a higher fresh seq; the expiry / slot / hint logic below is byte-identical. Alternative (reserve inside the composer write path) rejected: string-only, cannot run the marker remap. No contradiction with hits 1–5 (untouched).
Tests: pasteTokens — a carried pill (seq 1) with a destination literal [ Paste #1 · 3 lines ] is renumbered, the literal expands to itself, the content expands once (fails without the reservation); every test call now names its destination. GPT-family fix (gpt-5.6-sol), Opus-family read-only verification (its one finding — six test calls still omitting the argument, invisible to tsc because tsconfig.app.json excludes src/test — fixed in the same commit).

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Round note — 1c0e87fd0 → e33e17a16 (production commit f2921bafb, evidence commit unchanged in content; base main aa7f25a24 unchanged).

Two changes folded into the production commit, nothing else (18 files, +77/−13): (1) carryPastes takes its destination text as a required parameter and the create-carry site in ChatPage.tsx reserves against both the stored draft and the launcher prefill before either is chosen — closing the GPT block on pasteTokens.ts (sixth hit of that span; the read-only retrospective's ruling is in the disposition above); (2) the pill title's #N · N lines line moves into the catalog as pasteBlockChip.seq in all 13 locales (№ in Russian), English rendering byte-identical — fixing the Frontend Lint & Type Check red (check-i18n-strings.mjs added-lines, reproduced locally only with I18N_BASE_REF set, as CI sets it).

Verification on f2921bafb: tsc, eslint, lint:i18n, i18n:check (with I18N_BASE_REF), theme-colour / phantom-class / restyle ratchets, docs_lint.py, check_feature_map.py all rc 0; composer, paste-token, drafts, ChatInput and ChatPane suites 79 files / 1025 tests green. Each fix was written by a model of the originating lane's family and read-only verified by the other family; the one verifier finding (test calls omitting the new required argument, which tsconfig.app.json's src/test exclusion hides from tsc) is fixed in the same commit. Description PATCHed before the push (37 attachments unchanged; committed-frame links re-pinned to this head).

Every whole-design item on 1c0e87fd0 has its disposition (First Principles ×2, Design ×2, UX ×3; GPT ×1 above). Infra, for the maintainer: Publish readiness signal on 1c0e87fd0 died on the GitHub installation API rate limit (gh api … pulls/11100 --jq .user.login → HTTP 403) at 05:36Z; it recomputes on this head. The Opus lane re-stamped normally this time.

@qh2244

qh2244 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Infra note — head e33e17a16 (nothing in this PR's diff; maintainer action needed at your convenience)

  • PR Readiness run 36531160630 could not publish the status for this head: gh: API rate limit exceeded for installation (0/15000 remaining, resets 06:40:59Z). Second occurrence today (the previous head's publish died the same way at 05:36Z). The workflow deliberately does not retry the POST, so the status will only recompute on the next lane completion or an explicit re-run (gh workflow run pr-readiness.yml -f pr=11100 -f sha=e33e17a166ac5b4fc3145f343e45f886f19aaad9) — a fork account cannot re-run it.
  • The 16 fork workflows on this head are at action_required and wait for approval. Once they run, their completions trigger the readiness recompute, so approving after 06:41Z should clear both without further action.

Both PRs merge cleanly onto the current main (1f1b77317, +14 since this head's base): local merge-tree shows no conflicts for e33e17a16 or for #12627's 93b1b17d9; GitHub's mergeability flag is still recomputing.

Update 06:45Z — the approval landed inside the rate-limited window, so the fork lanes died too. Run 36531160630 reports GPT 5.6 Review — could not run, Opus 5 Review — could not run, Internal Content Scan — could not run and Security Scope Review — no leg reported (all started 06:33Z, before the 06:41Z reset; no verdict was produced and no lane comment was re-stamped). Build run 36531167413 (Resolve desktop matrix) and Screenshot Evidence run 36531167183 failed on the same API rate limit exceeded for installation. Design / First Principles / UX posted neutral. Please re-run failed jobs on those three runs now that the limit has reset; the fork account cannot (Must have admin rights). The CI matrix itself is unaffected and still running.

@qh2244

qh2244 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebase note — e33e17a16 → b7b815f4d (production f2921bafb → 73fc12cb5; base aa7f25a24 → df0ea7909).

GitHub flagged the PR CONFLICTING at ~17:10Z after main landed #14227 (df0ea7909, "stop re-rendering the page on every keystroke"), which moves the composer text out of ChatPage's state into a <Composer draft> store and wraps the page's mount in a stable-props shim. Two content conflicts:

  • website/src/components/ChatInput.tsx — main now derives the text as const value = draftText ?? valueProp ?? '' (store first, prop second). Resolution: that derived value is the new hostValue feeding this PR's splitDuplicateMarkers canonicalisation, which then yields value / pasteBlocks exactly as before. The interdiff of this PR's ChatInput patch against the previous head is two lines: the hostValue binding moves from the prop destructure to main's store-aware line. No behavioural change — a canonicalisation rewrite still flows back through onChange (now main's composerUserEdit), and the store makes it a no-op on the next render.
  • website/src/pages/ChatPage.tsx — main's <StableChatInput …> mount replaces the inline <ChatInput …> (no value prop; aboveComposer={composerAbove}, onChange={composerUserEdit}). Resolution keeps main's mount and puts this PR's lexicalComposer={!touchDevice} on it; pasteBlocks / onPasteBlocksChange were already below the conflict and auto-merged. The useTouchDeviceAtMount() / useLanguageGeneration() both-added block keeps both lines. This PR's ChatPage patch is byte-identical to the previous head's (its paste-block carry/persist code already read inputRef / setInput, the shape main kept).

One follow-on fix, folded into the production commit: this PR's host ratchet (website/src/test/chatInputHosts.lexicalComposer.test.ts, RFC #12627 principle 5) flagged main's pass-through <ChatInput {...useStableCallbackProps(props)} /> shim. The scan now follows a typed forwarding wrapper — function W(props: React.ComponentProps<typeof ChatInput>) re-mounting <ChatInput {...props} /> / {...call(props)} — to its own <W …> mounts and holds those to both rules; the shim is dropped only when the wrapper is actually mounted, shims are claimed by occurrence (two same-shaped wrappers cannot mask each other), and an untyped spread or a spread with extra props stays a flagged direct mount. Fixtures cover each case; the vacuity check still lists the three hosts, with ChatPage.tsx now counted through <StableChatInput lexicalComposer={!touchDevice} …>. Written by the Opus-family fixer, verified read-only by the GPT family (one collision case found and closed before publication).

Local gates on b7b815f4d: typecheck, lint, lint:i18n, i18n:check, theme-colors / phantom-classes / restyle-ratchet (all with I18N_BASE_REF=upstream/main), docs_lint.py, check_feature_map.py — green. Related vitest: 758/758 (ChatInput, composer, pasteTokens, chatPaneDrafts, ChatPage drafts/persist/dictation, chat-core composer + draft store, useStableCallbackProps). Body re-pinned to b7b815f4d (4 blob frames; 37 attachments unchanged; template check success; diff_signals --check-body 487/500 words, every changed area named).

Lanes: all prior dispositions were judged on 1c0e87fd0; none of the conflict resolution touches a disposed span. The lanes that died on the installation rate limit on e33e17a16 (infra note above) never posted a verdict there; this head is the one to review. Fork runs on this head may sit at action_required until approved.

bolichen97 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Open-PR triage (2026-10-05): OVERLAPPING. Needs a rebase and a merge discussion.

I checked head b7b815f4d against origin/main a92dde1a6 (merge base df0ea7909). I read the full diff, not just the description.

Rebase needed. main is 843 commits ahead. A git merge-tree dry run conflicts in 20 files:

Not superseded. On main, ChatInput still has lexicalComposer = false and no host passes it. The read-only PasteTokenNode from #8310 is still the only Lexical pill. Nothing that has merged covers editable, reorderable, default-on pills.

Overlaps to settle before either PR lands:

Smaller point: the evidence commit adds 4 PNGs under a top-level temp-screenshots/ directory. Please confirm they should be in the merged tree.

Breaking change / P0: I found no API or contract break. The value stays marker text plus the PasteBlock sidecar, and drafts, history and backend expansion are unchanged. Switching the composer default on desktop is a deliberate, declared behaviour change. I found no P0 in what I reviewed.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • Item 1 — product-shape change without accepted RFC, declared by the title and the feature-map hunk — needs-a-decision

Agreed on the facts: none of the RFCs on the base covers the composer default because the record is #12627 (docs/request-for-change/rfc-inline-paste-composer.md, docs-only, MERGEABLE, re-audited against 334335182 on 2026-10-06 after the maintainer-side triage), which has not merged, so this run cannot see it. Route unchanged: #12627 merges, this branch rebases onto that merge commit and the lane re-reads a base that carries the record; the override path is not consumed on fork PRs. Maintainer question, unchanged: merge #12627 first (this PR follows by rebase), or ask for the three lexicalComposer={!touchDevice} host lines to be split out so the pills land behind the existing prop and the flip becomes its own one-line PR (RFC alternative (e)).

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • Blockers — the default composer for every fine-pointer user changes with no non-draft RFC on the base — needs-a-decision

Same decision as item 1, recorded once per span: #12627 is the RFC for exactly this default (Lexical where neither (pointer: coarse) nor (hover: none) matches; <textarea> on touch and on chunk-load failure; lexicalComposer={false} at one host restores base behaviour, enforced by test/chatInputHosts.lexicalComposer.test.ts), absent from the base RFC list only because it is unmerged — your grep of the base is right that nothing there records it yet. The 2026-10-05 triage on both PRs reached the same conclusion ("the two should be merged together"). Maintainer question: merge #12627 and let this PR rebase onto it, or push this branch in-repo and record /ai-review override first-principles <head>.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • The fallbacks cover only chunk-load failure and render crashes; a behavioural defect leaves every mouse/trackpad user on the broken editor with no in-product remedy — needs-a-decision

Accurate, and the decision is recorded in #12627, not yet on the base: principle 5 makes rollback one visible lexicalComposer line per host (ratchet-enforced, shipped as a release); alternative (c) rejects a user-facing composer setting for Phase 1; Q3 leaves an opt-out setting open to the maintainers if a single-engine defect appears. Your "clears when" names exactly those two outcomes. Maintainer question, unchanged: accept the prop-level rollback as the Phase-1 remedy (ratify #12627 as written), or ask for the Q3 setting as an immediate follow-up.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • Every added control and state is shown, but the blind-read lane cannot run on a fork — needs-a-decision

Nothing blocks by this lane's own verdict; the cold read is the one check a fork cannot trigger. Maintainer action, unchanged: push this branch to the repository so the blind-read lane runs, or record that the 37 attachments and the four committed frames (temp-screenshots/composer-pills/36-39) are sufficient evidence for a first-time read.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • Drag-to-reorder's only affordance is the hover title; non-hovering mouse users and keyboard users without AT never learn reordering exists — needs-a-decision

Accurate for the visible layer: the pencil is the pill's one visible cue (edit), the ✕ is remove, and reorder is named only in the title and the accessible description. Keyboard reorder itself is a named later phase (#11122), so a visible drag affordance today would advertise a pointer-only action. The smallest honest visible change — a grip glyph beside the pencil, or dropping "drag to reorder" from the description until #11122 ships — alters the pill's rendered shape that the 37 attachments and the four committed frames show, so it is held for the maintainers rather than shipped speculatively (same rule as the other label changes this lane proposed). Maintainer question: ship a grip cue now (frames re-captured), or keep reorder discoverable through the title/description until #11122.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author
  • placeholderOneLine: frame 39 clips the hint mid-token — add text-overflow: ellipsis to [data-composer-placeholder] — rebutted

The clip is a deliberate fade, not an accident: placeholderOneLine applies whitespace-nowrap plus a right-edge mask-image gradient over the last 1.5rem (LexicalComposerInput.tsx, the [data-composer-placeholder] overlay), the same treatment the <textarea> path gives its own hint placeholder (ChatInput.tsx, the placeholderIsHint class: placeholder:whitespace-nowrap + placeholder:[mask-image:…]). A native ::placeholder cannot carry text-overflow: ellipsis reliably across engines, which is why the textarea path fades; the Lexical overlay mirrors it so the two composers read identically at the same width. Switching the overlay alone to an ellipsis would make the hint differ between the default composer and the touch fallback, and frame 39 ("the hint stays on one line with a faded tail") documents the fade as the intended rendering. Held unless the maintainers want both paths changed together.

Qifeng Huang added 2 commits October 6, 2026 16:36
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.
…e description names

The UX lane on 3475128 is BLOCK "cannot evaluate": the description names
three frames only in HTML comments, and a fork author has no CLI path to a
description attachment (`gh pr edit --attach` answers read permission with
404, cli/cli#14302). The repository's other route is the committed one:
media under temp-screenshots/ is read by the fork UX lane and both design
lanes straight from the object store at HEAD (pr-committed-evidence.sh), so
the three frames land here with `git add -f` (the directory is gitignored
for everyone else's capture runs).

  36-cli-mode-placeholder.png  data-ui="cli": accent `>` prompt left of the
                               24px-indented placeholder (acceptance step 30)
  37-cli-mode-pill.png         same mode, typed text and a pill start right
                               of the prompt (step 30)
  38-min-width-unsaved-hint.png 280px minimum panel width: the two-exit hint
                               wraps onto three lines inside its own column,
                               Cancel and Save clear of it and inside the
                               panel, grip clear of Save (step 31)

Provenance: recorded from 3475128
(this branch, clean tree) by `website/scripts/capture-composer-pills.mjs`
against the real ChatInput harness on a local `vite --port 5199` dev server,
headless Chromium 145.0.7632.6 via Playwright 1.58.2; the walk passed
33/33 with 0 page errors, and steps 30 and 31 asserted the measurements
the frames show (input and placeholder padding 24px, pill left of 94px at a
24px text start; hint 3 lines at width 280, no overlap with Save or Cancel,
Save inside the panel). No fixtures beyond the harness's own seeded blocks;
no production code changes in this commit.

CI scope: temp-screenshots/** is excluded from every bucket (ci.yml kirodotdev#8027,
pr-scope.yml, scripts/local-gate.py), so this commit changes no test
selection.
@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: none new — one catalog key; the name reads the glyph the title already reads

  • The chip's accessible name splices a literal #${seq} while its tooltip spells the same seq through the localized pasteBlockChip.seq (№{{seq}} in ru) — fixed, 6a80dc7c4

Correct: a Russian screen-reader user heard #2 for a pill whose tooltip read №2 · 12 строк — two spellings of one identifier on one control. Fix: components.pasteBlockChip.seq_name ("#{{seq}}"; "№{{seq}}" in ru.json; pseudolocale regenerated) in all 13 catalogs, and PasteBlockChip.tsx builds the name as ${snippet} · ${t('seq_name', { seq })} · ${label} — English output byte-identical, the twin-pill #1/#2 assertions untouched. Regression test (composer.PasteBlockChip.test.tsx) switches i18next to ru through ../i18n/all, asserts the name contains · №2 · and never #2 and that the title's second line starts with №2 · , then restores en in finally; proven red on the previous template (… · #2 · Вставленный текст · 12 строк). Opus-family fix (claude-fable-5.1), GPT-family read-only verification (gpt-5.6-sol): 0 FAILS — all 13 catalogs parse with seq_name adjacent to seq and matching its glyph, no other consumer of either key, language state contained by the finally and vitest's per-file isolation, i18n:check green with the base ref.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Round 48 — rebased onto 334335182 (990 commits). Head b7b815f4d → ace7f51c2 (production 6a80dc7c4 + the evidence commit; MERGEABLE). Description rewritten and shortened to the current diff.

What the rebase had to absorb, beyond the usual 13 locale and two Playwright unions:

Dispositions: all seven lane items on b7b815f4d are answered above (FP ×2 → RFC #12627; Design rollback → RFC principle 5 / Q3; UX blind read → in-repo push; UX drag affordance → needs-a-decision; UX ellipsis → rebutted, the fade matches the textarea hint; Opus seq_name → fixed in this head). The new head's fork workflows will sit at action_required until a maintainer approves them. Triage from 2026-10-05 answered in the next comment.

@qh2244

qh2244 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Re: triage 2026-10-05 (@bolichen97) — rebased; overlap analysis below. Head ace7f51c2 on 334335182, MERGEABLE; details in the round-48 note above.

@cruisercohen cruisercohen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on head ace7f51c2. main has moved about 540 commits since the round-48 rebase and the branch now conflicts again, mostly across the composer split (ChatInput.tsx, LexicalComposerInput.tsx, PasteTokenNode.tsx, the chat-input/ owners, pasteTokens.ts) plus docs/feature-map/README.md and about a dozen frontend tests. On this head, Frontend Tests shard 2 fails three cases in ChatPage.followUpBusySend.test.tsx ("chip sends while a turn runs": the quick-send toggle and both ↑ steer cases), and the offline E2E run fails composer-paste-highlight.spec.ts:60 in chat and cli UI, which is this PR's own surface. Coverage Gate, the GPT and First Principles lanes are also red here. Please rebase, get those suites green on the new head, and I'll review that head.

@dodgeblaster

Copy link
Copy Markdown
Contributor

Steward review for #8309 (T1-2 sweep). Reviewed as a fork PR — I cannot push to the branch or merge it, so this is a review only.

Relationship to #8309. The specific defect #8309 reports — the collapsed-paste chip highlight detaching from the marker text on the textarea+mirror path — was already fixed on main by #14002 (fix(composer): keep the paste chip highlight on its token, merged 2026-09-29, commit c2fea0ade), which made the textarea display: block and gave the CLI-mode mirror matching left padding, with a regression test (website/playwright/composer-paste-highlight.spec.ts) pinning the chip within 1.5px of its token across 0/20 typed lines and CLI mode. This PR's own body agrees ("#14002 fixed the drift"). So this PR is not the drift fix; it is the durable inline-node direction #8309's acceptance criteria describe, and by its own body it does not close #8309 (it resolves the pointer-device case only; touch stays open for a follow-up).

Current state (head ace7f51c, last pushed 2026-10-09).

Verdict: not mergeable as-is, and the gating question is a maintainer decision, not a code defect I can resolve. The central change — making the Lexical pill composer the default chat input on fine-pointer devices — is a product-shape call that two maintainers already flagged as crew: needs human on #8309 (which surfaces flip, how the ~20 consumer tests migrate). It merges only if the maintainers accept that default, which is what #12627 records.

What a maintainer would need to do to land it: (1) decide and accept the default-flip via #12627; (2) the author rebases onto current main to clear CONFLICTING and re-trigger CI; (3) address the GPT blocking findings (the PasteSeqInvariantPlugin dedup case + the security-class one) and re-run a UX blind read; (4) re-review on the fresh head. As a stewarding worker on a fork PR I can do none of (1)–(4) (can't push the rebase, can't make the product call, can't dismiss the human CHANGES_REQUESTED). Leaving #8309 open and flagging for maintainer decision.

@bolichen97

Copy link
Copy Markdown
Contributor

Thanks for this PR. It now conflicts with main. Could you rebase onto the latest main and resolve the conflicts? We will review it again once it is rebased and CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants