Skip to content

Fix quota bucket display in main window - #434

Merged
nguyenphutrong merged 1 commit into
masterfrom
feature/fix-quota-bucket-display
Jul 14, 2026
Merged

nguyenphutrong merged 1 commit into
masterfrom
feature/fix-quota-bucket-display

Conversation

@nguyenphutrong

Copy link
Copy Markdown
Owner

Summary

  • show all Antigravity quota summary buckets in the main Quota window, matching the menu bar dropdown
  • classify Codex session and weekly windows using limit_window_seconds instead of assuming fixed primary/secondary positions
  • keep the existing positional mapping as a fallback when the upstream window duration is missing or ambiguous

Root cause

The Antigravity summary API introduced new antigravity-* bucket identifiers, but the main window still grouped only the older raw model names. Codex also treated every primary window as Session even when the upstream API returned a seven-day weekly window there.

Fixes #433

Related issues:

Validation

  • xcodebuild -project Quotio.xcodeproj -scheme Quotio -configuration Debug build
  • git diff --check
  • manual light/dark verification with live Antigravity and Codex accounts

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77f943fc-9112-45d0-b77f-f385bc942750

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-quota-bucket-display

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

Comment @coderabbitai help to get the list of available commands.

@nguyenphutrong
nguyenphutrong marked this pull request as ready for review July 14, 2026 16:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Quotio/Views/Screens/QuotaScreen.swift (1)

497-507: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Sort summary groups to maintain a consistent display order.

The new early-return logic maps the summary models into display groups but skips the sorting step. The legacy grouping logic (on line 545) sorts the groups by percentage ($0.percentage < $1.percentage) to ensure the lowest remaining quotas appear first.

Unless the goal is to strictly preserve the exact ordering of the data.models source array, consider sorting the returned array to maintain a consistent UI layout in the Quota screen.

♻️ Proposed fix
         let summaryModels = data.models.filter { $0.name.hasPrefix("antigravity-") }
         if !summaryModels.isEmpty {
             return summaryModels.map {
                 AntigravityDisplayGroup(
                     name: $0.displayName,
                     percentage: $0.percentage,
                     models: [$0]
                 )
-            }
+            }.sorted { $0.percentage < $1.percentage }
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Quotio/Views/Screens/QuotaScreen.swift` around lines 497 - 507, Update the
early-return mapping for summaryModels in the QuotaScreen summary-group logic to
sort the resulting AntigravityDisplayGroup array by percentage ascending,
matching the legacy grouping behavior and keeping lowest quotas first.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Quotio/Views/Screens/QuotaScreen.swift`:
- Around line 497-507: Update the early-return mapping for summaryModels in the
QuotaScreen summary-group logic to sort the resulting AntigravityDisplayGroup
array by percentage ascending, matching the legacy grouping behavior and keeping
lowest quotas first.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2a5955a5-6995-4768-b794-df78eef816bc

📥 Commits

Reviewing files that changed from the base of the PR and between ecd9d6f and 32e19e2.

📒 Files selected for processing (2)
  • Quotio/Services/QuotaFetchers/CodexUsageMapper.swift
  • Quotio/Views/Screens/QuotaScreen.swift

@nguyenphutrong
nguyenphutrong merged commit 637fad2 into master Jul 14, 2026
1 check passed
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.

Quota screen only shows one bucket per account (Antigravity → Claude only, Codex → Session only); menu bar shows the full breakdown

1 participant