Skip to content

feat: branch deployment selector with @branch path segments#9011

Draft
ericpgreen2 wants to merge 3 commits intomainfrom
ericgreen/branch-selector-ui
Draft

feat: branch deployment selector with @branch path segments#9011
ericpgreen2 wants to merge 3 commits intomainfrom
ericgreen/branch-selector-ui

Conversation

@ericpgreen2
Copy link
Contributor

@ericpgreen2 ericpgreen2 commented Mar 10, 2026

Let project admins preview branch deployments in Rill Cloud via @branch path segments in the URL (e.g., /org/project/@feature-x/explore/dashboard).

  • Branch selector in the avatar dropdown menu (visible to admins with readDev)
  • Warning banner with "Back to production" link when viewing a branch
  • "View As" works correctly on branch deployments
  • Browser back/forward history preserved

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

Add a branch selector chip to the project header that lets admins
switch between branch deployments directly in the cloud UI. Gated
on `readDev` permission.

- New `BranchSelector` component (chip + dropdown, modeled after `ViewAsUserChip`)
- Read `?branch=X` query param in project layout, pass to `GetProject` API
- Warning banner when viewing a non-production branch deployment
- Branch param preserved across tab navigation via `branchSearchSuffix`
- "Start deployment" button for stopped branch deployments
- Deduplicates `ListDeployments` by branch; live status from `GetProject`
- "View As" composes with branch context
Move `BranchSelector` from a standalone header chip into the avatar
button dropdown as a submenu (like "View as"), reducing visual clutter
when viewing branch deployments. Replace `ProjectAccessControls` wrapper
in `AvatarButton` with a `projectPermissions` prop passed from
`ProjectHeader`, eliminating a redundant `GetProject` query. Clean up
branch-related props from `SlimProjectHeader` and `ProjectHeader`.
…ments

Replace `?branch=X` query params with `@branch` path segments for branch
deployment previews (e.g., `/org/project/@feature-x/explore/dashboard`).

- Add `reroute` hook to strip `@branch` before route matching
- Add `beforeNavigate` hook to inject `@branch` into branch-unaware links
- Add `branch-utils.ts` with path manipulation helpers
- Use `~` encoding for `/` in branch names (git disallows `~` in refs)
- Branch menu items render as `<a>` tags for href preview on hover
- Back/forward browser history works correctly (skip injection on popstate)
@ericpgreen2 ericpgreen2 self-assigned this Mar 10, 2026
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