镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(web): branch pickers highlight one row after refs load - #29505

Closed
AyushKaithwas wants to merge 1 commit into
pingdotgg:mainfrom
AyushKaithwas:fix/branch-picker-stale-row-index
Closed

AyushKaithwas wants to merge 1 commit into
pingdotgg:mainfrom
AyushKaithwas:fix/branch-picker-stale-row-index

Conversation

@AyushKaithwas

Copy link
Copy Markdown

Problem

In the web branch pickers, two rows can show as highlighted at the same time. To reproduce, open the composer's branch picker, type dev, and press ↓ before the server returns matches. When origin/dev arrives above Create new ref "dev", both rows look selected.

Change

The branch picker's list (LegendList) skips rendering a row again when that row's item is unchanged. The create row keeps the index it rendered with, which was 0. Once origin/dev takes index 0, both rows see that index as active. Passing the filtered items as extraData makes rows render again whenever the list changes. Each row then reads its current index, and only one row is highlighted.

Scope and approval

This is a very small fix for an obvious bug: one prop on the shared BranchPicker, plus a test. It changes nothing else.

Verification

  • New browser test apps/web/src/components/BranchPicker.browser.test.tsx covers the sequence above: show the create row alone, highlight it, then add a ref above it. It fails on main (the create row stays highlighted) and passes with the fix.
  • vp run check:changed passes: format, lint, knip, typecheck, tests, and React Compiler.
  • Manual check in an isolated dev instance (--home-dir scratch folder, --no-seed), in the composer's branch picker after typing dev:
Before (main) After
Both origin/dev and Create new ref "dev" highlighted Only origin/dev highlighted

Not checked: desktop (Electron). It uses the same component.

Written by Claude Opus 5.5 in Claude Code, run from T3 Code.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Nov 2, 2026
@github-actions github-actions Bot added the size:XS 0-9 changed lines (additions + deletions). label Nov 2, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at cce0ae3

Macroscope's review found this PR approvable — Refreshes virtualized branch-picker rows when refs change so row indexes and highlighting stay synchronized. The change is confined to rendering and leaves selection actions and product defaults unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0847a44 and cce0ae3.

Files selected for processing: 2
  • apps/web/src/components/BranchPicker.browser.test.tsx
  • apps/web/src/components/BranchPicker.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

BranchPicker now passes its filtered items to LegendList as extra data. A browser test checks that the highlighted option updates when a new result appears above the existing “Create dev” option.

Changes: BranchPicker highlight refresh

Layer / File(s) Summary
Refresh highlights when results change
apps/web/src/components/BranchPicker.tsx, apps/web/src/components/BranchPicker.browser.test.tsx
BranchPicker passes filteredItems to LegendList as extraData. The browser test checks that the highlight moves to “origin/dev” when it appears above “Create dev”.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to cce0a

The picker refreshes highlights as results arrive. No merge-blocking risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main fix: preventing multiple highlighted rows in web branch pickers after refs load.
Description check Passed The description includes the problem, reproduction steps, technical change, scope rationale, focused test results, manual verification, screenshots, unverified desktop coverage, and agent attribution.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@maria-rcks

maria-rcks commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head cce0ae35eb3b02d73e1b1fed8dc8059f45212626 on a linux vm, using repository playwright and /usr/bin/google-chrome against real dev servers. installed dependencies with vp i in both checkouts. main and pr servers ran sequentially with isolated state.

created the project through the app. real codex gpt-6.1-sol turns created the readme and local development branch. no mocks, fixtures, demo provider, response interception, or artificial network delay.

  • on github/main (e0f69e9ea4), opening the branch picker, typing dev, and pressing down before refs arrived highlighted both development and Create new ref "dev". both options had index/id 0.
  • on this head, the same project, conversation, query, and keyboard action highlight only development. the create row has index 1 and no highlight. checked both the composer and thread-details pickers.
  • up/down moves one highlight; enter and mouse selection switch the actual repository branch. escape dismisses the picker. exact-name searches remove the create option after results arrive. creating verify-branch through the picker works.
  • a further real codex turn confirmed the selected branch and created ref through git:
git branch --show-current
development

git branch --list
* development
  main
  verify-branch

vp run check:changed passed through blacksmith-check: format, lint, both knip passes, affected typechecks, the existing browser regression test, and react compiler coverage. the worker needed its playwright chromium installed before the browser test could run. github ci is also green. no source changes or pushes were needed.

before, main:

main highlights both development and create dev

main interaction reproduces two highlighted rows

after, pr:

pr highlights development alone with matching project and query

pr keyboard navigation keeps one highlight and enter checks out development

inspected the captures and verified both uploaded videos play and seek in chrome and the t3 browser.

Not verified

native electron, ios/android, other providers, remote relay/tunnel connections, and the separate worktree-base picker were not exercised. the live reproduction used a local matching development ref rather than the description's origin/dev ref.

Copy link
Copy Markdown
Member

Thanks @AyushKaithwas for the fix and regression test. Main now keeps only one row highlighted when refs arrive: your regression test passes unchanged after the Legend List upgrade in #28125 (4df0c1302a). Closing as covered; please open a focused follow-up if you find a remaining case.

AyushKaithwas added a commit to AyushKaithwas/t3code that referenced this pull request Nov 12, 2026
Takes main's BranchPicker.tsx and drops the pingdotgg#29505 regression test:
pingdotgg#29505 was closed because the Legend List upgrade on main (pingdotgg#28125)
already fixes that bug, so this PR no longer carries it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants