Repository navigation
Inbox: pull the open reply box out of Thread.tsx into an Inbox-only view (no change) - #4044
Merged
Merged
Conversation
The open reply box was inline JSX in Thread.tsx. It is now components/reply/ReplyBox.tsx, drawn from props with callbacks out; Thread keeps every hook, effect, state and handler and renders <ReplyBox ... />. Same DOM: replyBoxParity.test.tsx compares the thread foot's outerHTML in twelve states with fixtures captured on main before the move. Thread.tsx goes from 5832 to 5723 lines.
…/inbox-replybox-shell # Conflicts: # packages/inbox/components/Thread.tsx # tests/dom-test-list.txt # tests/inbox-size-ceilings.json
…/inbox-replybox-shell
…/inbox-replybox-shell # Conflicts: # tests/dom-test-list.txt
…/inbox-replybox-shell # Conflicts: # tests/inbox-size-ceilings.json
backnotprop
marked this pull request as ready for review
November 26, 2026 07:00
backnotprop
added a commit
that referenced
this pull request
Nov 26, 2026
Main moved the open reply box out of Thread.tsx into components/reply/ReplyBox.tsx (#4044). The branch's change to that box goes there now: the row's paperclip is the + menu (compose/ReplyPlusMenu.tsx), and ReplyBox takes an onCanvas prop that Thread passes as onOpenCanvas. replyBoxParity's ten open-box goldens hold the + in the clip's place. useCanvasReply stays a hook of ThreadPane, not of ReplyBox: send() reads its sketch, and a part from the canvas opens the box while the box is closed. To keep Thread.tsx at its size ceiling without raising it, Thread imports the hook through thread/replyBox.ts, which re-exports it, instead of on an import line of its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 1 of the reply box move (SIZING step 7a, "Inbox-only: pull ReplyBox out of Thread.tsx"). The hosted Spaces app will reuse the Inbox's reply box from the shared package. The box was not a component: it was inline JSX in
Thread.tsx(thebox.open ? (<>…</>)branch of the foot), and its state was spread through Thread.This PR moves that JSX, unchanged, into
packages/inbox/components/reply/ReplyBox.tsx. The new component is an Inbox-only view shell: props in, callbacks out. Thread keeps every hook, effect, state, ref and handler, and renders<ReplyBox … />in the same place. Nothing moves topackages/uiorpackages/core. No class is renamed and no CSS changes. A person sees no difference.Thread.tsx: 5832 → 5723 lines (ceiling lowered intests/inbox-size-ceilings.json).ReplyBox.tsx: 326 lines.components/is not one of the capped folders, and the file is under 1500 lines, soinbox-structure.test.tsneeds no entry for it.Prop surface (56 props)
replyText(the ReplyText store, not a value),sendingWords,onChange,onFieldKeyDown,replyToNames,quote,quotedMessage,onRemoveQuoterecipientPill(a ReactNode built in Thread: a computer's chip leads the words, a phone's sits in the row)files,onRemoveFile,onPutBackFile,onAttachFiles,onShowFiles,dropOver,dropHandlers,onPastevoice(the whole VoiceHandle)skillFilter,commands,tags,onOpenSkills,noSkillsHintdraftAnswers,draftActions,replySkip,dropped,comments,replySummaryShown,chips(ReactNode),fold,onFold,fitKeysending,sendAria,onSend,onClose,onDiscardDraft,onRestoreDraft,routeChoiceOpen,routeChoice(ReactNode)offerShown,conflict(DraftConflict or null: id, text, Keep mine, Discard mine),takeBack,staleQuestions,onJump,draftStamp(ReactNode),draftNotSaved,errorLine(ReactNode),askerNoteIdphonetextRef,sendRef,scrollRef,draftAboveRefthread(ChangedNotice and the field's mention thread)Awkward parts, left for later PRs:
recipientPill,chips,draftStamp,routeChoiceanderrorLine.onFieldKeyDownholds the ⌘↵ and Esc logic (route choice,sentByChord,send). Theconflict.onKeepMineclosure holds the Keep mine save. Both stay in Thread, as the brief asks.voiceis a controller handle andreplyTextis a module-level store. Neither is a plain value yet.keepOpenreadreplySkip. This equals the oldskipping/skipIds.size/keepOpen:replySkip = { count: keepOpen ? unanswered.length : skipIds.size, keepOpen }, andskipping = !keepOpen.routeChoiceOpenis passed as!!(route.open && asking).conflict.onDiscard, which is the samediscardMine.focusReplyFromBoxandcaretToEndOnFirstFocus. The view also puts focus back in the field after a tile's ×.How "no change" is proven
packages/inbox/components/reply/replyBoxParity.test.tsxis DOM-gated and listed intests/dom-test-list.txt. It drives the realThreadPaneover a scripted Inbox: a stubbed fetch with the draft store's compare-and-set, a scripted voice recorder and no server. For each state it compares the outerHTML of.ib-pfootbyte for byte with fixtures inreplyBoxParity/. Two things are normalized first: React's_r_N_useId counter and AM/PM clock times. The fixtures were captured on unmodified main (8c44d10) in this worktree before the move. The same file then passes, 13/13, after the move.The twelve states: closed foot (empty), closed foot with words kept, open and empty, open with words, a saved draft waiting (Restore draft), "Not saved", the conflict (Keep mine / Discard mine), a file tile, two agents (recipient chip ticked to "2 agents" plus an
@Pitag), a voice note recording, phone with words (Draft line, summary line, row), and phone with two agents.The test catches real changes: swapping the order of two attributes on
.ib-rnotefailed exactly the "Not saved" case. To capture the fixtures again after an intended change, run withREPLYBOX_PARITY_WRITE=1 DOM_TESTS=1.Not run:
bun run test:parity:inbox-thread(scripts/inbox-thread-parity.ts). It builds two binaries, starts an Inbox for each and runs Playwright, which the builder rules forbid locally, and no CI workflow runs it. Pixels are therefore not compared here; the DOM test compares markup only.Tests run locally (one file each, sandboxed)
replyBoxParity.test.tsx: 13 pass, both before the move (capture and re-run) and after it.tagAgents.test.tsxstarts an Inbox (inbox-dom-server), so it was left to CI.tsc -p packages/inboxandtsc -p apps/inbox: cleanNext (out of scope here)
browserDeps) and add a VoiceTransport seam.useReplyComposercontroller that owns the box's state and handlers, so Thread passes one object and the ReactNode props become data.@plannotator/ui(host-neutral rules, the CSS generator,phoneComposer.css).