Repository navigation
fix(templates): shrink long prices in Ticket CTA and Pricing Highlight - #310
Merged
Merged
Conversation
anurag629
approved these changes
Oct 28, 2026
anurag629
left a comment
Member
There was a problem hiding this comment.
Thanks @prakashNalla. Check (0 errors), all 1550 tests and the build pass on top of dev, and the renders hold up: $1,299.00 now sits inside the ticket's price column and next to "/month" without touching it, $12,999.99 /year fits, a 24-character ticket price wraps neatly inside its column, and both defaults render pixel for pixel the same as the live site.
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.
Description
Ticket CTA and Pricing Highlight drew the price at a fixed size (64px and 56px), so a longer price like
$1,299.00ran over the dashed separator and up to the card edge in Ticket CTA, and into "/month" in Pricing Highlight. Both now size the price withautoFontSize()the same way they already size the title, and truncate it as a last step (24 characters in Ticket CTA, 12 in Pricing Highlight). The default prices ($99,$29) keep their current size, so the defaults look the same.In Pricing Highlight the price span also gets
flexShrink: 0. Before, when the price and the period didn't fit, flexbox squeezed the price box and the text drew over "/month". Now the font size keeps the pair inside the card.Closes #308
How I Tested This
Added
tests/templates/ticket-cta.test.tsandtests/templates/pricing-highlight.test.ts. They render with satori and the bundled Inter fonts and check the layout:$1,299.00,$12,499.99andFrom $149 / personstay inside the price column (between the separator and the card's padding), the default stays at 64px, and a 40 character price is truncated$1,299.00,$12,499.99and$1,234,567.89keep "/month" after the price and inside the card, and the default stays at 56px8 of the 9 tests fail without the template changes. Rendered the before images on the live site and the after images through
/api/ogonnpm run dev, screenshots below.npm run check: 0 errors, 0 warnings.npm run test: 80 files, 1549 of 1550 tests pass. The one failure is the existingagenda.test.ts"renders valid SVG and PNG for 2, 3, and 4 sessions" hitting the 5000ms timeout on my machine; it passes with--testTimeout=30000and this change doesn't touch it.npm run build: passes.AI Assistance
Claude helped me w/ understand the issue
Type of Change
Screenshots
Ticket CTA with
price=$1,299.00, before (live site):Ticket CTA with
price=$1,299.00, after:<img width="600"alt="2-ticket-after" src="https://github.com/user-attachments/assets/82040d96-6847-48ec-b6d9-6e911dd7b744" />
Pricing Highlight with
price=$1,299.00, before (live site):Pricing Highlight with
price=$1,299.00, after:Ticket CTA with the default price, after (unchanged):
Pricing Highlight with the default price, after (unchanged):
Checklist
devnpm run checkpassesnpm run testpassesnpm run dev