feat(mobile): stand review threads under their lines in a file's diff

DA
3h ago
+407-29

Stacked on #10558, above #10554, #10551 and #10549. The fifth step of the iOS code viewer (STAG-3904): reading review comments inline. Writing comments is the next PR.

What

  • A card under its line: a file's diff stands each review thread on the file as a card under the line it's on, on the side it counts on, as GitHub's diff does. The card shows who started it and their first line, then "N replies · Resolved · Outdated".
  • Threads on no line shown: a thread that's outdated or past the hunks stands above the first hunk, saying "On a line this diff doesn't show".
  • A press on a card opens the thread's own screen, the one the PR page's conversation pushes (…/thread/<id>, from #10586/#10588), where it's read, replied to, resolved, and reacted to. A thread read before GitHub's ids rode with it opens on GitHub instead.

Rebased Nov 23: an earlier version added its own thread screen (…/thread?comment=). main gained one in the meantime, so this PR now opens that screen instead of duplicating it.

How

  • Data: threads come from the conversation part the PR page and the thread screen already follow (usePullRequestThreads, over usePullRequestParts), so they share one read.
  • Model: drawnDiff in diff-view-model.ts places threads into the columns as rows of their own (DRAWN_ROW.THREAD), and keeps a JS-side map from row to thread. The view is never handed thread objects; a press comes back as the row.
  • Native: a thread row is a card of fixed height (title and detail, one line each), so geometry stays arithmetic. It's heard as one button, and a press fires onThreadPress({ row }).
  • Fixture: the Inbox fixture gives #128's src/invites/resend.ts a two-comment thread on line 16 (RESEND_THREAD, id PRRT_resend). pull-request-files.yaml now ends by opening it on the thread screen.

Tests

  • Ran: packages/ui-native/src/diff-view-model.test.ts. The new case catches a thread placed under the wrong line or side: an old-side and a new-side thread on the same number, plus an outdated one above. Also ran fixture-pull-requests.test.ts.
  • Typechecked @repo/mobile and @repo/host; ran oxlint and Biome on the changed files.
  • Not run yet: the Swift card cell needs the native build. It goes with the Mac job pinned to the stack's head, which I'll repin to this PR. Left to CI: the rest.

🤖 Generated with Claude Code