Repository navigation
feat(mobile): sprint and coordinator transcripts show their threads as rows - #608
Conversation
NoahHendrickson
left a comment
There was a problem hiding this comment.
Thermo-nuclear code-quality review of 77b7d6f. Scope: this PR's own commit (77b7d6f). The two #604 commits below it are left to #604's review.
Verdict: not approved. The feature is well contained in fork fences. ThreadFeed.tsx grows by only ~40 lines; it was already ~4.9k, so this PR doesn't push it across the 1k line. The trouble is the core of the PR, no3yThreadRows.ts. It is a second copy of web's placement policy, built on a generic row type that needs casts at every step, with three hand-rolled module caches. All of that can go.
In priority order
- The placement policy is forked, not shared (inline on
no3yThreadRows.ts:267).readFeedrepeats web'sthreadReports+forkLaunchedThreads, thelatestAboutloop is copied line for line, androwKey/no3yThreadRowListsEqualare near-copies offorkThreadRowKey/forkThreadRowListsEqual. The copies have already drifted: web'slater.index >= rowIndexguard and itsthreadId ?? idkey fallback are missing here. #601 just moved launches and reports intoclient-runtimeso both clients could read them, and the rule for which reply a thread's row belongs to should live there too. Then web and mobile only map a run to a row index. - The generic
Row extends { type: string }forces casts everywhere (inline on:113). There are fouras unknown as Extract<ThreadFeedEntry, …>casts, a"runId" in rowcheck, and a"launch" in readcheck, all for a function with one caller. Type it on the real union and the casts go away. - Module-global caches, one with a magic size limit (inline on
:199).standingCacheis oneMapshared by every thread and environment, cleared when it passes 500 entries.ThreadFeedalready keeps its caches per feed (useState(createPendingTurnAppender),createThreadFeedGrouping); follow that pattern. - The view still branches on where a row came from (inline on
No3yThreadHookRow.tsx:178). The view only needs a thread to show, or a label when the thread is unknown. Settle that during placement and theThreadRowdispatcher, the launch/report union and half of the equality check all disappear. - The live run is an unnamed condition inside the call's arguments (inline on
ThreadFeed.tsx:4248). It nearly duplicatesunsettledTurnIdat line 4069.
I'd ask for (1)–(3) before merge. (1) is the code-judo move: the mobile file becomes a thin adapter of about 100 lines, and the next placement change is made once.
| map.set(read.runId, threads); | ||
| } | ||
|
|
||
| const latestAbout = new Map<ThreadId, number>(); |
There was a problem hiding this comment.
this is web's placeThreadRowsUnderReplies policy copied onto a second data model. The latestAbout loop here is line for line the one in apps/web/src/custom/threadLaunchCards/threadLaunch.logic.ts. readFeed repeats threadReports + forkLaunchedThreads (the reportThreadsByRun / inlineThreadsByRun split), and rowKey / no3yThreadRowListsEqual are near-copies of forkThreadRowKey / forkThreadRowListsEqual.
The copies have already drifted. Web only moves a launch to a reply at or after the launch (later.index >= rowIndex), and it keys a launch by threadId ?? id. The next change to the placement rule (which report pulls a row, when a request stays inline) will have to be made twice, and one copy will get missed.
The code-judo move: put the platform-agnostic decision in packages/client-runtime next to forkThreadLaunches / forkWorkReports, which #601 already moved there for this reason. Roughly:
forkThreadRowPlacement({
launches, // { id, runId, threadId, launch }[] in order
reports, // { id, runId, report, label }[] in order
replies, // Map<RunId, { settled, linkedThreadIds }> in reply order
liveRunId,
}) => { underRun: Map<RunId, ForkThreadRow[]>, standing: { anchorRunId | createdAt, rows }[] }Web and mobile then only map a run to a row index and splice rows in. Most of this file becomes that adapter. The shared row type and forkThreadRowListsEqual (built on forkThreadLaunchesEqual) come along too.
There was a problem hiding this comment.
Not done in this PR. I'm leaving it to the owner rather than resolving it.
- Why not here. Step 1b (refactor(client-runtime): share launch reading, child requests and sprint PRs with mobile #601) deliberately kept web's placement in web, because it's built on web row kinds. The step-4 brief says to place launches over the mobile feed using the shared reading parts. Sharing the decision means rewriting web's
placeThreadRowsUnderRepliesaround a new client-runtime core. That's a web behaviour-preserving refactor, beyond this step. - Placement stays different on purpose. Web's quiet-wake rule (
replyBeforeQuietReport, which walks rows) has no mobile counterpart, because mobile shows quiet wakes. - Drift fixed in e9afece. A launch now moves only to a later reply at or after its own position, matching web's
later.index >= rowIndex. Mobile launches always carry athreadId(only started launches draw), so web'sthreadId ?? idfallback has no case here. - Reads already shared. Launches and reports are read through client-runtime's
forkThreadLaunchesandforkWorkReports.
I've flagged moving the placement into client-runtime as a follow-up for the owner to schedule.
|
Most of the +26 come from #604's two commits, which this PR is stacked on. This PR's own tests are the 8 placement cases in |
NoahHendrickson
left a comment
There was a problem hiding this comment.
Code review of 77b7d6f68e06383f010281541227e9dae2d9727c (/code-review high, findings checked against the source by hand).
Most of this is in the new commit (77b7d6f68e, transcript rows). One nit is in the stacked #604 code (Threads sheet).
Should fix
no3yThreadRows.ts:151: a wake whose only work is a report notice keeps an empty "Worked for" fold. This is the common "child finished → host replies" case.
Nits
no3yThreadRows.ts:304: if a launch has no run id,null === nullhides it when the thread is idle. Web shows such a launch where it is.No3yThreadHookRow.tsx:126: if a PR is known only by its branch, the hook row shows it as open, even when it has merged.No3yThreadHookRow.tsx:195: on older servers, a question or approval report draws as plain text even thoughreadFeedalready worked out its thread.No3yHostThreadsSheet.tsx:165(#604): the effect gives its reason in a plain comment, not theno-unreasoned-state-syncdirective.
I dropped one finding: re-running placeNo3yThreadRows on each streaming tick. The presented feed already changes on every tick, and withRows, withoutReports and standing keep row identity, so there's no real cost.
Not approved or pushed, as instructed.
🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code
|
|
||
| // Shell snapshots leave out idle subagents and older settled threads, so a coordinator's finished | ||
| // children and a sprint's settled work come from the host's family read while the sheet lists. | ||
| useEffect( |
There was a problem hiding this comment.
nit (from #604): this is the right kind of effect, since it holds a registry entry while mounted. But CLAUDE.md asks kept effects to give their reason in the directive, not a plain comment, e.g. // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- holds the host's thread family read while the sheet lists. As written, it adds to the deferred count for this rule in .fork/lint-deferred.mjs (30).
There was a problem hiding this comment.
77b7d6f to
b4f4324
Compare
Thread transfer impact
This comment will update automatically after the next completed run. |
346dfa2 to
0ff8c88
Compare
…s rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yped rows, no empty folds - One placer per feed (useState), owning its caches; no module caches or size limit. - Typed on the feed's real row union; rows carry the thread to show or a label. - A wake whose only hidden work was report notices drops its empty Worked for fold. - The live-run rule moves into the placer; a run-less launch is no longer hidden. - Hook rows read the PR state the Threads sheet reads (useThreadPr). - Older-server reports resolved from their key open their thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en is in view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0ff8c88 to
3230b4c
Compare
iOS sprints spec, step 4.
Problem
On the phone, a sprint's or coordinator's conversation showed no thread rows. The threads it started were only a "Created thread" step inside "Worked for", and its work reports ("… finished", "… has a question") were folded away with the turn's work. On the Mac, the same conversation shows each thread as a row under the reply that talks about it.
Fix
In a host thread (a sprint or a coordinator, from #604's
useNo3yHostKind), the feed hangs thread rows the way the Mac places them:t3_thread_launchrow appears under its turn's last reply once the launch has started and that reply has settled. The live turn's launches wait for its reply.How it's built:
apps/mobile/fork/no3yThreadRows.ts:createNo3yThreadRowPlacer(), one placer per feed, held inuseState, which owns its row caches. It ports web'splaceThreadRowsUnderRepliesonto the presented mobile feed, typed on the feed's own row union, and reads launches and reports through the shared client-runtime modules from refactor(client-runtime): share launch reading, child requests and sprint PRs with mobile #601. Mobile shows quiet wakes, so a report joins its own wake's reply, and there is no quiet-wake logic.apps/mobile/fork/No3yThreadHookRow.tsx: the row, drawn from iOS kit Hook row 31:311.RowPullRequestChip, now exported, with the PR state the Threads sheet reads (useThreadPr). Its reads are gated byThreadPrDemandProvideron screen focus and app activity.ThreadFeeddraws a reply's rows above its copy/share/fork actions, and standing rows as their ownno3y-thread-rowsfeed entry, which spaces like a tool row.no3y-sprint-transcript-rowsand a fork guard pin the wiring.filePreview.test.tsrenders the feed with mocked state, so it now stubs the row list and the host hook too.Not in this PR: the review asked for the placement rule to move into client-runtime so web and mobile share it. Step 1b (#601) and this step's brief kept web's placement in web, so that's left to the owner as a follow-up (see the review thread).
Checks
vp run check:changedpasses, including design lint. So do the fork guards and the lint ratchet.Sidebar.browser.test.tsx› "closes the sheet when Add project opens the picker" failure is the knowncustomfailure; this PR touches no web components.Reviewed with sol-loop: 3 rounds with GPT-6.1 Sol on high. Sol verdict: approved.
🤖 Signed: Claude Opus 5.5 (
claude-opus-5-5) via Claude CodeReview: GPT-6.1 Sol (
gpt-6.1-sol, high) via Codex, sol-loop rounds 1–3, approved🤖 Generated with Claude Code