Skip to content

fix(code): prevent branch picker overflow with responsive shrink#1906

Merged
VojtechBartos merged 1 commit into
mainfrom
posthog-code/fix-branch-picker-overflow
Apr 28, 2026
Merged

fix(code): prevent branch picker overflow with responsive shrink#1906
VojtechBartos merged 1 commit into
mainfrom
posthog-code/fix-branch-picker-overflow

Conversation

@VojtechBartos
Copy link
Copy Markdown
Member

@VojtechBartos VojtechBartos commented Apr 28, 2026

Problem

Long branch names (e.g. posthog-code/prevent-message-send-during-cloud-run-startup) made the BranchSelector in the task header grow past the toolbar's max-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 underlying Button primitive ships with inline-flex shrink-0 and 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 — overrides shrink-0 so the button is flex-shrinkable.
  • min-w-0 — lets it shrink below content width so the inner truncate span engages.
  • max-w-[250px] — bounds it on wide layouts so it doesn't grow absurdly.

Showcase

Screenshot 2026-04-28 at 13 58 30

Created with PostHog Code

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
@VojtechBartos VojtechBartos self-assigned this Apr 28, 2026
@VojtechBartos VojtechBartos requested a review from a team April 28, 2026 12:00
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Reviews (1): Last reviewed commit: "fix(code): prevent branch picker overflo..." | Re-trigger Greptile

@VojtechBartos VojtechBartos enabled auto-merge (squash) April 28, 2026 12:03
@VojtechBartos VojtechBartos merged commit 783f8af into main Apr 28, 2026
14 of 15 checks passed
@VojtechBartos VojtechBartos deleted the posthog-code/fix-branch-picker-overflow branch April 28, 2026 12:11
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