Skip to content

refactor: improve usage tracking and rate limit management#11

Merged
hmenzagh merged 10 commits into
betafrom
feat/usage/tracking-v2
Apr 13, 2026
Merged

refactor: improve usage tracking and rate limit management#11
hmenzagh merged 10 commits into
betafrom
feat/usage/tracking-v2

Conversation

@hmenzagh
Copy link
Copy Markdown
Owner

Summary

Comprehensive refactoring of the usage tracking v2 feature with improvements to rate limit management, async discovery handling, and UI component modularization.

Note: recreated from #10 (retargeted to beta instead of main).

Changes

  • refactor(ui): modularize rate tracking into separate components - Decomposed monolithic rate_tracking.rs into 13 focused component modules for better maintainability
  • refactor(data): restructure data models and handlers - Updated data models, OAuth handling, indexing, and rate limit tracking
  • refactor(app): add async discovery refresh state management - Added async discovery refresh capability with proper state management
  • refactor(config): improve discovery configuration and handling - Enhanced discovery configuration logic and error handling
  • style(ui): update dashboard styling for new components - Updated dashboard styling to work with new rate tracking components

Testing

  • All clippy checks pass with no warnings
  • Code formatting verified with cargo fmt
  • Integration with existing rate limit tracking features maintained

🤖 Generated with Claude Code

hmenzagh and others added 10 commits April 13, 2026 01:26
Replace cloning references before passing to slice constructors with
std::slice::from_ref, which is more idiomatic and avoids unnecessary
allocations in test code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Do not carry over cached usage when a credential has expired, since the
poller stops fetching expired tokens and stale data would incorrectly
render an invalid session as 'live'.
Change merge_fresh_hits to use asymmetric merging: when a fresh hit
collides with an existing entry, keep the richer value on each field.
This prevents data loss when a fresh scan can no longer compute
per_model or session_duration_min (e.g. source JSONL rotated out).

Also removes unused HashSet import.
Add a new blinking_dot_span helper function that creates animated visual
indicators for status elements. The dot blinks at regular intervals based on
the tick counter, providing visual feedback for active monitoring.

- Add blinking_dot_span function in helpers.rs
- Use blinking dot in live_summary status display
- Use blinking dot in session_forecast status display
- Pass tick parameter through render function chain

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hmenzagh hmenzagh merged commit e2c0855 into beta Apr 13, 2026
16 checks passed
@hmenzagh hmenzagh deleted the feat/usage/tracking-v2 branch April 13, 2026 00:11
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