Skip to content

trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42#3502

Closed
trunk-io[bot] wants to merge 6 commits into
mainfrom
trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42
Closed

trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42#3502
trunk-io[bot] wants to merge 6 commits into
mainfrom
trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42

Conversation

@trunk-io

@trunk-io trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown
Trunk Merge Pull Request Banner

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.

pauldambra and others added 6 commits July 16, 2026 10:57
…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
@github-actions

Copy link
Copy Markdown

React Doctor found 4 issues in 2 files · 4 warnings.

4 warnings

src/features/git-interaction/components/BranchSelector.tsx

src/features/task-detail/components/TaskInput.tsx

Reviewed by React Doctor for commit 09e2de5.

@trunk-io trunk-io Bot closed this Jul 16, 2026
@trunk-io
trunk-io Bot deleted the trunk-merge/pr-3496/dafc02a3-1104-4a00-b63a-285ec789df42 branch July 16, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant