Repository navigation
fix(billing): display the true name of each subscription tier - #21313
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
With the checked-in backend defaults, wire_plan_for_client still maps both plus and unlimited_v2 subscriptions to unlimited for every current mobile version because the capability floor remains 99.0.0. Deriving the label only from response.subscription.plan therefore shows existing Plus and Unlimited subscribers as Neo in the settings row and in plan-change confirmations. Resolve the owning catalog plan through current_price_id before falling back to the remapped wire identity.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const operator = | ||
| catalog.find((p) => p.id === 'operator' || p.title === 'Operator') ?? catalog[0] | ||
| catalog.find((p) => p.id === 'operator') ?? catalog[0] |
There was a problem hiding this comment.
Canonicalize names in the Windows purchase grid
Matching the Operator card by ID fixes this jump target, but the same catalog is passed unchanged to PlanGrid, where both the heading and selection button render plan.title. Because the backend deliberately keeps that wire title as Operator for released macOS compatibility, Windows still offers an “Operator” card while its banner and current-plan card say “Pro”; derive the purchase-card label from plan.id without changing the compatibility title.
Useful? React with 👍 / 👎.
| message: | ||
| '${currentPlanDisplayName(context, provider.subscription)} → ${planDisplayName(PlanType.fromWire(targetPlan), plans, l10n)} (${selectedPrice.title})', |
There was a problem hiding this comment.
Localize the plan-change message
For every non-English locale, this replaces the existing translated planSwitchingDescriptionWithTitle message with hard-coded punctuation and an English billing interval such as Monthly, so the confirmation dialog becomes partially English. Add a localized template that accepts the source tier, target tier, and interval instead of interpolating the complete user-facing sentence here.
AGENTS.md reference: app/AGENTS.md:L116-L120
Useful? React with 👍 / 👎.
| subscription.deprecationMessage | ||
| ?? "Your Unlimited plan is being retired. Try the new Operator plan — same great features at \(operatorDeprecationFallbackPrice)." | ||
| ?? "Your Unlimited plan is being retired. Try the new Pro plan — same great features at \(operatorDeprecationFallbackPrice)." |
There was a problem hiding this comment.
Normalize legacy deprecation messages before display
When deprecationMessage is populated, this ?? expression always prefers the server text, so the newly corrected Pro fallback is never used. The supported decoder input still includes legacy copy such as “Try the Operator plan,” meaning subscriptions carrying that persisted message continue to show the retired name on macOS; Windows applies the same precedence. Normalize the legacy server copy or migrate it at the backend instead of updating only the nil fallback.
Useful? React with 👍 / 👎.
| case .operator: | ||
| return "Operator" | ||
| return "Pro" |
There was a problem hiding this comment.
Rename the remaining macOS Operator copy
The canonical name is updated here, but other user-facing macOS surfaces for the same operator entitlement still say “Operator”: ReferralProgramView.swift advertises “one free month of Operator,” and SettingsSidebar.swift offers “Buy Operator or Architect” and “Share one free month of Operator.” Users therefore see the retired name immediately outside the billing card; update those referral and settings-search strings in the same rename.
Useful? React with 👍 / 👎.
What changed and why
Display the canonical subscription names: Free, Plus, Pro (
operator), Architect, Neo (unlimited), and Unlimited (unlimited_v2). Settings no longer calls every paying mobile subscriber Pro, and plan-change confirmation names both tiers. Keep prices, entitlement fields, storefront filters and thepro→ Architect wire alias unchanged.Preserve
Operatorin backend paid-plan definitions: released macOS builds infer fallback price ownership from titles and mapPro Monthly/Pro Annualto Architect. Their merger would attach Operator prices to Architect. This compatibility carrier stays unchanged for every client; no version floor is raised without shipped-client evidence. The current macOS client takes card headings, selection labels and billing details from canonical plan IDs, so the retained wire title displays as Pro. Windows billing subtitles also use the owning plan ID. Fix legacyUnlimited Plan Monthly/Annualparsing, the Windows title fallback, and web referral copy.Current main already has lossless unknown-plan decoders in all four clients (#11979); this PR preserves those contracts. The remap floors are a separate follow-up.
Product invariants affected
none
How it was verified
BACKEND_PYTEST_MARK_EXPR='not integration' BACKEND_UNIT_TEST_FILE_LIST=/private/tmp/omi-w1-names-focused.list bash backend/test.sh: 89 passed across catalog, subscription and restructure suites. Both wire-title intervals are covered; canonical catalog display name remains Pro.bun run checkpassed typecheck and 655 Vitest tests in 122 files.pnpm@10 test: 5,577 passed, 33 skipped (553 passing files, 6 skipped). Focused billing and plan-usage tests: 71 passed.xcrun swift test --package-path desktop/macos/Desktop --filter 'SubscriptionInfoDecoderTests|SubscriptionPlanNamesTests|SubscriptionPlanCatalogMergerTests|SubscriptionPlanPresentationTests': 16 XCTest tests passed.swift buildalone does not execute Tests.Tests
Regression coverage keeps monthly/annual Operator fallback prices off Architect, verifies ID-derived macOS titles despite stale server names, and covers monthly/annual legacy title parsing. Windows subtitle regression uses stale Architect and Operator titles. Existing decoder suites retain unknown IDs without granting paid capability.
UI evidence
UI-Evidence: none -- Hermetic plan presentation tested; live authenticated UI was not exercised. Review visual presentation before release.
Failure class
Failure-Class: none
Risks for reviewers
Follow-up integration
The coordinator clarified that LLM-only BYOK must preserve its synthetic Neo feature identity while transcription budgets come from enforcement. #21315 implements that projection; #21314 tests/renders the corrected meter. This name-only draft preserves identity and access semantics. Merge order: #21313, #21315, #21314. All drafts remain unmerged.
Post-refresh main merge parent: c545d6a. Fresh CI is observed separately after push.