fix(dashboard): truncate long checkout URL from the start - #2344
Merged
Conversation
Button wraps children in an unconstrained inline-flex span, so the long checkout URL sized that wrapper past the button and got clipped on both ends by justify-center, hiding the start of the URL. Constrain the wrapper from the call site so the URL can shrink, and left-align it so the ellipsis lands at the end.
charlietlamb
force-pushed
the
charlie/fix-checkout-url-truncation
branch
from
July 22, 2026 09:44
04ef5ef to
d6763a0
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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
In the "Checkout URL Generated" view, the checkout URL was clipped on both ends — the start (
https://checkout.stripe.com/...) was cut off, with no trailing ellipsis.Root cause
CopyButtonalready passestruncateandmin-w-0 flex-1, so it looked like it should truncate.The actual constraint is one layer up:
Buttonwraps all children in a hardcoded<span className="inline-flex items-center gap-2">with no width limit. That wrapper sized itself to the full URL (~1777px), overflowed the 406px button, and — because the button isjustify-center— got clipped symmetrically, hiding the start.Fix
Scoped entirely to the call site:
[&>span]:min-w-0 [&>span]:max-w-fullconstrains the Button's child wrapper so the truncating child can shrink.text-leftputs the ellipsis at the end instead of centering the text.Why not fix
ButtonitselfAn earlier revision added
min-w-0 max-w-fullto the wrapper inpackages/ui/.../button.tsx. That works, but it changes every button in the app for one call site's problem, so it was dropped in favour of the call-site variant. Measured results are identical.For the record, I also verified that the simpler options do not work —
min-w-0,overflow-hidden, and both together on the button's ownclassNameall leave the wrapper at 1776.8px with the URL start still off-screen, becauseoverflow-hiddenhides the overflow without making the text truncate.Verification
Measured on the real component with
button.tsxuntouched:Renders as
https://checkout.stripe.com/c/pay/cs_test_a1J2Rpdm…