Skip to content

fix(antigravity): display userTier.name instead of planInfo for plan display#303

Open
zacklavin11 wants to merge 1 commit intosteipete:mainfrom
zacklavin11:fix/antigravity-ultra-tier-display
Open

fix(antigravity): display userTier.name instead of planInfo for plan display#303
zacklavin11 wants to merge 1 commit intosteipete:mainfrom
zacklavin11:fix/antigravity-ultra-tier-display

Conversation

@zacklavin11
Copy link

Summary

Fixes #216

The Antigravity API returns two plan identifiers:

  • planInfo.planName: Shows "Pro" for all paid users
  • userTier.name: Shows actual subscription tier (e.g., "Google AI Ultra")

This change prefers userTier.name when available, falling back to planInfo.preferredName for backwards compatibility.

Changes

  1. Added UserTier struct to parse the userTier field from the API response
  2. Updated plan name logic to prefer userTier.name over planInfo.preferredName

Testing

  • Users on Google AI Ultra will now see "Google AI Ultra" instead of "Pro"
  • Users without userTier in their response will still fall back to planInfo

…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.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +231 to +232
// Prefer userTier.name (actual subscription tier) over planInfo (shows "Pro" for Ultra users)
let planName = userStatus.userTier?.name ?? userStatus.planStatus?.planInfo?.preferredName

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Antigravity: Display userTier.name instead of planInfo.planName for plan display

1 participant