Skip to content

fix: handle null usage resets and spinner sizing#21

Merged
eddmann merged 2 commits into
mainfrom
codex/null-reset-spinner-fixes
May 18, 2026
Merged

fix: handle null usage resets and spinner sizing#21
eddmann merged 2 commits into
mainfrom
codex/null-reset-spinner-fixes

Conversation

@eddmann
Copy link
Copy Markdown
Owner

@eddmann eddmann commented May 18, 2026

Summary

This consolidates the small bug-fix parts of the open PRs we reviewed:

What changed

Null usage reset times

Claude can return resets_at: null for usage windows with no current consumption. The mapper previously treated that as an invalid payload and blocked refresh. This keeps UsageLimit.resetAt non-optional and falls back to the relevant rolling window duration while preserving hard failure for malformed non-null dates.

Popover refresh spinner

The refresh button used scaleEffect plus a fixed frame around an AppKit-backed ProgressView, which can produce SwiftUI constraint assertions on macOS. This now uses .controlSize(.small) so AppKit supplies the small spinner size directly.

Attribution

Testing

  • xcodebuild test -project ClaudeMeter.xcodeproj -scheme ClaudeMeter -configuration Debug -only-testing:ClaudeMeterTests/UsageServiceTests

eddmann and others added 2 commits May 18, 2026 15:08
Claude can return resets_at: null for usage windows that have no current consumption. The mapper previously treated that valid response as an invalid payload and blocked refresh entirely.

Use the relevant window duration as a fallback while preserving strict failure for malformed non-null dates, and cover both paths in UsageServiceTests.

Adapted from PR #18 by Jean Friesewinkel, with additional issue context from PR #13 by Rasyid Ridho.

Co-authored-by: Jean Friesewinkel <jean@xfw.io>

Co-authored-by: Rasyid Ridho <rasyidridho7@gmail.com>
The refresh button used scaleEffect plus a fixed frame around an AppKit-backed ProgressView. On macOS that combination can produce SwiftUI constraint assertions when the button enters the refreshing state.

Use controlSize(.small), which asks AppKit for the smaller spinner without conflicting size constraints.

Adapted from PR #19 by Jean Friesewinkel.

Co-authored-by: Jean Friesewinkel <jean@xfw.io>
@eddmann eddmann merged commit d4271f1 into main May 18, 2026
1 check passed
@eddmann eddmann deleted the codex/null-reset-spinner-fixes branch May 18, 2026 14:22
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.

1 participant