Repository navigation
feat(app): offer monthly after leaving yearly checkout - #23950
Merged
Merged
Conversation
The trial paywall preselects Yearly. A reader who opens the yearly Stripe Checkout and comes back without buying now gets one sheet, once per paywall: "Not ready for a year?" with the monthly price from the catalog. The free trial line shows only when the backend says the reader is trial eligible. "Try monthly free" runs the same checkout as the Monthly card. Before the sheet, the page refetches the subscription and offers nothing to a reader who now has a plan. Analytics: Paywall Monthly Fallback Shown, Accepted (after the checkout settles, with its outcome) and Dismissed, all on the PostHog keep-list. The page button now has a minimum height instead of a fixed one, so its label grows at large text sizes instead of clipping.
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.
Draft blocker: the existing catalog does not expose trial duration. This change reuses the yearly paywall's seven-day constant; backend-sourced duration remains required by the brief.
Problem
Yearly is preselected on the trial paywall. Returning from its checkout without buying currently leaves the reader on the same paywall.
Change
Show the approved "Not ready for a year?" sheet once per paywall session after a yearly checkout returns cancelled. Refetch the subscription first; skip the offer for paid or hidden-billing accounts, lost trial eligibility, missing data, failed requests and timeouts. Monthly checkout and failed yearly checkout do not trigger it.
The monthly price comes from the existing catalog object. Trial eligibility comes from the subscription response; duration reuses the yearly paywall's existing
TrialPaywallPage.trialDays(7), so both checkout requests and copy agree. The catalog does not currently expose a trial duration. "Try monthly free" selects Monthly and calls the same checkout helper as the Monthly card. If eligibility is lost while yearly checkout is open, show nothing. Every checkout from this page requires trial eligibility and sends the same seven trial days. There is no full-price fallback path. Not now, scrim, swipe and back dismiss without buying. All 49 locales are translated.Checkout completion
app/lib/pages/settings/payment_webview_page.dart:63recognizes the existing success URL and pops true; cancel/back pop false.app/lib/pages/paywall/paywall_checkout.dart:86awaits that result, and:87treats any non-true result as cancelled.app/lib/pages/paywall/trial_paywall_page.dart:103gates the offer on yearly plus cancelled;:149refetches the server subscription before offering another plan. Stripe webhook persistence remains authoritative. No backend or payment-rail changes.Impact estimate
Owners who pay 32.4% → ~33% (modeled; yearly is preselected and abandoned yearly checkouts get no fallback today; the new Shown/Accepted events will measure it)
The estimate is supplied by the proposal, not an observed experiment result. Shown, Accepted (with checkout outcome) and Dismissed are typed registry events whose names match the existing 100% paywall keep-list.
Money review
Round 1 found a double-subscription risk in the full-price fallback: a completed yearly trial can save its Stripe customer before the subscription row, making a still-basic account lose trial eligibility. This change now suppresses the sheet in that state (
trial_paywall_page.dart:155-161), removes the full-price fallback, and always requeststrial_days: 7(:127). The backend refuses trial requests for existing customers (backend/routers/payment.py:767-769). Its separate active-only duplicate-subscription lookups do not cover trialing subscriptions; this PR does not rely on them and does not change the backend. Independent re-review remains pending. No real purchase was completed; native checks use the loopback Stripe stub without a payment-confirmation control.Evidence
2a592bf296: yearly checkout, then back188754c461: yearly checkout, then back14c889c7a4: basic plan + customer saved during yearly checkoutThe stub recorded
year:26991usd:trial=7thenmonth:2999usd:trial=7. Full local proof:/Users/nik/mobile-ux-agent/runs/2026-10-29/p5/. Video:demo.mp4(20.9 seconds);demo.gifandbefore-after.pngare in the same folder. Those initial captures used source188754c461. Round 1 removes the full-price branch in14c889c7a4; the trial sheet layout is unchanged. Round 1 was rebuilt and exercised on source14c889c7a4in canonical pipeline lanesim.2. Its app/test/changelog sources are identical to the current evidence-only head. The eligible flow still opens monthly checkout with seven trial days. Saving a local customer while the plan remains basic makes the real subscription endpoint returntrial_eligible=false; leaving yearly then shows no sheet, and the next two taps create no checkout. The three stub sessions remain year/month/year, all with seven trial days. Fresh proof:/Users/nik/mobile-ux-agent/runs/2026-10-29/p5/round1/native/(run.json,eligibility-lost.json, both session snapshots and five inspected screenshots). The pipeline shut down the simulator and releasedsim.2.Tests
trial_paywall_monthly_offer_test.dart,trial_paywall_navigation_test.dart,trial_paywall_page_test.dart,value_moment_paywall_test.dart,contextual_plans_fallback_test.dart./Users/nik/mobile-ux-agent/runs/2026-10-29/p5/round1/.scripts/l10n.py check: 49 locales and 4,336 keys; generated output current.make preflight: 27 checks passed in 589 seconds, including UI evidence, mobile UX, UI-isolate, brand, catalog and typed-event registry guards.At ship
Draft only. No merge, release, flag or live-state changes. Preserve #23762's routing/pacing. After approval and release, measure Shown → Accepted → purchased.
Not verified
Product invariants affected
none
Failure class (fixes)
Failure-Class: FC-checkout-falls-through-unverified-subscription
The app now blocks another checkout after trial eligibility is lost, even while the entitlement projection is still basic. The regression test covers that pending-sync state and repeat taps. Backend admission follow-ups remain outside this PR.
UI-Evidence: see the images above (.agent-artifacts/ui-evidence/mux-2026-10-29-yearly-abandon-monthly/)