Skip to content

feat(mobile): GitHub review threads, viewed sync and line comments on the diff screen - #37073

Merged
AmoabaKelvin merged 3 commits into
mainfrom
mobile-diff-github
Nov 1, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
mobile-diff-github

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​244 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​240
Prod 39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1861 $\color{#cf222e}{\Huge{\mathbf{−}}}$​284 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1577

ELI5

On the diff screen, a committed file that belongs to a GitHub pull request now shows the review threads under the lines they're about, with Reply and Resolve. Its viewed box syncs with GitHub. You can tap a line, or long-press and drag over several, then send a note to your agent or post a comment on GitHub.

What Changed

Threads under their lines. For branch files with a GitHub PR, the screen loads the PR's details and places each thread under the line it ends on:

  • placement and grouping use desktop's shared rules, getPRInlineCommentPlacement and groupPRComments, so outdated threads are skipped as on desktop;
  • threads render with the PR tab's own CommentGroupView and useMobilePrCommentActions, so Reply and Resolve are the existing ones;
  • lines with threads or notes never fold.

Viewed sync. The PR files' viewerViewedState now drives the box and "Viewed · next file":

  • the mobile details schema now keeps files, with each file salvaged on its own;
  • a tick calls github.setPRFileViewed through desktop's pattern: patch the PR details optimistically, roll back on failure, and ignore re-ticks while that file's write is pending;
  • DISMISSED shows as "Changed".

Line comments. A tap picks one line; a long-press then drag picks a range. The sheet ("Lines 25–26") offers:

  • Send to : saves the note as today's local note and sends it at once through the existing terminal send path when exactly one terminal runs an agent. It uses the session strip's isMobileTerminalTabRunningAgent, so an exited agent's shell never receives it. With none or several, today's picker opens with just that note.
  • Comment on GitHub: posts github.addPRReviewComment on the PR head commit. Offered only on lines GitHub accepts (reviewCommentLineNumbers).

When the branch isn't at the PR head. Threads, Comment on GitHub and GitHub viewed state apply only while the local branch head equals the PR head:

  • desktop shows threads only on the PR's own contents, and the local diff is those contents only then;
  • otherwise the file header says the comments show once the branch matches, and viewed state stays on the phone.

Open at a line. openDiffForFile takes an optional line for a thread's "Open in diff" (the PR tab task wires the caller). The screen opens the fold holding that line and scrolls to it.

Why

This is the rest of the approved "One diff screen" section: GitHub threads under their line, "Viewed · next file" synced to GitHub, and long-press-drag line comments with Send to and Comment on GitHub. Two product calls were settled with the fleet coordinator:

  • threads only at the PR head, which matches desktop;
  • the direct send through the existing send path, with the picker as the fallback.

The viewed sync copies desktop's syncPullRequestFileViewed instead of inventing a second rule.

Linked Issue

None. This is part of the approved mobile Source Control redesign.

Visual Proof

Threads under their line Jump to file, viewed from GitHub Tap a line

Long-press and drag over lines 26–28 (the end state, then a video):

c-drag-range.mp4

Before: main showed no GitHub threads, viewed state or line ranges on this screen (see #36998's before shots). These shots come from the built OTA page bundle with scripted host replies: WebKit for the shots and video, and Chromium with CDP touch events for the touch drag, which also picks 26–28.

Testing

  • Captured the states above from the built page bundle: threads, GitHub viewed state, the line sheet, a mouse drag, a Chromium touch drag, and a drag after opening a fold.

  • Mobile typecheck (app and tests) and the focused src/session, src/components, src/source-control, src/tasks and src/test-support tests pass.

  • New tests cover:

    • thread placement, GitHub viewed state, and commentable lines;
    • rows with threads;
    • the PR files schema;
    • the terminal agent rule, including an exited agent.
  • Added an RPC recording scenario for addPRReviewComment and setPRFileViewed (refused included) and re-recorded the goldens.

  • Ran build:mobile-web and the verifier, the bundle budget tests, and the localization and coverage checks. The changed-file quality gate passes.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Page bundle: 184 assets (was 183). The review route now imports the session strip's running-agent rule (mobile-terminal-tab-agent and the shared title/shell detectors). Those modules move out of the session-only chunk into a chunk shared with the review route. This was approved with the fleet coordinator: I re-measured MOBILE_WEB_APP_BUNDLE_SCRIPT_SWEEP with routes.slice(0, n). Main's table was already 4 stale: it ended at 118 while main builds 122. I updated the ceiling pins and left MOBILE_WEB_APP_BUNDLE_SCRIPT_MARGIN and MOBILE_WEB_BUNDLE_MAX_ASSETS (256) alone. assertAssetCeilingFitsShell passes, now crossing 256 at 23 routes. Script bytes sit about 11 KB under their 9 MiB budget.

Mixed versions: files, launchAgent and agentStatus are optional reads. Hosts without them keep viewed state on the phone and always open the picker. All calls used are already on the mobile allowlist.

Range picking reads the row under the finger from the document. The review screen renders only as the page (the native route mounts the web shell), so there's no layout cache to go stale as folds and threads move rows. Touch picks stop the browser from scrolling once the long press activates.

Review loop: four rounds with Codex and Claude. All P0/P1 findings were fixed. The fourth round's last findings were the stale layout cache, which led to the redesign above, and two P2s, also fixed.

Remote/SSH and folder workspaces: no new host calls beyond the GitHub methods; folder workspaces have no branch files.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c952466-33d8-4d23-9a5a-f0432c3975e7
Commits

Reviewing files that changed from the base of the PR and between 1c41b93 and c4c3980.

Files selected for processing: 25
  • config/scripts/verify-mobile-web-app-bundle.mjs
  • mobile/app/h/[hostId]/review/[worktreeId].tsx
  • mobile/rpc-foundation/pilot-scenarios.json
  • mobile/src/components/MobileDiffReviewBody.tsx
  • mobile/src/components/MobileDiffReviewDrawers.tsx
  • mobile/src/components/MobileDiffReviewFileSummary.tsx
  • mobile/src/components/MobileDiffReviewFilesSheet.tsx
  • mobile/src/components/MobileDiffReviewLine.tsx
  • mobile/src/components/MobileDiffReviewScreenView.tsx
  • mobile/src/components/mobile-diff-review-control-styles.ts
  • mobile/src/components/mobile-diff-review-layout-styles.ts
  • mobile/src/i18n/en-runtime-required.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/session/MobileDiffReviewRouteScreen.tsx
  • mobile/src/session/mobile-diff-review-retry.test.tsx
  • mobile/src/session/mobile-diff-review-rows.test.ts
  • mobile/src/session/mobile-diff-review-rows.ts
  • mobile/src/session/mobile-diff-review-sheets.ts
  • mobile/src/session/use-mobile-diff-review-comment-actions.ts
  • mobile/src/session/use-mobile-diff-review-controller.ts
  • mobile/src/session/use-mobile-diff-review-interactions.ts
  • mobile/src/source-control/mobile-review-route.ts
  • mobile/src/source-control/use-mobile-source-control-openers.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.ts
  • mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts
Files skipped from review as they are similar to previous changes: 3
  • mobile/src/i18n/en-runtime-required.json
  • mobile/src/components/mobile-diff-review-control-styles.ts
  • mobile/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

The mobile diff review flow now displays GitHub review threads, applies GitHub file-viewed state, and supports comments on selected line ranges. Review routes can pass a line target for scrolling. The changes also add terminal selection and note-sending behavior for range comments, update review schemas and RPC recordings, and revise related tests, translations, and bundle script measurements.

Merge Risk: Minimal · up to c4c39

The reviewed changes are mergeable after normal checks; the previously reported file-list key issue is fixed, and no actionable issue remains from this review.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 48.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: GitHub review threads, viewed-state sync, and line comments on the mobile diff screen. The changeset adds thread placement and rendering, viewed-state sync via setPRFi…
Description check Passed The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, Checklist) and explains the me…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: GitHub review threads, viewed-state sync, and line comments on the mobile diff screen. The changeset adds thread placement and rendering, viewed-state sync via setPRFileViewed, and range/line comment sheets, so the title matches the primary intent. It is specific and in conventional commit form, and it is a single sentence of 85 characters.

Full details: Description check

Explanation

The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, Checklist) and explains the mechanism, scope, and rationale in detail. It includes visual proof, a testing summary, and notes on bundle changes. Gaps: the Linked Issue section reads 'None' with a justification tied to an approved redesign, which the template says should always link an issue for outside contributors. The AI Disclosure section is empty, and the Review section is a heading with no content. The lint/typecheck/test/build checklist item is unchecked. These are non-critical or conditional gaps, so the description is mostly complete.

Resolution

Optionally: link a tracking issue in Linked Issue (or confirm the maintainer exemption applies), fill in the empty Review and AI Disclosure sections if applicable, and check the pnpm lint/typecheck/test/build item once it has been run.

Full details: Docstring Coverage

Explanation

Docstring coverage is 48.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 25 functions across 36 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4fa28c1f-a592-4e3f-9b33-4917dd65f178
Commits

Reviewing files that changed from the base of the PR and between d95e232 and d75b292.

Files selected for processing: 136
  • config/mobile-localization-coverage-allowlist.json
  • config/scripts/build-mobile-web-app-bundle.test.mjs
  • config/scripts/mobile-web-app/mobile-web-app-source-control-render.test.mjs
  • config/scripts/verify-mobile-web-app-bundle.mjs
  • mobile/app/h/[hostId]/review/[worktreeId].tsx
  • mobile/app/h/[hostId]/source-control/[worktreeId].web.tsx
  • mobile/rpc-foundation/goldens/diff-review-commit-file-diff.json
  • mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json
  • mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json
  • mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json
  • mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json
  • mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json
  • mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json
  • mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json
  • mobile/rpc-foundation/goldens/pr-line-comment-and-file-viewed.json
  • mobile/rpc-foundation/goldens/review-git-mutations-run.json
  • mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json
  • mobile/rpc-foundation/goldens/review-stage-file.json
  • mobile/rpc-foundation/goldens/review-stage-refused.json
  • mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json
  • mobile/rpc-foundation/goldens/sc-reveal-first-poll.json
  • mobile/rpc-foundation/goldens/sc-reveal-timeout.json
  • mobile/rpc-foundation/pilot-scenarios.json
  • mobile/src/agent-history/agent-history-pending-resume-ownership.test.tsx
  • mobile/src/components/MobileDiffReviewBody.tsx
  • mobile/src/components/MobileDiffReviewDrawers.tsx
  • mobile/src/components/MobileDiffReviewFileSummary.tsx
  • mobile/src/components/MobileDiffReviewFilesSheet.tsx
  • mobile/src/components/MobileDiffReviewFooter.tsx
  • mobile/src/components/MobileDiffReviewHeader.tsx
  • mobile/src/components/MobileDiffReviewLine.tsx
  • mobile/src/components/MobileDiffReviewLines.tsx
  • mobile/src/components/MobileDiffReviewRangeSheet.tsx
  • mobile/src/components/MobileDiffReviewScreenView.tsx
  • mobile/src/components/mobile-diff-review-control-styles.ts
  • mobile/src/components/mobile-diff-review-layout-styles.ts
  • mobile/src/components/mobile-diff-review-send-sheet-stacking.test.ts
  • mobile/src/components/nav-bar/NavBar.tsx
  • mobile/src/components/pr-sidebar/PRCommentsSection.tsx
  • mobile/src/components/use-mobile-diff-review-overflow-actions.test.tsx
  • mobile/src/components/use-mobile-diff-review-overflow-actions.ts
  • mobile/src/i18n/en-runtime-required.json
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/MobileDiffReviewRouteScreen.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/SessionDockColumn.tsx
  • mobile/src/session/github-pr-entity-reply-schema.ts
  • mobile/src/session/github-pr-mutation-operations.ts
  • mobile/src/session/github-pr-read-reply-schema.ts
  • mobile/src/session/github-pr-review-line-mutations.ts
  • mobile/src/session/mobile-diff-comments.ts
  • mobile/src/session/mobile-diff-hunks.test.ts
  • mobile/src/session/mobile-diff-hunks.ts
  • mobile/src/session/mobile-diff-review-commit-loader.ts
  • mobile/src/session/mobile-diff-review-git-operations.ts
  • mobile/src/session/mobile-diff-review-github.test.ts
  • mobile/src/session/mobile-diff-review-github.ts
  • mobile/src/session/mobile-diff-review-loaders.test.ts
  • mobile/src/session/mobile-diff-review-loaders.ts
  • mobile/src/session/mobile-diff-review-operations.ts
  • mobile/src/session/mobile-diff-review-positioning.ts
  • mobile/src/session/mobile-diff-review-queue.test.ts
  • mobile/src/session/mobile-diff-review-queue.ts
  • mobile/src/session/mobile-diff-review-retry.test.tsx
  • mobile/src/session/mobile-diff-review-rows.test.ts
  • mobile/src/session/mobile-diff-review-rows.ts
  • mobile/src/session/mobile-diff-review-screen-model.test.ts
  • mobile/src/session/mobile-diff-review-screen-model.ts
  • mobile/src/session/mobile-diff-review-selection.test.ts
  • mobile/src/session/mobile-diff-review-selection.ts
  • mobile/src/session/mobile-diff-review-sheets.ts
  • mobile/src/session/opened-mobile-session-tab.test.ts
  • mobile/src/session/opened-mobile-session-tab.ts
  • mobile/src/session/review-terminal-reply-schema.ts
  • mobile/src/session/session-reply-schema.test.ts
  • mobile/src/session/session-screen-handlers.ts
  • mobile/src/session/use-mobile-diff-review-comment-actions.ts
  • mobile/src/session/use-mobile-diff-review-controller.test.ts
  • mobile/src/session/use-mobile-diff-review-controller.ts
  • mobile/src/session/use-mobile-diff-review-diff-loading.test.ts
  • mobile/src/session/use-mobile-diff-review-diff-loading.ts
  • mobile/src/session/use-mobile-diff-review-git-actions.test.ts
  • mobile/src/session/use-mobile-diff-review-git-actions.ts
  • mobile/src/session/use-mobile-diff-review-github.ts
  • mobile/src/session/use-mobile-diff-review-interactions.ts
  • mobile/src/session/use-mobile-diff-review-range-note.ts
  • mobile/src/session/use-mobile-diff-review-selection.ts
  • mobile/src/session/use-mobile-diff-review-send-actions.test.ts
  • mobile/src/session/use-mobile-diff-review-send-actions.ts
  • mobile/src/session/use-mobile-pr-sidebar-controller.ts
  • mobile/src/session/use-mobile-session-file-actions.ts
  • mobile/src/session/use-mobile-session-panel-route-actions.tsx
  • mobile/src/source-control/MobileBranchDiffPreviewDrawer.tsx
  • mobile/src/source-control/MobileSourceControlContent.test.tsx
  • mobile/src/source-control/MobileSourceControlContent.tsx
  • mobile/src/source-control/MobileSourceControlFileList.tsx
  • mobile/src/source-control/MobileSourceControlFileList.web.test.tsx
  • mobile/src/source-control/MobileSourceControlFileRows.tsx
  • mobile/src/source-control/MobileSourceControlModals.tsx
  • mobile/src/source-control/MobileSourceControlPanel.tsx
  • mobile/src/source-control/git-compare-reply-schema.ts
  • mobile/src/source-control/mobile-branch-preview-ownership.test.tsx
  • mobile/src/source-control/mobile-git-read-operations.ts
  • mobile/src/source-control/mobile-git-status.ts
  • mobile/src/source-control/mobile-review-route.test.ts
  • mobile/src/source-control/mobile-review-route.ts
  • mobile/src/source-control/mobile-source-control-actions.test.ts
  • mobile/src/source-control/mobile-source-control-actions.ts
  • mobile/src/source-control/mobile-source-control-primary-action.test.ts
  • mobile/src/source-control/mobile-source-control-primary-action.ts
  • mobile/src/source-control/mobile-source-control-screen-state.ts
  • mobile/src/source-control/reveal-mobile-source-control-session-diff.test.ts
  • mobile/src/source-control/reveal-mobile-source-control-session-diff.ts
  • mobile/src/source-control/source-control-status-retry.test.tsx
  • mobile/src/source-control/use-mobile-branch-diff-preview.ts
  • mobile/src/source-control/use-mobile-source-control-action-sheet.ts
  • mobile/src/source-control/use-mobile-source-control-openers.test.tsx
  • mobile/src/source-control/use-mobile-source-control-openers.ts
  • mobile/src/source-control/use-mobile-source-control-state.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.test.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.ts
  • mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/diff-review-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/github-pr-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/source-control-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/source-control-screen-read-mount-adapters.ts
Files with no reviewable changes: 30
  • mobile/rpc-foundation/goldens/sc-reveal-first-poll.json
  • mobile/src/source-control/mobile-branch-preview-ownership.test.tsx
  • mobile/src/source-control/reveal-mobile-source-control-session-diff.test.ts
  • mobile/src/source-control/use-mobile-source-control-openers.test.tsx
  • mobile/rpc-foundation/goldens/sc-reveal-timeout.json
  • mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json
  • mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json
  • config/mobile-localization-coverage-allowlist.json
  • mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json
  • mobile/src/source-control/mobile-source-control-primary-action.test.ts
  • mobile/src/agent-history/agent-history-pending-resume-ownership.test.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json
  • mobile/src/session/use-mobile-diff-review-git-actions.test.ts
  • mobile/src/session/mobile-diff-hunks.test.ts
  • mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json
  • mobile/src/source-control/source-control-status-retry.test.tsx
  • mobile/src/test-support/rpc-recording/adapters/source-control-mount-adapters.ts
  • mobile/src/session/use-mobile-session-panel-route-actions.tsx
  • mobile/src/source-control/mobile-source-control-actions.test.ts
  • mobile/src/source-control/use-mobile-source-control-action-sheet.ts
  • mobile/app/h/[hostId]/source-control/[worktreeId].web.tsx
  • mobile/src/source-control/use-mobile-branch-diff-preview.ts
  • mobile/src/source-control/reveal-mobile-source-control-session-diff.ts
  • mobile/src/source-control/MobileSourceControlModals.tsx
  • mobile/src/session/mobile-diff-hunks.ts
  • mobile/src/test-support/rpc-recording/adapters/source-control-screen-read-mount-adapters.ts
  • mobile/src/source-control/MobileBranchDiffPreviewDrawer.tsx
  • mobile/src/source-control/mobile-source-control-screen-state.ts
  • mobile/src/session/opened-mobile-session-tab.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

/>
<FlatList
data={rows}
keyExtractor={(row) => row.key}

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.

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
# Find review-route callers that do not pass an `area` parameter.
rg -nP --type=ts --type=tsx -C3 "/review/|buildMobileReviewRoute|pathname:\s*'/h/\[hostId\]/review" mobile/src mobile/app

Repository: stablyai/orca

Length of output: 183


Script executed:

set -o pipefail
printf '%s\n' '--- reviewed file ---'
git show d75b29207e61df176fa4b90bd9f64aa4060c21df:mobile/src/components/MobileDiffReviewFilesSheet.tsx | nl -ba | sed -n '1,180p'
printf '%s\n' '--- changed file diff ---'
git diff --no-ext-diff --unified=40 4e2fcfe99cfb9eacaf65944ab7157ddef663c6a7 d75b29207e61df176fa4b90bd9f64aa4060c21df -- mobile/src/components/MobileDiffReviewFilesSheet.tsx
printf '%s\n' '--- relevant symbols and paths ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'buildSourceControlTree' -e 'TREE_AREA' -e 'type Queue' -e 'interface Queue' -e 'item.key' -e 'key:' -e "filter === 'all'" -e "filter: 'all'" -e "area" mobile/src mobile/app || test "$?" -eq 1
printf '%s\n' '--- review queue references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'MobileDiffReviewFilesSheet' -e 'DiffReview' -e 'reviewQueue' -e 'queue' mobile/src mobile/app || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 45663


Script executed:

set -o pipefail
printf '%s\n' '--- tree implementation ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'export function buildSourceControlTree' -e 'function buildSourceControlTree' -e 'type SourceControlTreeNode' -e 'export type SourceControlTreeNode' src mobile
tree_file=$(rg -l -F --glob '*.ts' --glob '*.tsx' 'buildSourceControlTree' src/shared mobile/src | head -n 1)
if [ -n "$tree_file" ]; then
  printf '%s\n' "--- candidate tree file: $tree_file ---"
  sed -n '1,280p' "$tree_file"
fi
printf '%s\n' '--- queue definition and constructors ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'MobileDiffReviewQueueItem' -e 'mobile-diff-review-queue' -e 'filePath:' -e 'key:' mobile/src mobile/app
printf '%s\n' '--- review screen references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'MobileDiffReviewFilesSheet' -e 'buildMobileReviewRoute' -e "area === 'all'" -e "area === 'staged'" -e "area === 'unstaged'" -e "area === 'untracked'" -e "area === 'branch'" mobile/src mobile/app

Repository: stablyai/orca

Length of output: 41705


Script executed:

set -o pipefail
printf '%s\n' '--- source-control-tree.ts ---'
nl -ba src/shared/source-control-tree.ts | sed -n '1,260p'
printf '%s\n' '--- mobile-diff-review-queue.ts ---'
nl -ba mobile/src/session/mobile-diff-review-queue.ts | sed -n '1,380p'
printf '%s\n' '--- review controller and drawer ---'
nl -ba mobile/src/session/use-mobile-diff-review-controller.ts | sed -n '1,300p'
nl -ba mobile/src/components/MobileDiffReviewDrawers.tsx | sed -n '1,150p'
printf '%s\n' '--- review route and queue callers ---'
nl -ba mobile/src/source-control/mobile-review-route.ts | sed -n '1,180p'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'buildMobileDiffReviewQueue' -e 'createMobileDiffReviewQueue' -e 'queue=' -e 'queue:' mobile/src mobile/app

Repository: stablyai/orca

Length of output: 41747


Script executed:

set -o pipefail
printf '%s\n' '--- queue builder and filter ---'
nl -ba mobile/src/session/mobile-diff-review-queue.ts | sed -n '257,345p'
printf '%s\n' '--- review loader status input ---'
nl -ba mobile/src/session/mobile-diff-review-loaders.ts | sed -n '130,215p'
printf '%s\n' '--- review route screen parameter handling ---'
nl -ba 'mobile/app/h/[hostId]/review/[worktreeId].tsx' | sed -n '1,180p'
printf '%s\n' '--- queue tests for duplicate paths and all filter ---'
nl -ba mobile/src/session/mobile-diff-review-queue.test.ts | sed -n '1,180p'
rg -n -F --glob '*.ts' --glob '*.tsx' -e "initialFilter" -e "filter: 'all'" -e "area=all" -e "'all'" mobile/src mobile/app/h

Repository: stablyai/orca

Length of output: 26731


Use the queue item key for file rows.

When the all filter includes staged and unstaged entries for the same path, the tree gives both file rows the same key because it uses only files::${filePath}. item.key already includes the scope and area, so it uniquely identifies those rows.

Proposed fix
--- "a/mobile/src/components/MobileDiffReviewFilesSheet.tsx"
+++ "b/mobile/src/components/MobileDiffReviewFilesSheet.tsx"
@@ -92,7 +92,7 @@
       />
       <FlatList
         data={rows}
-        keyExtractor={(row) => row.key}
+        keyExtractor={(row) => (row.type === 'file' ? row.entry.item.key : row.key)}
         keyboardShouldPersistTaps="handled"
         renderItem={({ item: row }) =>
           row.type === 'directory' ? (
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
keyExtractor={(row) => row.key}
keyExtractor={(row) => (row.type === 'file' ? row.entry.item.key : row.key)}

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f6f53c0-4a97-4d3d-bfa4-8b960f84913f
Commits

Reviewing files that changed from the base of the PR and between d75b292 and 0c74b04.

Files selected for processing: 1
  • mobile/src/components/MobileDiffReviewFilesSheet.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-diff-github branch 3 times, most recently from 1c41b93 to d48bfa1 Compare November 1, 2026 17:57
…ff screen

Committed files of a GitHub pull request now show its review threads under
their lines with Reply and Resolve, take their viewed state from GitHub and
sync the checkbox and Viewed · next file back through setPRFileViewed. A tap
or a long-press drag picks lines and opens a sheet that sends the note to
the workspace's agent through the existing send path, or posts it as a
review comment. Threads and GitHub comments appear only while the local
branch is at the PR head, the same contents desktop shows them on;
otherwise the file says to push. openDiffForFile takes an optional line for
a thread's Open in diff.
@AmoabaKelvin
AmoabaKelvin merged commit a3efdcb into main Nov 1, 2026
45 checks passed
Nenzyz pushed a commit to Nenzyz/orca that referenced this pull request Nov 2, 2026
… the diff screen (stablyai#37073)

* feat(mobile): GitHub threads, viewed sync and line comments on the diff screen

Committed files of a GitHub pull request now show its review threads under
their lines with Reply and Resolve, take their viewed state from GitHub and
sync the checkbox and Viewed · next file back through setPRFileViewed. A tap
or a long-press drag picks lines and opens a sheet that sends the note to
the workspace's agent through the existing send path, or posts it as a
review comment. Threads and GitHub comments appear only while the local
branch is at the PR head, the same contents desktop shows them on;
otherwise the file says to push. openDiffForFile takes an optional line for
a thread's Open in diff.

* test(mobile): use a type import for the line-mutations recording adapter

* fix(mobile): name the staged or unstaged side in the jump sheet's file labels
Nenzyz pushed a commit to Nenzyz/orca that referenced this pull request Nov 2, 2026
… the diff screen (stablyai#37073)

* feat(mobile): GitHub threads, viewed sync and line comments on the diff screen

Committed files of a GitHub pull request now show its review threads under
their lines with Reply and Resolve, take their viewed state from GitHub and
sync the checkbox and Viewed · next file back through setPRFileViewed. A tap
or a long-press drag picks lines and opens a sheet that sends the note to
the workspace's agent through the existing send path, or posts it as a
review comment. Threads and GitHub comments appear only while the local
branch is at the PR head, the same contents desktop shows them on;
otherwise the file says to push. openDiffForFile takes an optional line for
a thread's Open in diff.

* test(mobile): use a type import for the line-mutations recording adapter

* fix(mobile): name the staged or unstaged side in the jump sheet's file labels
Nenzyz pushed a commit to Nenzyz/orca that referenced this pull request Nov 2, 2026
… the diff screen (stablyai#37073)

* feat(mobile): GitHub threads, viewed sync and line comments on the diff screen

Committed files of a GitHub pull request now show its review threads under
their lines with Reply and Resolve, take their viewed state from GitHub and
sync the checkbox and Viewed · next file back through setPRFileViewed. A tap
or a long-press drag picks lines and opens a sheet that sends the note to
the workspace's agent through the existing send path, or posts it as a
review comment. Threads and GitHub comments appear only while the local
branch is at the PR head, the same contents desktop shows them on;
otherwise the file says to push. openDiffForFile takes an optional line for
a thread's Open in diff.

* test(mobile): use a type import for the line-mutations recording adapter

* fix(mobile): name the staged or unstaged side in the jump sheet's file labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants