Repository navigation
fix(app): let the plans sheet select the plan the user already has - #20474
Merged
Merged
Conversation
Mirrors debugSetSubscription so the plans sheet can be driven without a network fetch.
The card for the user's current (or scheduled) price swallowed taps, so selecting a different tier under one billing period and switching to the other left that tier highlighted: the current plan's card there could not be selected back. For example, an Unlimited monthly user who picked Plus under Yearly could not select Unlimited under Monthly without going back to Yearly first. Every card now selects. The no-op tap was what stopped an "upgrade" onto the price already paid; that now lives in shouldShowPlanContinueButton, which hides Continue when the selected tier and period is an active price. Same tier on the other period still shows Continue (monthly -> annual). Verification: - flutter test test/widgets/plans_sheet_selection_test.dart: passes; it fails without the fix at the Unlimited-under-Monthly tap. - flutter test test/utils/plan_pricing_test.dart, test/widgets/usage_page_redesign_test.dart, test/providers/usage_provider_test.dart: all pass. - flutter analyze on the changed files: no issues. Failure-Class: none
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
mdmohsin7
added a commit
that referenced
this pull request
Oct 3, 2026
…0476) ## Summary `main` fails **Dart Analyze & Tests** at 8fb7dc1, so every app PR is red. The analyzer ratchet reports an error-severity diagnostic: ``` RETURN_OF_INVALID_TYPE_FROM_CLOSURE app/test/widgets/capturing_finish_swipe_back_test.dart:120 The returned type 'List<dynamic>' isn't returnable from a 'Future<PeopleListResponse?>' function ``` Two changes collided without a textual conflict: - 677ee83 ("retain known People stats when scans are truncated") changed `PeopleProvider.loadPeople` to return `Future<PeopleListResponse?>`. - f0f2790 (#20375) added this test, which passes `() async => []`. Each was green on its own branch. ## Change The test passes `const PeopleListResponse(people: [])`, the same shape the other People tests use. This is a test-only change; no app code changes. ## Product invariants affected none ## Verification - `flutter analyze` over the whole app: 0 errors. - `flutter test test/widgets/capturing_finish_swipe_back_test.dart`: 2 tests pass. - Seen failing on PR #20474's run 37137363033 (job 111244602814). 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/20476?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
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.
Summary
On the plans sheet, the card for the user's current price ignored taps. So after picking a different tier under one billing period and switching to the other, the user couldn't select their current plan there.
Example: an Unlimited monthly subscriber picks Plus under Yearly, then switches to Monthly. Tapping Unlimited does nothing, and Plus stays highlighted. The only way back was to switch to Yearly, pick Unlimited there, and switch to Monthly again.
The cause is
onTap: isActive ? () {} : onTapin_buildDynamicPlanOption. The backend marks a priceis_activewhen it is the subscription's current price or its scheduled one (backend/routers/payment.py). This tap guard dates back to 5897725 (Aug 2025), so it isn't from the recent UX work.Change
plans_sheet.dart: every plan card can be selected, including the active price.shouldShowPlanContinueButton, which takes a newselectedPriceIsCurrentand hides Continue when the selected tier and billing period is an active price. The same tier on the other period still shows Continue, so a monthly user can still switch to annual.UsageProvider.debugSetAvailablePlans: a@visibleForTestinghook, next to the existingdebugSetSubscription, so the sheet can be tested without a network fetch.Product invariants affected
none
Failure class
Failure-Class: none
This is a single-widget affordance bug. None of the suggested classes describe it.
Verification
New
test/widgets/plans_sheet_selection_test.dart, using an account on Unlimited monthly:It passes with the fix. Without the fix it fails at step 3, the Unlimited tap under Monthly.
test/utils/plan_pricing_test.darthas a new case forselectedPriceIsCurrent. It passes, along withtest/widgets/usage_page_redesign_test.dartandtest/providers/usage_provider_test.dart.flutter analyzeon the changed files: no issues.scripts/pr-preflight --pr-body-file <this body>: passes.Not yet checked on a device.
🤖 Generated with Claude Code