Skip to content

fix(mobile): restore a removed language on Starter instead of a dead end; Tell me survives a reload (M-05, M-15) - #140

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

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

Conversation

@navidshad

Copy link
Copy Markdown
Contributor

What

Follows server #138.

  • Never stuck on first run. On Starter, a removed language keeps its place for 30 days, so adding any other language returns upgrade_needed. A Starter learner who removed their only language lands on first run. There, and in Add a language, the switcher and Languages, the plan card now reads "Starter includes 1 language, and your German is kept until 14 November…". It offers Restore German first (add-language brings the language and its data back) and See plans second. The language grid is hidden then, because any other choice would be refused.
  • LanguageState.slotsUsed counts removed languages on Starter only, which matches the server. "x of y used" uses it.
  • Tell me survives a reload: get-language-state now returns interests, and Add a language shows "Got it" for them.
  • Coming later: Portuguese comes from the capabilities with enabled: false and is listed there (already handled; now covered by a test).
  • Fake server: returns interests, and holds a removed language's place on Starter, so only a restore gets in.

Tests

  • flutter test (app) 92 pass. New tests cover:
    • a first run after removing the only language: Restore → German Today;
    • a stale phone state that reloads into the Restore card;
    • Tell me remembered from interests, Portuguese under Coming later, and undo;
    • the Starter-only place rule.
  • dart test (api) 64 pass, now also reading interests and checking slotsUsed.
  • flutter analyze clean.

🤖 Generated with Claude Code

…it from first run; Tell me survives a reload

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

Copy link
Copy Markdown

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

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