Skip to content

feat(app): offer monthly after leaving yearly checkout - #23950

Merged
kodjima33 merged 8 commits into
mainfrom
mux/2026-10-29-yearly-abandon-monthly
Nov 5, 2026
Merged

kodjima33 merged 8 commits into
mainfrom
mux/2026-10-29-yearly-abandon-monthly

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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:63 recognizes the existing success URL and pops true; cancel/back pop false. app/lib/pages/paywall/paywall_checkout.dart:86 awaits that result, and :87 treats any non-true result as cancelled. app/lib/pages/paywall/trial_paywall_page.dart:103 gates the offer on yearly plus cancelled; :149 refetches 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 requests trial_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

Before and after
Monthly offer
Monthly checkout
Dark appearance
Third return after Not now
Largest text size; sheet scrolls
German, Japanese, Arabic
Eligibility lost: no monthly offer

Real iPhone simulator check Result
Main 2a592bf296: yearly checkout, then back No offer
Branch source 188754c461: yearly checkout, then back Monthly sheet
Try monthly free Monthly checkout, same price ID, 7-day trial
Not now; second and third yearly returns No repeat; Yearly stays selected
Relaunch and open a new paywall session May offer once again
Light, dark, largest text Offer and monthly handoff exercised
German, Japanese, Arabic Translated sheet captured and inspected
Round 1, source 14c889c7a4: basic plan + customer saved during yearly checkout Trial eligibility becomes false; no sheet
Second and third taps after eligibility loss No checkout; session snapshot unchanged

The stub recorded year:26991usd:trial=7 then month:2999usd:trial=7. Full local proof: /Users/nik/mobile-ux-agent/runs/2026-10-29/p5/. Video: demo.mp4 (20.9 seconds); demo.gif and before-after.png are in the same folder. Those initial captures used source 188754c461. Round 1 removes the full-price branch in 14c889c7a4; the trial sheet layout is unchanged. Round 1 was rebuilt and exercised on source 14c889c7a4 in canonical pipeline lane sim.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 return trial_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 released sim.2.

Tests

  • 37/37 widget tests passed after the round-1 money guard fix, one file at a time, Flutter 3.44.5: 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.
  • The 12 fallback tests passed again after preserving the existing analytics expression; the changed file has no analyzer errors or new hints.
  • Lost-eligibility regression: fails on the prior code because the sheet appears; passes after the guard, including no events or second/third checkout. Logs: /Users/nik/mobile-ux-agent/runs/2026-10-29/p5/round1/.
  • scripts/l10n.py check: 49 locales and 4,336 keys; generated output current.
  • Round-1 make preflight: 27 checks passed in 589 seconds, including UI evidence, mobile UX, UI-isolate, brand, catalog and typed-event registry guards.
  • Main and branch built through the guarded pipeline and exercised headlessly on an owned iPhone 17 Pro simulator. No Mac foreground/cursor use.

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

  • Known requirement gap: trial duration is inherited from the existing seven-day paywall constant, not live plan data. Prices and eligibility are live-backed. Exposing duration from the backend remains required to satisfy that part of the brief.
  • Largest-text BEFORE capture on main. Largest-text AFTER acceptance was exercised.
  • Live payment confirmation, physical-device billing, TestFlight/App Store builds and production analytics delivery. Purchases are deliberately never completed.

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/)

View guided diff Turn on auto-fix

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.
@kodjima33 kodjima33 added the mux-proposal Mobile UX improver (MUX) proposal; waits for Nik's ship label Oct 29, 2026
@kodjima33
kodjima33 marked this pull request as ready for review November 5, 2026 03:20
@kodjima33
kodjima33 merged commit ffa16cf into main Nov 5, 2026
48 checks passed
@kodjima33
kodjima33 deleted the mux/2026-10-29-yearly-abandon-monthly branch November 5, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mux-proposal Mobile UX improver (MUX) proposal; waits for Nik's ship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant