Repository navigation
fix(native): refresh branch refs after cache invalidation - #179
Merged
Merged
Conversation
This was referenced Nov 3, 2026
rynfar
force-pushed
the
nw/144-branch-refresh
branch
from
November 3, 2026 22:50
286c87e to
b503da8
Compare
Open
rynfar
force-pushed
the
nw/144-branch-refresh
branch
from
November 3, 2026 23:17
b503da8 to
6037f57
Compare
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.
The native branch picker reused server snapshots after refs changed outside T3 Code. Ref-affecting actions also left mounted lists unchanged, while background refreshes discarded displayed rows and could move keyboard activation to a different branch. A provisional Create highlight could also survive after an exact branch match arrived, and hovering a row painted a different highlight from the target Enter would activate.
Port the environment-wide invalidation revision and per-repository server revision from
client-runtime/src/state/vcs.ts,vcsRefInvalidation.ts, andgit.ts. The first read after invalidation sendsrefresh: true, preserving every list input field. Search and pagination share freshness only after a current reply commits; superseded replies cannot mark the snapshot fresh or reach the picker. Unary settlement hooks cover the web's ref-affecting methods, including PR checkout andsourceControl.publishRepository. Stacked-action streams hold the same finalizer through consumption, failure, and interruption, matchingvcsAction.ts.Same-query refreshes retain displayed rows, errors, and mounted page cursors, including a page already being fetched. The client reads those pages again and replaces the listing only after the replacement succeeds. Failed refreshes retain the previous listing. Highlighting and activation use ref/create-item identity, so reordering, removal, or pagination cannot redirect Enter or a stale row click to another ref. New queries, changes to the checkout directory, and environment changes still reset the listing. Automatic search highlighting follows arriving results while a read is pending or the Create row is provisional. A settled ref result anchors background refreshes; keyboard navigation and pointer movement pin the chosen identity immediately. Pointer leave clears a pointer selection, while any keyboard input restores keyboard modality. The component paints that same identity, so visible highlighting and Enter share one source of truth. This policy lives in core and is tested without GPUI.
Closes #144. Ports
pingdotgg/t3code#27438and the ref invalidation frompingdotgg/t3code#29161.GT-BRANCH stays partial and now tracks #180. Remaining gaps: previous-worktree entries and cleanup; full draft/worktree-base controls; persisted/offline refs and recovery; native PR checkout UI; native repository publishing UI, which remains disabled. PR checkout and publishing RPC invalidation are implemented, but those UI flows are not enabled by this change.
Validation:
cargo clippy --workspace --all-targets -- -D warningspassed.cargo test --workspacepassed: 88 client tests, 1,107 core tests, 7 conformance replays, and 48 app tests. Validated after rebasing onto native6e9ce35455. Log:/private/tmp/native-144-r3-rebased-tests.log./private/tmp/native-144-r3-rebased-clippy.log./private/tmp/native-144-list-red.logfor the original five cases;/private/tmp/native-144-r1-red.logfor nonempty paginated refresh retention and stacked/publishing invalidation./private/tmp/native-144-r2-red.logproves the pending-Create highlight regression, and/private/tmp/native-144-r2-opening-red.logcovers opening with retained rows while a refresh is pending. Core tests cover automatic Create-to-ref transitions, protected explicit selections, pending and failed refreshes, replacement, stale pages, a pending third cursor, highlight identity across pages/reordering/removal, and create-item identity. Fake-server tests cover unary settlement plus stacked-action success, failure, and interruption, including pre-action reply rejection./private/tmp/native-144-r3-red.log. The core case verifies that hovering pins Enter’s identity across arriving search results, pointer leave clears it, keyboard input ends pointer modality, and repeated movement over the same choice avoids repainting./private/tmp/native-144-evidence/r3-before-hover.png,/private/tmp/native-144-evidence/r3-hover.png./private/tmp/native-144-evidence/r3-leave.pngshows pointer leave clearing the highlight;/private/tmp/native-144-evidence/r3-keyboard-hover.pngshows keyboard navigation taking over with the pointer still over the old row. MenuRow retains its existing look through a controlled-highlight option./private/tmp/native-144-evidence/refs-probe.log—vcs.listRefswithcwd,limit: 100,refresh: true. The probe example was removed from the PR; the transcript remains evidence./private/tmp/native-144-evidence/r2-before-search.png,/private/tmp/native-144-evidence/r2-after-search.png. Searching for an existing remote branch beyond the initial page now highlights the arriving ref without arrow navigation. Enter was not sent, so no checkout occurred./private/tmp/native-144-evidence/r1-picker.pngshows 200 loaded refs and keyboard highlighting. Baseline:/private/tmp/native-144-evidence/before-picker.png. No real branches were created, deleted, or checked out. Real branch-changing action flows were not exercised. Captures stay local under the factory rules.Built with GPT-6.1 Sol in Codex