Pin the composer prompt stack to a single-column grid track so one wide card stops dragging the rest off-screen - #2528
Open
vburojevic wants to merge 1 commit into
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) <noreply@anthropic.com>
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.
What was wrong
The stack of cards above the composer is laid out as a bare
grid gap-2(FollowUpPromptBox.tsx:861), so every card lands in an implicitautocolumn. Anautocolumn's base size is the widest item's min-content width, andjustify-items: stretchthen hands that width to every other card. One wide card therefore takes the entire stack off-screen with it — on a phone, all of it.The cards are not at fault. A row built as
min-w-0 flex-1 truncatestill reports its full untruncated string as its min-content contribution, becausewhite-space: nowrapmakes min-content equal max-content and 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.Measured on a real thread at a 402px viewport, before the change — container 370px, every card 1354px:
Queued messagesandBackground commandsare first-party cards, both over the 370px budget on their own, so this reproduces with no plugins installed at all. The plugin banners are along for the ride.What changed
banner/PromptStackCard.tsx— new exportedPROMPT_STACK_TRACK_CLASS(grid-cols-[minmax(0,1fr)]), with the reasoning above recorded next to it. It sits with the other stack chrome constants since it describes the track those cards are laid on.FollowUpPromptBox.tsx— applied to both banner stacks (the composer stack at :861 and the stack-only variant at :280).NewThreadPromptBox.tsx— applied to the new-thread banner stack, which has the same shape.No behavior change beyond the track: cards are now handed a definite width, and each one's existing truncation does the rest. No wire, CLI, or doc surface is touched.
How you verified
FollowUpPromptBox.test.tsxasserts the banner stack carries an explicit single-column track. Fails before (expected 'grid gap-2' to contain 'grid-cols-[minmax(0,1fr)]'), passes after. jsdom has no layout engine, so the test guards the declaration; the geometry was verified in a real browser, below.Xcode activityandRouting ruletext running past the viewport edge with no ellipsis. After injectinggrid-template-columns: minmax(0, 1fr): every card 370px, right edge at 386px, and each card's own truncation engages (Building Argus · Argus iPhone · iOS latest · m… 54s).pnpm exec turbo run typecheck --filter=@bb/app— clean.pnpm exec turbo run test --filter=@bb/app— 431 files, 3358 passed, 3 skipped.oxfmt --check— clean on all four files.