trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42#3502
Closed
trunk-io[bot] wants to merge 6 commits into
Closed
trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42#3502trunk-io[bot] wants to merge 6 commits into
trunk-io[bot] wants to merge 6 commits into
Conversation
…unk"
Persist the last-known default ("trunk") branch per cloud repo so a cold
start can pre-select trunk in the branch picker immediately, instead of
waiting on the slow live branch list to resolve.
The picker already auto-selects the default branch when nothing is
selected; feeding it a cached value makes that fire with zero wait. The
fresh value from the live query takes over the moment it arrives and is
written back to the cache.
Generated-By: PostHog Code
Task-Id: 562fb90f-d823-425d-b53c-5f482b55a8b2
Seed the known default ("trunk") branch as a real, pickable list item in
the cloud branch picker while the remote branch list is still loading, with
a "Loading branches…" row rendered directly below it. This makes the open
dropdown usable for the common "start on trunk" case with zero wait, and
signals that the rest of the branches are still on the way.
Only seeds when there's no active search — once the user types, the list is
purely what the remote returns.
Generated-By: PostHog Code
Task-Id: 562fb90f-d823-425d-b53c-5f482b55a8b2
Multi-perspective review (paul + xp + security-audit) surfaced low/nit items; this addresses the actionable ones: - Extract the duplicated "Loading branches…" literal into a shared LOADING_BRANCHES_LABEL const so the two render sites can't drift. - Clarify the TaskInput comment: the cached default is best-effort — a default branch renamed since it was cached stays seeded until the user picks another (the auto-select only fires while nothing is selected). - Lock the empty-state gating with a test asserting "No branches found." keeps the `hidden` class when the seeded trunk row makes the list non-empty, so it never flashes above the seeded row. security-audit: 0 findings (API-derived branch name → auto-escaped React text + the pre-existing selection path; no new sink). Generated-By: PostHog Code Task-Id: 562fb90f-d823-425d-b53c-5f482b55a8b2
Generated-By: PostHog Code Task-Id: 562fb90f-d823-425d-b53c-5f482b55a8b2
Four reviewers (qa-swarm's paul + xp, plus the org Codex and veria-ai bots) independently flagged that a stale cached default branch never self-corrects: the picker auto-selects the cached "trunk", and the existing effect's `!selectedBranch` guard then blocks re-selection once the live default arrives, so a task could start on a branch that is no longer the default. Track the branch we auto-selected in a ref and re-select when the default changes out from under our own auto-pick — while never clobbering a branch the user chose deliberately. Adds tests for both the self-heal and the user-choice-preserved paths, and updates the TaskInput comment to match. Generated-By: PostHog Code Task-Id: 562fb90f-d823-425d-b53c-5f482b55a8b2
|
React Doctor found 4 issues in 2 files · 4 warnings. 4 warnings
Reviewed by React Doctor for commit |
trunk-io
Bot
deleted the
trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42
branch
July 16, 2026 11:31
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.
This pull request was created and is being managed by Trunk Merge.
This pull request is based on the main branch at SHA ed6cdfbfc23730fbec5daf33b7d5001342931cf7.
See more details here.
When CI completes, this pull request will be closed automatically.
Pull Requests Being Tested
This pull request is testing the changes from pull request 3496.