You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): GitHub review threads, viewed sync and line comments on the diff screen - #37073
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)
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.
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: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
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 checks: 4 passed
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
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
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…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.
… 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
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
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.
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:
getPRInlineCommentPlacementandgroupPRComments, so outdated threads are skipped as on desktop;CommentGroupViewanduseMobilePrCommentActions, so Reply and Resolve are the existing ones;Viewed sync. The PR files'
viewerViewedStatenow drives the box and "Viewed · next file":files, with each file salvaged on its own;github.setPRFileViewedthrough desktop's pattern: patch the PR details optimistically, roll back on failure, and ignore re-ticks while that file's write is pending;Line comments. A tap picks one line; a long-press then drag picks a range. The sheet ("Lines 25–26") offers:
isMobileTerminalTabRunningAgent, so an exited agent's shell never receives it. With none or several, today's picker opens with just that note.github.addPRReviewCommenton 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:
Open at a line.
openDiffForFiletakes an optionallinefor 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:
The viewed sync copies desktop's
syncPullRequestFileViewedinstead of inventing a second rule.Linked Issue
None. This is part of the approved mobile Source Control redesign.
Visual Proof
Long-press and drag over lines 26–28 (the end state, then a video):
c-drag-range.mp4
Before:
mainshowed 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/tasksandsrc/test-supporttests pass.New tests cover:
Added an RPC recording scenario for
addPRReviewCommentandsetPRFileViewed(refused included) and re-recorded the goldens.Ran
build:mobile-weband 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
Notes
Page bundle: 184 assets (was 183). The review route now imports the session strip's running-agent rule (
mobile-terminal-tab-agentand 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-measuredMOBILE_WEB_APP_BUNDLE_SCRIPT_SWEEPwithroutes.slice(0, n). Main's table was already 4 stale: it ended at 118 while main builds 122. I updated the ceiling pins and leftMOBILE_WEB_APP_BUNDLE_SCRIPT_MARGINandMOBILE_WEB_BUNDLE_MAX_ASSETS(256) alone.assertAssetCeilingFitsShellpasses, now crossing 256 at 23 routes. Script bytes sit about 11 KB under their 9 MiB budget.Mixed versions:
files,launchAgentandagentStatusare 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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)