fix(antigravity): display userTier.name instead of planInfo for plan display#303
fix(antigravity): display userTier.name instead of planInfo for plan display#303zacklavin11 wants to merge 1 commit intosteipete:mainfrom
Conversation
…display Fixes steipete#216 The Antigravity API returns two plan identifiers: - planInfo.planName: Shows "Pro" for all paid users - userTier.name: Shows actual tier ("Google AI Ultra") This change prefers userTier.name when available, falling back to planInfo.preferredName for backwards compatibility.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9e5e5158b
ℹ️ 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".
| // Prefer userTier.name (actual subscription tier) over planInfo (shows "Pro" for Ultra users) | ||
| let planName = userStatus.userTier?.name ?? userStatus.planStatus?.planInfo?.preferredName |
There was a problem hiding this comment.
Fall back when userTier.name is empty
The new userTier?.name ?? planInfo?.preferredName only falls back when name is nil, not when it is an empty/whitespace string. If the API includes a userTier object but its name is blank (e.g., for an unassigned tier), the UI will now hide the plan entirely because loginMethod becomes "" and downstream views treat empty strings as “no plan”. Consider trimming/validating userTier.name before deciding it beats planInfo.preferredName so a real plan still shows up in that case.
Useful? React with 👍 / 👎.
Summary
Fixes #216
The Antigravity API returns two plan identifiers:
planInfo.planName: Shows "Pro" for all paid usersuserTier.name: Shows actual subscription tier (e.g., "Google AI Ultra")This change prefers
userTier.namewhen available, falling back toplanInfo.preferredNamefor backwards compatibility.Changes
UserTierstruct to parse theuserTierfield from the API responseuserTier.nameoverplanInfo.preferredNameTesting
userTierin their response will still fall back toplanInfo