Fix quota bucket display in main window - #434
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Quotio/Views/Screens/QuotaScreen.swift (1)
497-507: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSort 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.modelssource 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
📒 Files selected for processing (2)
Quotio/Services/QuotaFetchers/CodexUsageMapper.swiftQuotio/Views/Screens/QuotaScreen.swift
Summary
limit_window_secondsinstead of assuming fixed primary/secondary positionsRoot 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 buildgit diff --check