Skip to content

Filter out branches that are applied in the *current* workspace - #14552

Merged
OliverJAsh merged 1 commit into
masterfrom
push-popvpnstznkq
Jul 1, 2026
Merged

OliverJAsh merged 1 commit into
masterfrom
push-popvpnstznkq

Conversation

@OliverJAsh

Copy link
Copy Markdown
Contributor

Closes GB-1713

@OliverJAsh
OliverJAsh requested review from Copilot and samhh July 1, 2026 11:53
@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown

GB-1713

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Lite workspace “Apply branch” picker to exclude branches that are already applied in the current workspace (GB-1713), rather than filtering out all applied branches globally.

Changes:

  • Adds a head-info query and derives a HeadInfoIndex for workspace-aware branch filtering.
  • Switches branch listing to fetch unfiltered results and filters client-side using the current workspace’s applied-branch context.
  • Adjusts the picker’s item derivation to use the query select output directly.

Comment on lines +90 to +101
const { data: headInfoIndex } = useQuery({
...headInfoQueryOptions(projectId),
select: getHeadInfoIndex,
});
const branchesQuery = useQuery({
...listBranchesQueryOptions({ projectId, filter: null }),
select: (branches) =>
branches
.flatMap(branchListingToApplyBranchPickerOptions)
// Filter out branches that are applied in the *current* workspace.
.filter((option) => !headInfoIndex?.branchContextByRefBytes(encodeBytes(option.branchRef))),
});
@OliverJAsh
OliverJAsh merged commit 6851226 into master Jul 1, 2026
37 checks passed
@OliverJAsh
OliverJAsh deleted the push-popvpnstznkq branch July 1, 2026 12:51

This branch was previously deployed

1 inactive deployment
Preview — 3dfdf0b5 Deployed Jul 1, 2026 by vercel[bot]
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.

2 participants