Skip to content

feat(mobile): sprint and coordinator transcripts show their threads as rows - #608

Merged
NoahHendrickson merged 4 commits into
customfrom
t3/ios-sprint-transcript-rows
Nov 29, 2026
Merged

NoahHendrickson merged 4 commits into
customfrom
t3/ios-sprint-transcript-rows

Conversation

@NoahHendrickson

@NoahHendrickson NoahHendrickson commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Launches. A t3_thread_launch row 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.
  • One row per thread. A launched thread's finished report draws no row of its own. Its launch row moves down to the latest settled reply about it, at or after the launch: a report wake's reply, or a reply that links the thread.
  • Other reports. A finished report about a thread not launched here goes under its wake's reply.
  • Standing rows. A question or approval report, and a report whose wake hasn't replied yet, stand on their own where the wake starts. Steps 5 and 6 add the cards.
  • Report notices leave "Worked for" in host threads only. A wake whose only hidden work was report notices no longer keeps an empty "Worked for" fold. Plain threads keep folding notifications; their existing tests are unchanged and pass.

How it's built:

  • apps/mobile/fork/no3yThreadRows.ts: createNo3yThreadRowPlacer(), one placer per feed, held in useState, which owns its row caches. It ports web's placeThreadRowsUnderReplies onto 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.
    • Layout: an arm off the reply, the provider mark with the status as a corner badge, the title in meta ink, the PR chip, and a short activity line.
    • The PR chip is feat(mobile): sprint and coordinator Threads sheet #604's RowPullRequestChip, now exported, with the PR state the Threads sheet reads (useThreadPr). Its reads are gated by ThreadPrDemandProvider on screen focus and app activity.
    • The activity line shows background work, the thinking word, a failed thread's error, or "Archived".
    • Rows are either a thread to show or a label for a thread this machine can't resolve. An older server's report resolved from its key opens its thread.
  • A tap pushes the child's full thread screen. Back returns to the host.
  • ThreadFeed draws a reply's rows above its copy/share/fork actions, and standing rows as their own no3y-thread-rows feed entry, which spaces like a tool row.
  • Manifest entry no3y-sprint-transcript-rows and a fork guard pin the wiring. filePreview.test.ts renders 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:changed passes, including design lint. So do the fork guards and the lint ratchet.
  • The full mobile suite passes (387 files). The placement tests cover:
    • launches under their reply;
    • a launch moving to a later report's or link's reply;
    • a report of a thread not launched here, with no empty fold;
    • a standing question report;
    • the live turn holding back its launches;
    • report notices leaving the work rows;
    • an untouched feed when there is nothing to place.
  • Checked on an iOS simulator against the seeded "Checkout v2" sprint, in dark and light, after the review fixes. The client was a no3y dev client built after the chore(sync): absorb upstream main through 4696218565 #591 sync, on an iPhone 18 Pro. Each launch shows once under its reply; finished, failed and merged reports show as rows; question and approval reports stand at their wakes with no empty fold. Tapping a row opens the child, and Back returns to the sprint.
  • Test Web 2's Sidebar.browser.test.tsx › "closes the sheet when Add project opens the picker" failure is the known custom failure; this PR touches no web components.

Reviewed with sol-loop: 3 rounds with GPT-6.1 Sol on high. Sol verdict: approved.

  • Round 1: approved.
  • Round 2, after the review fixes: one finding, PR reads not gated by screen focus. Fixed.
  • Round 3: approved.

🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code
Review: GPT-6.1 Sol (gpt-6.1-sol, high) via Codex, sol-loop rounds 1–3, approved

🤖 Generated with Claude Code

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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

  1. The placement policy is forked, not shared (inline on no3yThreadRows.ts:267). readFeed repeats web's threadReports + forkLaunchedThreads, the latestAbout loop is copied line for line, and rowKey / no3yThreadRowListsEqual are near-copies of forkThreadRowKey / forkThreadRowListsEqual. The copies have already drifted: web's later.index >= rowIndex guard and its threadId ?? id key fallback are missing here. #601 just moved launches and reports into client-runtime so 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.
  2. The generic Row extends { type: string } forces casts everywhere (inline on :113). There are four as unknown as Extract<ThreadFeedEntry, …> casts, a "runId" in row check, and a "launch" in read check, all for a function with one caller. Type it on the real union and the casts go away.
  3. Module-global caches, one with a magic size limit (inline on :199). standingCache is one Map shared by every thread and environment, cleared when it passes 500 entries. ThreadFeed already keeps its caches per feed (useState(createPendingTurnAppender), createThreadFeedGrouping); follow that pattern.
  4. 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 the ThreadRow dispatcher, the launch/report union and half of the equality check all disappear.
  5. The live run is an unnamed condition inside the call's arguments (inline on ThreadFeed.tsx:4248). It nearly duplicates unsettledTurnId at 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.

Comment thread apps/mobile/fork/no3yThreadRows.ts Outdated
map.set(read.runId, threads);
}

const latestAbout = new Map<ThreadId, number>();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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 placeThreadRowsUnderReplies around 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 a threadId (only started launches draw), so web's threadId ?? id fallback has no case here.
  • Reads already shared. Launches and reports are read through client-runtime's forkThreadLaunches and forkWorkReports.

I've flagged moving the placement into client-runtime as a follow-up for the owner to schedule.

Comment thread apps/mobile/fork/no3yThreadRows.ts Resolved
Comment thread apps/mobile/fork/no3yThreadRows.ts Resolved
Comment thread apps/mobile/fork/No3yThreadHookRow.tsx Resolved
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 29, 2026
@NoahHendrickson

Copy link
Copy Markdown
Owner Author

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 apps/mobile/fork/no3yThreadRows.test.ts and the 2 fork-guard cases in no3ySprintTranscriptRows.test.ts. The placement tests check where rows go in the feed, below the UI. Each fails for a real reason: a launch that misses its reply, a thread drawn twice, a live turn's launches shown early, or a report notice left in "Worked for". The guards pin the ThreadFeed wiring that an upstream sync could drop. Once #604 merges, the count here drops to those 10.

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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 === null hides 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 though readFeed already worked out its thread.
  • No3yHostThreadsSheet.tsx:165 (#604): the effect gives its reason in a plain comment, not the no-unreasoned-state-sync directive.

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

Comment thread apps/mobile/fork/no3yThreadRows.ts Resolved
Comment thread apps/mobile/fork/no3yThreadRows.ts Resolved
Comment thread apps/mobile/fork/No3yThreadHookRow.tsx Resolved
Comment thread apps/mobile/fork/No3yThreadHookRow.tsx Resolved

// 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(

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Not changed here. This effect is #604's code, which is already merged, and this PR no longer touches No3yHostThreadsSheet.tsx. Changing it would mix an unrelated fix into this PR. I've listed it as a follow-up for #604's area: move the reason into the t3code/no-unreasoned-state-sync directive.

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 2d6054d.

This comment will update automatically after the next completed run.

@NoahHendrickson
NoahHendrickson force-pushed the t3/ios-sprint-transcript-rows branch 2 times, most recently from 346dfa2 to 0ff8c88 Compare November 29, 2026 22:32
xxxxxxxxxxxxx and others added 3 commits November 29, 2026 17:40
…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>
@NoahHendrickson
NoahHendrickson force-pushed the t3/ios-sprint-transcript-rows branch from 0ff8c88 to 3230b4c Compare November 29, 2026 22:42
@NoahHendrickson
NoahHendrickson merged commit 7a0c277 into custom Nov 29, 2026
32 checks passed
@NoahHendrickson
NoahHendrickson deleted the t3/ios-sprint-transcript-rows branch November 29, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants