fix: prevent Stripe checkout popup blocking in default frontend - #6783
fix: prevent Stripe checkout popup blocking in default frontend#6783stone16 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughStripe payment flows now use a shared helper to redirect the active browser tab to Stripe Checkout. The subscription flow displays a redirect notification before navigation. ChangesStripe checkout navigation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
51fdfc5 to
2b6f1df
Compare
Important
📝 变更描述 / Description
Stripe Checkout was opened with
window.open(..., '_blank')only after the asynchronous Checkout Session request completed. At that point browsers such as mobile Safari may no longer consider the call part of the original user gesture and can block the new tab.This change sends both Default UI Stripe entry points—the wallet top-up flow and subscription purchase flow—to Checkout in the active tab. It keeps the fix frontend-only and does not change Stripe customer IDs, database schema, or backend payment behavior.
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
cd web && bun run typecheck— passedcd web && bunx oxlint -c .oxlintrc.json src/features/wallet/hooks/use-payment.ts src/lib/stripe-checkout.ts— passedcd web && bunx oxfmt -c .oxfmtrc.json --check src/features/subscriptions/components/dialogs/subscription-purchase-dialog.tsx src/features/wallet/hooks/use-payment.ts src/lib/stripe-checkout.ts— passedcd web && bun run build— passedRepository-wide baseline checks currently report unrelated pre-existing files:
oxlinton the full subscription dialog: its unchanged EPay list at line 409 triggersunicorn(no-useless-spread)bun run format:check:channel-mutate-drawer.tsx,channel-form.ts,api-key-group-cell.tsx, andredemption-form.tsbun run copyright:check:oauth-callback-mode.ts,channel-field-update.ts, andmodel-categories.tsKnown boundary: this navigation targets the active browsing context. Deployments that intentionally embed the dashboard in a cross-origin iframe should open it as a top-level page before starting Stripe Checkout, because Stripe Checkout cannot render inside that iframe.
Summary by CodeRabbit
New Features
Bug Fixes