Skip to content

fix(frontend): Starter learners who removed their language can restore it from first run (D-07, D-20, D-25) - #141

Merged
navidshad merged 1 commit into
devfrom
ml/e2e-starter-restore
Oct 16, 2026
Merged

navidshad merged 1 commit into
devfrom
ml/e2e-starter-restore

Conversation

@navidshad

Copy link
Copy Markdown
Contributor

What

Follow-up to #139, for the server change in #138: on Starter a removed language keeps its place for 30 days, so a Starter learner who removes their only language lands on first run, and adding any other language returns upgrade_needed. Before this PR the learner was stuck: first run hid the limit card, the add failed, and "See plans" bounced back to first run.

  • Store: heldSlots (Starter only, removed and before purgeAt), canAdd counts it, new canRestore and restorable.
  • Add a language and first run: the upgrade card ("Starter includes 1 language") with a "Restore German" row (kept until the purge date, level kept) and See plans. An unexpected upgrade_needed also shows the card instead of looping on step 1. "Back to Today" is hidden in first run, since Today sends the learner back.
  • First-run gate: /settings/subscription is allowed, so See plans works.
  • Chat test: upgrade_needed returns to the steps and keeps first run.
  • Languages: "Add it back" shows whenever there is a free active place (it no longer hides behind the held place).

Item 5 of #139 already reads interests and the enabled: false Portuguese row; #138's shapes match.

How it was tested

  • Vitest: held place, restore allowed, purge date frees it, other plans free it at once (128 tests pass).
  • Playwright (chromium and Mobile Chrome, 82 pass): Starter first run shows the card and no Back to Today, Restore German re-adds German with its level and lands on Today; See plans opens the plans page in first run; an upgrade_needed answer in first run shows the card; Languages "Add it back" on Starter.

🤖 Generated with Claude Code

…e it from first run (D-07, D-20, D-25)

On Starter a removed language holds its place for 30 days (server #138), so adding
another language returns upgrade_needed. The client now knows this:

- The store counts the held place (heldSlots) and exposes canRestore and restorable.
- Add a language, first run included, shows the upgrade card with "Restore German"
  (kept until the purge date) and See plans; an unexpected upgrade_needed also shows
  the card instead of looping on step 1. "Back to Today" is hidden in first run.
- The plans page is open during first run, so See plans no longer bounces back.
- The chat test sends upgrade_needed back to the steps, keeping first run.
- Languages offers "Add it back" whenever there is a free active place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@navidshad
navidshad merged commit c50e326 into dev Oct 16, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0-dev.32 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant