Repository navigation
fix(mobile): the phone highlights only the workspace it last opened, and folding never scrolls the list - #31296
Merged
Merged
Conversation
… and a fold never scrolls the list
9 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 phone's workspace list, the only highlighted row is now the workspace you last opened on this phone, and only while that row is on screen. The phone never highlights the computer's selected workspace in its place. Folding or unfolding a section no longer scrolls the list.
What Changed
Before: if the phone's own row wasn't on screen, the phone highlighted the desktop's selected workspace instead. That covered a phone that had never opened anything there, and a row that was folded, filtered, searched away or deleted. Folding a project that held the phone's row therefore moved the highlight to the desktop's row, and the list scrolled to it.
After:
How:
buildHostFeedSections,buildPreFeedSections) set each row's highlight fromisLastVisitedWorktreeRowalone. The desktop'sactiveRowKeys, andworktree.ps'sisActivemark, no longer feed the phone's highlight. The fallback code (highlightPhoneVisitand the loading-versus-never-opened state) is removed.useActiveWorktreeScrollremembers the last workspace it saw highlighted, whether or not it scrolled to it. It scrolls only when a different one appears, and skips a highlight that first appears in the same render as a fold change. It takes the list's folded sections for this, in place of the search flag from fix(mobile): highlight the workspace this phone last opened on the host, else the desktop's selection #31081.Phone only. Nothing changed in the wire format, the RPCs, the feed, the shared builder, or the desktop.
Why
With a desktop fallback, the phone's highlight jumped to rows the phone user never chose, and the scroll followed it. The owner chose the simplest rule: the phone owns its highlight completely, and shows nothing when it has nothing of its own to show.
Linked Issue
Follow-up to #31081 (already in
sidebar-flip-a).Visual Proof
The real phone page bundle, at a 393x852 viewport, talking to a hidden Orca desktop (
ORCA_BACKGROUND_LAUNCH=1) whose selected workspace isw10. The page gets the shell's route grants, so a tap opens the session as a separate page. "Before" is the page built fromsidebar-flip-a(a0e6cd8); "after" is this branch.w2, session opens on top, Back (unchanged)Testing
I manually tested these changes locally (phone page flows above, macOS host)
Automated tests added/updated
host-sidebar-feed-sections.test.tscovers:worktree.psmark.use-active-worktree-scroll.test.tsxcovers:tests/e2e/sidebar-phone-feed-list.spec.ts: all 5 tests pass locally (hidden Electron,ORCA_BACKGROUND_LAUNCH=1).Local checks, all passing:
tsc --noEmit;src/host-screen,src/worktree,src/session,src/mobile-web-shell,src/storage,src/hooks;oxfmt --check(frommobile/);Not run locally:
tests/e2e/ssh-orcad-phone-feed-list.spec.ts, which needs the managed Docker SSH host. Its phone visit names the seeded workspace on its managed server (runtime:host), matching how a phone tap routes that row.Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)