Skip to content

A sale in the Plus gate sheet lands on the welcome, which returns to the lock - #598

Merged
maximsan merged 2 commits into
mainfrom
feat/gate-purchase-welcome
Sep 12, 2026
Merged

maximsan merged 2 commits into
mainfrom
feat/gate-purchase-welcome

Conversation

@maximsan

Copy link
Copy Markdown
Owner

Why

A purchase made in the Plus gate sheet stayed on the sheet, so a learner who
bought from a lock never saw the celebration every paywall sale lands on.
Closes #576.

Watch for

  • Where Back to learning goes. The gate passes the location the lock was
    raised on, per the issue's the gate passes the raising screen. Buying at a
    locked Path row therefore returns to the Path with that row open — not into
    the lesson.
  • The return destination rides on the welcome's URL (?from=), not in
    extra, because go_router rebuilds a top-level route from its location
    alone. Only a location starting with a single / is taken; anything else
    falls back to Learn.
  • GoRouter.maybeOf, not of. Eleven existing tests pump one gated
    screen with no router over it. A sheet raised outside the router sells and
    closes and has nowhere to celebrate, which is the only thing missing there.
  • The intro's offer passes no destination and keeps the route's Learn default,
    rather than naming Learn explicitly as the issue's interface sketch does.
    Same behaviour, one less redundant query parameter.

Not here

Nothing deferred.

Checks

Driven on the iPhone 16 Pro simulator against the real app and router: locked
Path row → gate sheet → buy → welcome → Back to learning → the Path row, open.
Screenshot reviewed and discarded.

…ns to the lock

The sheet every in-app lock raises sold directly and stayed open after a
purchase, showing its outcome line, so a learner who bought from a lock never
saw the celebration the intro's offer already lands on.

A buy that reaches `owned` now closes the sheet and opens the welcome once; a
restore closes it in place, with no celebration. The buy/restore split the
paywall screen kept privately moves to `PurchaseExit`, which both surfaces
share, so they cannot draw the line differently.

The welcome's return destination is a parameter on its own URL: the gate passes
the location the lock was raised on, the intro's offer passes nothing and keeps
going to Learn. Only an in-app location is taken from the URL.

Closes #576
`GoRouter.of` threw in eleven existing tests that pump one gated screen on its
own — the dictionary entry, the flashcard deck, the vocab drill and Today's
card all open the sheet without the app's router over them. The lookup is now
`maybeOf`: a sheet raised outside the router still sells and closes, and has
nowhere to celebrate, which is the only thing missing there.

Also from review: `PurchaseExit` gets the unit tests it was missing, the three
copies of the bounded pump loop become `pumpWithoutSettling` in the shared
harness, and two doc comments drop the argument that belongs in #576.
@maximsan
maximsan merged commit 6a5082e into main Sep 12, 2026
7 checks passed
@maximsan
maximsan deleted the feat/gate-purchase-welcome branch September 12, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A purchase from the Plus gate sheet lands on the Plus welcome, and Back to learning returns to the lock

1 participant