Repository navigation
Constrain composer banner stacks to prevent horizontal overflow - #2528
Merged
Merged
Conversation
The stack of cards above the composer is a bare `grid gap-2`, which drops every card into an implicit `auto` column. That column's base size is the widest card's min-content width, and `justify-items: stretch` then hands that width to every other card — so one wide card takes the whole stack off-screen with it. The cards themselves are not at fault. A row built as `min-w-0 flex-1 truncate` still reports its full untruncated string as its min-content contribution, because the truncation only bites once the parent hands the row a definite width. Under intrinsic sizing there is no such width, so the guard never engages. `grid-cols-[minmax(0,1fr)]` pins the track to the shell instead. Each card gets a definite width and its own truncation does the rest. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Human comments
What was wrong
A long plugin composer banner can widen the shared grid column above the composer and stretch neighboring cards offscreen. At a 402px mobile viewport, a synthetic routing-rule banner using the normal plugin card wrapper made both itself and the native queue 1,255.84px wide inside a 370px stack. The queue's collapse and message-action buttons moved outside the viewport. The banner already used
min-w-0 flex-1 truncate; the implicitautocolumn still allowed its intrinsic width to determine the track size.A long queued message alone stayed within bounds in our tests on both the original base and current main. The confirmed reproduction is a wide plugin banner affecting the shared stack; this PR does not claim that queued messages alone trigger the issue.
What changed
Constrain all three banner stacks—the follow-up composer, its stack-only variant, and the new-thread composer—to
grid-template-columns: minmax(0, 1fr). A sharedPROMPT_STACK_TRACK_CLASSkeeps their declarations consistent. Cards receive the available stack width, allowing existing text truncation to work and keeping neighboring controls onscreen.How you verified
mainataccd559592before verification.pnpm exec turbo run typecheck test --filter=@bb/app --output-logs=errors-onlypassed: 480 test files, 3,925 tests passed, 4 skipped. The regression test guards the explicit grid declaration; jsdom does not validate layout geometry.pnpm exec oxfmt --checkpassed for all four changed files;git diff --checkpassed.nonereproduced 1,255.84px cards; removing the override restored the fixed layout. Captured before/after screenshots and verified queue collapse, reopen, and the message action menu through browser input.