Repository navigation
fix(mobile): show the diff when tapping a changed file from a session - #34073
Conversation
The session keeps its own tab pick over host snapshots, so the pushed Changes screen's host-side activation never reached it.
96fbf8c to
ecfa08e
Compare
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
There was a problem hiding this comment.
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:
31bf2dc2-4ece-4739-a376-8f3b43ca77ab
Files selected for processing: 3-
mobile/app/h/[hostId]/source-control/[worktreeId].web.tsxmobile/src/session/session-diff-open-handlers.tsmobile/src/session/use-mobile-session-file-actions.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
Resuming from Agent History pushes a second session for the same worktree; its unmount dropped the first session's registration.
ELI5
On a phone, tapping a changed file in a session's Changes screen took you back to the chat or terminal, and the diff never showed. Now you land on the file's diff.
What Changed
follow. The Changes screen's activation is caller-only, so the session ignored it.onFileOpenStart/onOpenedFileDiff, and the session switches to the diff tab itself. On phones, Changes is a separate screen pushed over the session and had no way to reach those callbacks.session-diff-open-handlers.ts, keyed by host, execution host and worktree. When the pushed Changes page was opened from a session (origin=session), it passes them to the panel, so a tap takes the same path as the docked panel.Why
I didn't relax the session's rule that its own pick wins. That rule (
resolveActiveSessionTab) stops ordinary host republications from moving the phone off the tab you chose. Dropping the pick whenever the session regains focus would change what you see every time you come back to it. The registry only acts on the file you tapped.Linked Issue
None.
Visual Proof
iOS simulator, OTA page, iPhone width (Changes pushed as its own screen). Terminal tab active → Changes → tap
src/greet.js:Testing
On the iOS simulator against a dev desktop serving the rebuilt OTA page:
Mobile
typecheck, focused mobile tests (session, source-control, RPC recordings) andcheck:changedpass.Starting from a chat tab wasn't tested on the device. It goes through the same session tab switch.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
No new tests. The behaviour depends on two screens sharing one page runtime, which the simulator run covers.