Skip to content

feat(mobile): show Antigravity quota windows on Accounts screen - #36417

Closed
ian-nocturne wants to merge 2 commits into
stablyai:mainfrom
ian-nocturne:feat/mobile-antigravity-account-usage
Closed

ian-nocturne wants to merge 2 commits into
stablyai:mainfrom
ian-nocturne:feat/mobile-antigravity-account-usage

Conversation

@ian-nocturne

@ian-nocturne ian-nocturne commented Oct 30, 2026 •

Copy link
Copy Markdown

ELI5

The Orca desktop host already tracks Antigravity quota windows (such as 5-hour and 7-day usage per model group), and following #36520 provider quota usage lives on each desktop's Accounts screen (MobileAccountsScreen). Previously, the mobile Accounts screen only showed Claude and Codex sections. Now it also shows your Antigravity model-group quota bars and reset countdowns right below Claude and Codex when active Antigravity usage is available.

What Changed

  • mobile/src/components/accounts-snapshot.ts, mobile/src/components/accounts-snapshot.test.ts & config/mobile-localization-coverage-allowlist.json:
    • Added optional rateLimits.antigravity (ProviderRateLimitsSchema.nullable().optional()) to AccountsSnapshotSchema with provider-identity validation (provider === 'antigravity'), and added the internal validation diagnostic message to mobile-localization-coverage-allowlist.json alongside existing Claude/Codex diagnostics.
    • Extended ProviderRateLimitsSchema buckets items with optional id and windowMinutes (nonnegative) fields so zero-duration/unknown-window buckets validate cleanly.
  • mobile/src/accounts/MobileAntigravityUsageSection.tsx, mobile/src/accounts/MobileAccountsScreen.tsx & mobile/src/i18n/locales/*.json (all 11 locales):
    • Added MobileAntigravityUsageSection and rendered it on MobileAccountsScreen below Claude and Codex whenever hasActiveProviderUsage(snapshot.rateLimits.antigravity ?? null) holds.
    • Rendered MobileAgentIcon (agentId="antigravity"), localized accounts.screen.antigravity across all 11 locale files, deduplicated React keys across colliding bucket IDs/names, and rendered per-bucket UsageBar meters with 5h / 7d labels and formatResetCountdown reset countdowns (falling back to session and weekly summary windows when buckets are omitted).
  • mobile/src/accounts/MobileAntigravityUsageSection.test.tsx & mobile/src/accounts/mobile-accounts-screen-reset-credit.test.ts:
    • Added unit and integration tests covering named bucket consumption + reset countdown rendering without duplicating summary bars, session/weekly fallback bars, unknown-duration (windowMinutes: 0) buckets, omitted/inactive Antigravity limits, colliding bucket React key disambiguation, wrong-provider rejection, and MobileAccountsScreen live accounts.subscribe rendering.

Before: AccountsSnapshotSchema stripped rateLimits.antigravity, and MobileAccountsScreen rendered only Claude and Codex sections.

After: AccountsSnapshotSchema validates optional rateLimits.antigravity, and MobileAccountsScreen renders localized Antigravity model-group quota bars (5h / 7d) and reset countdowns when active Antigravity usage is present.

Why

Following #36520 consolidating provider usage onto each desktop's Accounts screen, users orchestrating Antigravity sessions from Orca mobile need visibility into 5-hour and weekly model-group quota consumption on MobileAccountsScreen without opening desktop Settings. Making rateLimits.antigravity optional preserves full backwards compatibility with older hosts that do not emit the field.

Linked Issue

Fixes #36416

Visual Proof

Rendered the Accounts screen (main vs. this PR) at 390×844 dark theme (deviceScaleFactor: 2) using the mobile-web-app React Native Web + Playwright render harness against the real MobileAntigravityUsageSection, accounts-snapshot, mobile-accounts-screen-styles, mobile-theme, and mobile-i18n modules with synthetic demo account data ([email protected], zero personal data, zero page errors, zero bridge faults). Note: local iOS Simulator Expo prebuild was skipped on this Mac because the pod (CocoaPods) CLI is not installed locally.

Before (main, Claude & Codex only) After (this PR, with Antigravity model-group quota bars)
Before: Mobile Accounts screen showing only Claude and Codex sections After: Mobile Accounts screen showing Claude, Codex, and Antigravity model-group 5h/7d bars and reset countdowns

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Verification performed on macOS:

  • Ran pnpm --dir mobile exec vitest run src/accounts/MobileAntigravityUsageSection.test.tsx src/accounts/mobile-accounts-screen-reset-credit.test.ts src/accounts/mobile-accounts-route.test.ts src/components/accounts-snapshot.test.ts src/components/account-usage-state.test.ts (46/46 tests passed across 5 suites).
  • Ran pnpm --dir mobile typecheck and pnpm verify:mobile-localization across all 11 locale files (3727 call sites, 3394 English entries verified).
  • Ran oxfmt, oxlint, and pre-commit lint-staged (oxlint + ast-grep + oxfmt) — 0 warnings, 0 errors.
  • Rendered before/after Accounts screen visuals at 390×844 via Playwright and verified zero runtime errors and zero bridge faults.

AI Disclosure

  • Codex (gpt-6.1-sol) authored the initial accounts-snapshot schema and bucket deduplication tests.
  • Gemini (gemini-4-argon) rebased onto main after feat(mobile): rebuild Home around what needs you, with actions pinned at the bottom #36520, migrated the Antigravity quota display onto MobileAccountsScreen (MobileAntigravityUsageSection), verified vitest, typecheck, oxlint, and verify:mobile-localization, and captured the updated Accounts screen visual proof.

Review

AI review summary (gemini-4-argon):

  • Cross-platform: Pure TypeScript/React Native (View, Text, MobileAgentIcon, UsageBar) and Zod schema validation; behaves identically on iOS, Android, and mobile-web-app.
  • SSH / remote: Backwards-compatible with older remote/SSH orcad hosts because rateLimits.antigravity is .nullable().optional().
  • Performance: Evaluates hasActiveProviderUsage and maps a small bounded buckets array (typically 2–3 entries) only when the Accounts screen receives host snapshot updates.
  • UI: Reuses mobile-accounts-screen-styles, dark/light theme tokens, bundled offline antigravity icon, formatResetCountdown, and 11-locale translations.

Provenance

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The mobile accounts snapshot now accepts optional Antigravity rate limits and validates their provider identity. The accounts screen renders an Antigravity usage section with quota buckets or fallback session and weekly usage. The section displays reset countdowns and limits errors when present. Tests cover snapshot validation, usage rendering, and screen integration. Account-screen translations now include the Antigravity label across supported locales.

Merge Risk: Low · previous review 67df1

A malformed Antigravity reset timestamp can hide all account usage on mobile; normalize it before accepting the snapshot.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue #36416 requires bucket id and windowMinutes to be optional, with nonnegative validation when windowMinutes is present. The current RateLimitWindowSchema.extend declares windowMinutes a… Make bucket windowMinutes optional while retaining finite nonnegative-integer validation when present. Update bucket rendering for an omitted value and add a regression test that decodes and renders a bucket without windowMinutes.
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "feat(mobile): show Antigravity quota windows on Accounts screen" names the main change. The PR adds an Antigravity usage section to the mobile Accounts screen, with quota bars and reset cou…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #36416), Visual Proof with before/after images, Testing with the checkboxes, AI Disclosure, Re…
Out of Scope Changes check Passed The changed schema, Antigravity section, MobileAccountsScreen wiring, localization entries, and tests directly implement the coding requirements in issue #36416. The changes remain within the linked i…
Full details: Title check

Explanation

The title "feat(mobile): show Antigravity quota windows on Accounts screen" names the main change. The PR adds an Antigravity usage section to the mobile Accounts screen, with quota bars and reset countdowns. It also adds schema validation and localization, which the title does not cover. That scope is expected for a title.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #36416), Visual Proof with before/after images, Testing with the checkboxes, AI Disclosure, Review, Provenance, Notes, and Checklist. The Testing section lists the commands run and the platform (macOS). The Visual Proof section explains that the iOS Simulator build was skipped. The template's Review heading contains the AI review summary, and the Provenance section replaces the template's upstream boundary wording. Those are minor deviations. The description is detailed and matches the changeset.

Full details: Out of Scope Changes check

Explanation

The changed schema, Antigravity section, MobileAccountsScreen wiring, localization entries, and tests directly implement the coding requirements in issue #36416. The changes remain within the linked issue scope. No unrelated change is established by the reviewed summary.

Full details: Linked Issues check

Explanation

Issue #36416 requires bucket id and windowMinutes to be optional, with nonnegative validation when windowMinutes is present. The current RateLimitWindowSchema.extend declares windowMinutes as nonnegative but still required. A bucket that omits windowMinutes therefore fails decoding. The implementation does include optional Antigravity limits, provider-identity validation, zero-minute support, the localized section, bucket and summary-window rendering, reset countdowns, and related tests.

Resolution

Make bucket windowMinutes optional while retaining finite nonnegative-integer validation when present. Update bucket rendering for an omitted value and add a regression test that decodes and renders a bucket without windowMinutes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c957b4a-95f6-4208-b9c5-65d2b923c2c1
Commits

Reviewing files that changed from the base of the PR and between b2b8b0b and d7bb271.

Files selected for processing: 16
  • config/mobile-localization-coverage-allowlist.json
  • mobile/src/components/accounts-snapshot.ts
  • mobile/src/home/MobileHomeAccountUsageCards.test.tsx
  • mobile/src/home/MobileHomeAccountUsageCards.tsx
  • mobile/src/home/use-mobile-home-data.ts
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5d38640c-7bca-4dc2-beed-b573807a0b6a
Commits

Reviewing files that changed from the base of the PR and between d7bb271 and c8ca9d2.

Files selected for processing: 2
  • mobile/src/home/MobileHomeAccountUsageCards.test.tsx
  • mobile/src/home/MobileHomeAccountUsageCards.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@ian-nocturne
ian-nocturne force-pushed the feat/mobile-antigravity-account-usage branch from 5da50b7 to 94b53f8 Compare October 31, 2026 12:33
ian-nocturne added a commit to ian-nocturne/orca that referenced this pull request Oct 31, 2026
ian-nocturne added a commit to ian-nocturne/orca that referenced this pull request Oct 31, 2026
@ian-nocturne ian-nocturne changed the title feat(mobile): show Antigravity quota windows in home account usage feat(mobile): show Antigravity quota windows on Accounts screen Oct 31, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21417e0f-5a64-4f20-ae6a-b14de4aa490a
Commits

Reviewing files that changed from the base of the PR and between 5da50b7 and 94b53f8.

Files selected for processing: 16
  • mobile/src/accounts/MobileAccountsScreen.tsx
  • mobile/src/accounts/MobileAntigravityUsageSection.test.tsx
  • mobile/src/accounts/MobileAntigravityUsageSection.tsx
  • mobile/src/accounts/mobile-accounts-screen-reset-credit.test.ts
  • mobile/src/components/accounts-snapshot.test.ts
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 11
  • mobile/src/i18n/locales/zh.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/ru.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@ian-nocturne
ian-nocturne force-pushed the feat/mobile-antigravity-account-usage branch from 94b53f8 to 67df1dc Compare November 1, 2026 03:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Clamp pre-epoch Antigravity reset timestamps to null. · accounts-snapshot.ts:181-219

mobile/src/components/accounts-snapshot.ts:181-219
Minor · Data Integrity & Integration · Quick win

Clamp pre-epoch Antigravity reset timestamps to null.

parseResetsAt accepts any parseable date string. A date before 1970 yields a negative resetsAt. The mobile TimestampSchema requires a nonnegative integer. The new antigravity validation therefore rejects the whole accounts.list snapshot. MobileAccountsScreen then clears the snapshot and shows "Invalid accounts snapshot from host". Claude and Codex usage disappear with the Antigravity section.

Return null for negative values at the producer. The mobile renderer already handles null reset times.

Suggested fix
 function parseResetsAt(value: unknown): number | null {
   const text = readString(value)
   if (!text) {
     return null
   }
   const parsed = new Date(text).getTime()
-  return Number.isFinite(parsed) ? parsed : null
+  return Number.isFinite(parsed) && parsed >= 0 ? parsed : null
 }

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73efeea5-b551-433d-88f2-d9da5419a648
Commits

Reviewing files that changed from the base of the PR and between 94b53f8 and 67df1dc.

Files selected for processing: 3
  • mobile/src/accounts/MobileAccountsScreen.tsx
  • mobile/src/accounts/mobile-accounts-screen-reset-credit.test.ts
  • mobile/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 1
  • mobile/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Thanks for working on this! #38187 just merged and shows usage on mobile for every provider the desktop tracks, so I'm closing this in favour of it. Your work here helped shape that change.

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.

[Feature]: Show Antigravity quota windows on mobile Accounts screen

2 participants