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): diff screen with jump to file, folded context and Stage/Viewed · next file - #36998
The screen you land on after tapping a changed file now looks and works like the approved design. The title is the file's name and opens a list of every file. Unchanged code folds away. The big button does the next thing: stage this file, or mark it viewed, then go to the next file.
What Changed
Before:
The review screen walked every changed file in one mixed list ("7/9"), filtered by six chips.
Every unchanged line showed.
The only navigation was previous/next and hunk jumps.
The bar had Note, Mark Reviewed and a row of Stage/Unstage/Discard buttons.
After (mobile/src/session and MobileDiffReview*):
One section at a time. The screen walks the Changes section the file came from: uncommitted (unstaged and untracked), staged, committed on the branch, or one commit's files. The subtitle reads "3 of 12 · 4 viewed", "1 of 4 uncommitted" or "1 of 2 in this commit".
Jump to file. Tapping the title opens a sheet built on src/shared/source-control-tree (desktop's compact folder tree), with search, status letters, a "current" pill, note counts, +/- and viewed boxes.
Folded context. Unchanged runs fold into "N unchanged lines" rows, keeping 3 lines beside each change, which is the Monaco default desktop's diff uses. Lines with notes never fold.
One main button.
"Stage · next file" for uncommitted files.
"Viewed · next file" for staged and branch files.
"Next file" for commit files and files already viewed.
⋯ menu. Discard (with its confirm), Unstage, Add File Note, the notes actions, Pull Request on phones, and Open in Session.
Commit files.openDiffForFile also takes { kind: 'commit', commitOid, filePath }. The screen reads the files through git.commitCompare and the diffs through git.commitDiff (diffed against the parent it returns). Commit files are read-only: no notes, no viewed state. New native shells forward the commit param. Shipped shells drop it on a cold mount, and the screen then asks for an app update.
Selection by key. The open file is held by key, so a stage, unstage, discard or save that reloads the queue keeps the reader on the right file. A file that leaves falls to whatever took its place.
Removed: filter chips, hunk jumps and Stage Reviewed. The mock drops them, and the sections plus jump sheet replace them.
Why
This is the "One diff screen" section of the approved Source Control mocks. Everything is reused rather than rebuilt:
the tree is desktop's shared builder;
the fold numbers are what desktop's diff uses;
the commit diff is the host call desktop's history uses;
local viewed state and notes are today's.
GitHub threads under their lines, viewed sync to GitHub, and long-press line-range comments come in the next PR in this stack.
Linked Issue
None. This is part of the approved mobile Source Control redesign.
Visual Proof
Before
After
Committed file
Uncommitted file
⋯ menu
Jump to file (title tap)
none
A commit's file
none
Light
The shots are captured from the built OTA page bundles of main and this branch, with scripted host replies (WebKit, iPhone-size viewport).
Testing
Captured every state above from both bundles.
Ran the mobile typecheck (app and tests) and the focused src/session, src/components and src/source-control tests (491 files).
New tests cover:
folds, including notes and opened folds surviving a split;
key-based selection;
Stage · next file wrapping and keeping a pick made while staging;
Retry reloading the open diff;
the commit route param.
Added an RPC recording scenario for the commit snapshot and commit diff, re-recorded every golden with --prune, and re-pinned the bridged-parity tally.
build:mobile-web still reports 183 assets.
Mobile localization verified, plus coverage. 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
Mixed versions:
git.commitCompare and git.commitDiff are already allowed for mobile.
The commit summary is optional in the reply schema; without it the screen shows an error rather than guessing at a parent.
Older native shells drop the new commit param only on cold native mounts, which then show an "update the app" state. In-page pushes keep it.
Remote/SSH: no new calls beyond the existing git reads.
Folder workspaces: these have no Source Control rows, so they can't reach this screen.
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; 5 remain after this review.
Walkthrough
The mobile review flow now supports commit-scoped files, file selection, viewed-state actions, and expandable folds for unchanged diff lines. Source-control file rows route changes to review screens. The branch-diff preview and session diff-reveal flows have been removed. Related RPC recordings, tests, and translations have also changed.
Merge Risk: Moderate · up to 7c378
The lint job can fail, and review state or errors can be displayed incorrectly. Resolve these issues before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 26.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 clearly identifies the mobile diff-screen redesign, including file navigation, folded context, and Stage/Viewed next-file behavior.
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.
Description check
The description is detailed and follows the required structure. It includes the ELI5 summary, user-visible changes, rationale, visual proof, testing details, notes, and checklist. The Linked Issue fie…
Full details: Description check
Explanation
The description is detailed and follows the required structure. It includes the ELI5 summary, user-visible changes, rationale, visual proof, testing details, notes, and checklist. The Linked Issue field states "None," although the template normally requires an issue link; this is the only notable template gap.
Full details: Docstring Coverage
Explanation
Docstring coverage is 26.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 50 functions across 55 files.
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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (2)
Major · Fix the max-lines lint failure. CI blocks the merge. · use-mobile-diff-review-controller.ts:350
mobile/src/session/use-mobile-diff-review-controller.ts:350 Major · Maintainability & Code Quality · Quick win
Fix the max-lines lint failure. CI blocks the merge.
The Mobile verify job fails because pnpm lint reports 325 lines for this file. The commit-snapshot branch, the key/index selection state, and the new callbacks add the extra lines.
Extract one cohesive block into its own hook. The selection state (Lines 85-88 and 186-229) is a good candidate:
Move the selection state into a hook such as useMobileDiffReviewSelection(filteredQueue, initialTarget).
Return currentIndex, currentItem, selectIndex, selectKey, and moveSelection from that hook.
Keep the seededInitialTargetRef seeding effect inside the same hook.
The controller then calls the new hook once and passes its results to useMobileDiffReviewInteractions.
Source: Pipeline failures
Minor · Remove the unused MobileDiffReviewQueueItem import. · mobile-diff-review-queue.test.ts:8
mobile/src/session/mobile-diff-review-queue.test.ts:8 Minor · Maintainability & Code Quality · Quick win
Remove the unused MobileDiffReviewQueueItem import.
The removed tests were the only uses of this type. Oxlint reports unused imports through its enabled correctness rules, so this import can independently fail pnpm lint.
Suggested fix
import {
buildMobileDiffReviewQueue,
- createMobileDiffReviewFileKey,- type MobileDiffReviewQueueItem+ createMobileDiffReviewFileKey
} from './mobile-diff-review-queue'
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: a16dddf5-8a30-48d2-8307-47773df6eea6
Commits
Reviewing files that changed from the base of the PR and between 90a5374 and b8857cd.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
Roll back all failed viewed-state changes.
131-132: Major · Data Integrity & Integration · Heavy lift
Roll back all failed viewed-state changes.
If a user toggles two files while both saves are pending, and both saves fail in order, the first failure does not roll back because a newer save started. The second failure then restores previous, which can still contain the first optimistic toggle. The screen shows that file as viewed, but the host did not save it. Track pending changes individually, or serialize saves and restore the last confirmed state on failure. (raw.githubusercontent.com)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…d/stage next
The review screen becomes the one diff screen from the approved design.
It walks the Changes section the file came from (uncommitted, staged or on
the branch) or one commit's files, so 'N of M' and next/previous stay in
that list. The title opens a jump-to-file sheet built on the shared
source-control tree, with search and viewed boxes. Unchanged runs fold the
way desktop's diff does. The bar's main button is Stage · next file for
uncommitted files and Viewed · next file otherwise; Discard and Unstage move
to the menu. Filter chips, hunk jumps and Stage Reviewed are gone.
openDiffForFile also takes { kind: 'commit', commitOid, filePath }, read
through git.commitCompare and git.commitDiff.
…d/stage next (stablyai#36998)
The review screen becomes the one diff screen from the approved design.
It walks the Changes section the file came from (uncommitted, staged or on
the branch) or one commit's files, so 'N of M' and next/previous stay in
that list. The title opens a jump-to-file sheet built on the shared
source-control tree, with search and viewed boxes. Unchanged runs fold the
way desktop's diff does. The bar's main button is Stage · next file for
uncommitted files and Viewed · next file otherwise; Discard and Unstage move
to the menu. Filter chips, hunk jumps and Stage Reviewed are gone.
openDiffForFile also takes { kind: 'commit', commitOid, filePath }, read
through git.commitCompare and git.commitDiff.
Nenzyz
pushed a commit
to Nenzyz/orca
that referenced
this pull request
Nov 2, 2026
…d/stage next (stablyai#36998)
The review screen becomes the one diff screen from the approved design.
It walks the Changes section the file came from (uncommitted, staged or on
the branch) or one commit's files, so 'N of M' and next/previous stay in
that list. The title opens a jump-to-file sheet built on the shared
source-control tree, with search and viewed boxes. Unchanged runs fold the
way desktop's diff does. The bar's main button is Stage · next file for
uncommitted files and Viewed · next file otherwise; Discard and Unstage move
to the menu. Filter chips, hunk jumps and Stage Reviewed are gone.
openDiffForFile also takes { kind: 'commit', commitOid, filePath }, read
through git.commitCompare and git.commitDiff.
Nenzyz
pushed a commit
to Nenzyz/orca
that referenced
this pull request
Nov 2, 2026
…d/stage next (stablyai#36998)
The review screen becomes the one diff screen from the approved design.
It walks the Changes section the file came from (uncommitted, staged or on
the branch) or one commit's files, so 'N of M' and next/previous stay in
that list. The title opens a jump-to-file sheet built on the shared
source-control tree, with search and viewed boxes. Unchanged runs fold the
way desktop's diff does. The bar's main button is Stage · next file for
uncommitted files and Viewed · next file otherwise; Discard and Unstage move
to the menu. Filter chips, hunk jumps and Stage Reviewed are gone.
openDiffForFile also takes { kind: 'commit', commitOid, filePath }, read
through git.commitCompare and git.commitDiff.
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
The screen you land on after tapping a changed file now looks and works like the approved design. The title is the file's name and opens a list of every file. Unchanged code folds away. The big button does the next thing: stage this file, or mark it viewed, then go to the next file.
What Changed
Before:
After (
mobile/src/sessionandMobileDiffReview*):src/shared/source-control-tree(desktop's compact folder tree), with search, status letters, a "current" pill, note counts, +/- and viewed boxes.openDiffForFilealso takes{ kind: 'commit', commitOid, filePath }. The screen reads the files throughgit.commitCompareand the diffs throughgit.commitDiff(diffed against the parent it returns). Commit files are read-only: no notes, no viewed state. New native shells forward thecommitparam. Shipped shells drop it on a cold mount, and the screen then asks for an app update.Why
This is the "One diff screen" section of the approved Source Control mocks. Everything is reused rather than rebuilt:
GitHub threads under their lines, viewed sync to GitHub, and long-press line-range comments come in the next PR in this stack.
Linked Issue
None. This is part of the approved mobile Source Control redesign.
Visual Proof
The shots are captured from the built OTA page bundles of
mainand this branch, with scripted host replies (WebKit, iPhone-size viewport).Testing
Captured every state above from both bundles.
Ran the mobile typecheck (app and tests) and the focused
src/session,src/componentsandsrc/source-controltests (491 files).New tests cover:
Added an RPC recording scenario for the commit snapshot and commit diff, re-recorded every golden with
--prune, and re-pinned the bridged-parity tally.build:mobile-webstill reports 183 assets.Mobile localization verified, plus coverage. 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
git.commitCompareandgit.commitDiffare already allowed for mobile.commitparam only on cold native mounts, which then show an "update the app" state. In-page pushes keep it.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)