fix(membership): reconcile checkout price/badge + fix mobile overflow#412
Merged
Conversation
…verflow Priority 1 — price/badge correctness: - /api/membership/apply-promo now stacks the 5% BTC discount on the promo-adjusted price and converts to sats with the SAME pipeline as create-lightning-invoice. It returns discountedUsd, amountSats, btcPrice, and totalDiscountPercent (combined promo + BTC discount off list). - Cook+, Pro Kitchen, Genesis checkout cards now bind USD, sats, AND the discount badge to a single source of truth (discountedUsdAmount / amountSats / discountPercent). Applying a code rewrites all three from the apply-promo response; clearing re-fetches the base 5% quote. The badge can no longer say "5% OFF" while the price reflects a stacked promo. - proceedWithLightning() console.warns if the invoice's amountSats differs from the previewed sats (e.g. BTC spot drift between preview and invoice). Priority 2 — mobile overflow (320/375/414px): - .checkout-card: box-sizing: border-box + width/max-width 100% so padding and border-image count toward width and never push past the screen edge. - .promo-input: min-width: 0 so the flex input can shrink below its placeholder. - .promo-apply: flex-shrink: 0 so the Apply button keeps size and stays on-screen. - .payment-provider: drop the 2.25rem indent at <=480px so the sats amount stays on one line. - .discount-badge: moved next to the price (inside .usd-pricing, flex-wrap) and dropped margin-left:auto so it no longer floats onto its own line. - Reduce .checkout-page / .checkout-card padding at <=480px. Stripe path and server-side promo validation untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying frontend with
|
| Latest commit: |
e7faf57
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6c80a5ee.frontend-hvd.pages.dev |
| Branch Preview URL: | https://fix-membership-checkout-mobi.frontend-hvd.pages.dev |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
zapcooking-frontend | e7faf57 | Jun 01 2026, 08:29 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
frontend | e7faf57 | Jun 01 2026, 08:32 PM |
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
Lands the membership-checkout fix that was authored alongside the promo engine but did not make it into
main— PR #408 merged only the engine commit (32eeee4), leaving the follow-up fix (afe815b) stranded on the old branch. This cherry-picks it cleanly onto currentmain.So in production today, the membership Lightning checkouts still have both the mobile overflow and the price/badge mismatch. This fixes both.
Priority 1 — price/badge correctness
/api/membership/apply-promonow stacks the 5% BTC discount on the promo-adjusted price and converts to sats with the same pipeline ascreate-lightning-invoice, returningdiscountedUsd,amountSats,btcPrice, andtotalDiscountPercent.proceedWithLightning()warns if the invoice'samountSatsdiffers from the previewed sats.Priority 2 — mobile overflow (320 / 375 / 414px)
.checkout-card:box-sizing: border-box+width/max-width: 100%so padding and the border-image gradient can't bleed past the screen edge..promo-input:min-width: 0so the flex input can shrink..promo-apply:flex-shrink: 0so the Apply button keeps its size and stays on-screen..payment-provider: drop the indent at ≤480px so the sats amount stays on one line..discount-badge: moved inline with the price (inside.usd-pricing,flex-wrap), droppedmargin-left: auto..checkout-page/.checkout-cardpadding at ≤480px.Stripe path and server-side promo validation untouched.
Verification
pnpm test— 151/151 pass.pnpm check— the 4 changed files (3 checkout pages +apply-promo) introduce 0 errors. There are 9 pre-existingsvelte-checkerrors onmain, all in the Branta SDK v3 files (brantaService.server.ts/api/branta/register) — unrelated to this change and fixed separately in fix(branta): align brantaService with Branta SDK v3 types #410.🤖 Generated with Claude Code