fix(code): prevent branch picker overflow with responsive shrink#1906
Merged
Conversation
Long branch names made the BranchSelector grow past the toolbar's max-w-[50%] container, pushing the diff badge and continue button off screen. The truncate on the inner span never engaged because the Button primitive ships with shrink-0 and no width cap. Override shrink-0 with shrink and min-w-0 so the button is flex-shrinkable, and add max-w-[250px] to keep it bounded on wide layouts. Generated-By: PostHog Code Task-Id: 526badb3-bb81-4e73-ae29-e89332848acc
Contributor
|
Reviews (1): Last reviewed commit: "fix(code): prevent branch picker overflo..." | Re-trigger Greptile |
tatoalo
approved these changes
Apr 28, 2026
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.
Problem
Long branch names (e.g.
posthog-code/prevent-message-send-during-cloud-run-startup) made theBranchSelectorin the task header grow past the toolbar'smax-w-[50%]container, pushing the diff badge, continue/handoff button, and task actions menu off the right edge of the window.The inner span on the branch name already had
min-w-0 truncate, but truncation never engaged: the underlyingButtonprimitive ships withinline-flex shrink-0and no width cap, so the button always sized to its content.Solution
Override the primitive's flex constraints at the call site in
BranchSelector.tsx:shrink— overridesshrink-0so the button is flex-shrinkable.min-w-0— lets it shrink below content width so the innertruncatespan engages.max-w-[250px]— bounds it on wide layouts so it doesn't grow absurdly.Showcase
Created with PostHog Code