fix(docs): stop the vendor-official badge clipping adapter card titles - #893
Closed
aldosch wants to merge 2 commits into
Closed
fix(docs): stop the vendor-official badge clipping adapter card titles#893aldosch wants to merge 2 commits into
aldosch wants to merge 2 commits into
Conversation
The Geist breakpoints geistdocs ships put `sm` at 401px, so the adapters grid goes two-up on every modern phone and each card is only ~175px wide. The card header row was a non-wrapping `justify-between` flex row, so the 115px `Vendor official` badge — `whitespace-nowrap shrink-0` — took nearly the whole row: the title's flex item was squeezed below its own text width (a global `min-width: 0` reset defeats the automatic minimum size), the name spilled out under the opaque badge, and the card's `overflow-hidden` cut off whatever was left. "Liveblocks" rendered as "Liveblo", and the badge itself ran ~16px past the card edge. Let the header row wrap so the badge drops onto its own line when there is no room beside the title, and keep the pieces from being squeezed: - `flex-wrap` plus `gap-x-3 gap-y-2` on the row. With `justify-between` the badge still sits right-aligned beside the title whenever it fits, so the two- and three-column layouts are unchanged. - `shrink-0` on `CardAction` — the `Badge` already had it, but its wrapper did not, so the wrapper was shrinking to a smaller box than its content. - `min-w-0` plus `break-words` on the title, so a long single-word name breaks instead of spilling. - `shrink-0` on the platform logo, which was being squashed out of square on narrow cards (the Microsoft Teams mark rendered 12x20 instead of 20x20). Verified in a browser at 320-1440px: no row overflow, no title spill, no squashed logos, and desktop layout byte-for-byte unchanged. Signed-off-by: aldo <5773006+aldosch@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: aldo <5773006+aldosch@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
…-driven The previous commit let the card header row wrap, which fixed the clipping but made placement depend on each card's title length: with a 44px `Beta` badge, `Slack` (42px) and `Discord` (57px) still fit inline while `Google Chat` (93px) and `Microsoft Teams` (124px) pushed the badge onto the next line. Between roughly 430px and 560px — iPhone Pro Max width — a single grid row therefore showed both placements side by side. Wrapping is content-driven by definition, so replace it with a breakpoint switch. Below `md` (601px in the Geist scale) the header stacks: title, then badge on its own line, left-aligned, for every card. At `md` and up every card puts the badge inline to the right. Whether a badge fits is now a property of the layout, not of the name next to it. `md` is where the narrowest card can hold the widest badge with room to spare: the two-column band starts at 401px with ~123px of row width — less than the 115px `Vendor official` badge plus a gap — while at 601px the row is ~228px. Above `md` the title still wraps within its own flex item if it is long, so the badge keeps its position instead of being pushed out. Measured across 320-1440px: badge placement mode is uniform at every width (no width mixes inline and stacked), and the badge sits exactly 25px from the card edge in all 32 cards at all 22 widths sampled. Signed-off-by: aldo <5773006+aldosch@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: aldo <5773006+aldosch@users.noreply.github.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.

Summary
On phones the
Vendor officialbadge on the adapters listing sat on top of the card title and cut it off —Liveblocksrendered asLiveblo,SendblueasSendb,AgentPhoneasAgentP— and the badge itself ran past the card's right edge.Root cause is a size collision, not a z-index or spacing issue:
@vercel/geistdocs' Geist breakpoints putsmat 401px, not 640px, sogrid gap-4 sm:grid-cols-2goes two-up on every modern phone (Pixel 7 = 412px, iPhone 16 Pro Max = 430px). Each card is then ~175px wide, leaving ~125px of content width insidep-6.Vendor officialbadge is 115px and, viabadgeVariants,whitespace-nowrap shrink-0— so it claimed almost the entire row.justify-betweenflex row, and the docs CSS applies a globalmin-width: 0reset, which defeats flexbox's automatic minimum size. The title's flex item was squeezed to 51px while its text needed 80px, so the name spilled to the right underneath the opaque badge andoverflow-hiddenon theCardclipped the remainder.Approach
The header row now switches placement on the breakpoint, not on the title:
md(601px) the header stacks — title, then badge on its own line, left-aligned — for every card.mdand above every card puts the badge inline to the right, exactly as it does today.mdis the point where the narrowest card can hold the widest badge with room to spare. The two-column band opens at 401px with only ~123px of row width, less than the 115pxVendor officialbadge plus a gap; by 601px the row is ~228px. Abovemda long title wraps within its own flex item rather than pushing the badge out, so the badge keeps its position.Supporting changes in the same row:
shrink-0onCardAction. TheBadgealready had it, but its wrapper did not, so the wrapper was shrinking to a smaller box than its own content.min-w-0+break-wordson the title, so a long single-word name breaks rather than spilling.shrink-0on the platform logo, which was being squashed out of square on narrow cards — the Microsoft Teams mark rendered 12x20 instead of 20x20, and Google Chat 14.5x20.One file, five class-list changes; no data, copy, or component-API changes.
Why not
flex-wrap(the first commit in this PR)Letting the row wrap fixes the clipping, but wrapping is content-driven: with the 44px
Betabadge,Slack(42px) andDiscord(57px) still fit inline whileGoogle Chat(93px) andMicrosoft Teams(124px) pushed the badge to the next line. Between ~430px and ~560px a single grid row showed both placements side by side. The second commit replaces it with the breakpoint switch above.Test plan
Ran
pnpm --filter docs devand measured/adaptersin a real browser at 320, 360, 375, 390, 400, 401, 412, 430, 470, 500, 560, 600, 601, 640, 700, 768, 900, 960, 961, 1024, 1280 and 1440px, asserting per card that placement mode is uniform across the page, the badge sits a constant distance from the card edge, the header row does not overflow, the title does not spill, the badge stays inside the card's content box, and every logo renders 20x20.mainflex-wrap(1st commit)Also confirmed visually at 430px (uniform stacked badges where the mixed placement was reported), 640px (uniform inline badges, including the one title that wraps to two lines) and 1440px (three-column layout unchanged from
main), plus on the PR's own preview deployment.One known sub-pixel residual: at exactly 401px — the two-column breakpoint boundary, where cards are 169px —
PostgreSQLplus its 20px logo needs 0.89px more than the row, so the final glyph loses under a pixel tooverflow-hidden.wrap-anywhereremoves it but renders the name asPostgreSQ/L, which is a worse outcome for an invisible gain, sobreak-wordsis kept.Also ran
npx ultracite check apps/docs/app(clean) andtsc --noEmitforapps/docs(clean).Checklist
git commit -s)pnpm validatepasses — not run in full; it builds every package and needs adapter credentials. Ran the parts that cover this change:ultracite check apps/docs/appandtsc --noEmitinapps/docs, both clean.apps/docsis private and CONTRIBUTING lists documentation changes as not needing one.Note
The commits are GPG-verified, but they were authored through a Vercel Devbox, so the author identity is
vercel[bot]withSigned-off-by/Co-Authored-Bytrailers for @aldosch. If the DCO check wants the sign-off to match the author line, say so and I'll push a remediation commit (allowRemediationCommits.individualis enabled).