Skip to content

feat: add custom usage analytics ranges - #81

Open
roguetrader777 wants to merge 4 commits into
deviffyy:mainfrom
roguetrader777:feat/custom-usage-analytics
Open

roguetrader777 wants to merge 4 commits into
deviffyy:mainfrom
roguetrader777:feat/custom-usage-analytics

Conversation

@roguetrader777

@roguetrader777 roguetrader777 commented Oct 10, 2026 •

Copy link
Copy Markdown

Summary

OpenQuota's usage view was limited to preset periods and separate provider cards. It could not show total usage across every enabled provider for an arbitrary local-time range, usage since a real weekly or observed banked reset, measured task averages, or a clear comparison with two premium seats plus entered API spend.

Additions

  • Add a Custom period beside Today, Yesterday, and 30 Days, using the existing Total Spend ring and provider legend.
  • Select all enabled providers by default, while still allowing one provider to be inspected.
  • Add arbitrary local date/time ranges using an IANA time zone.
  • Add since last reset views based on live provider reset data, including an observed Codex banked-reset marker after a successful reset claim.
  • Add measured average cost and duration per completed Codex or Claude task from content-free local event metadata.
  • Add local reset/update timestamps, range provenance, incomplete-data diagnostics, and comparisons for two current premium seats plus entered API usage.

Fixes and safeguards

  • Prevent Today from remaining visually selected when Custom is active.
  • Resolve DST gaps and overlaps deterministically instead of silently shifting the requested range.
  • Use the live weekly-reset boundary for daily-only providers instead of unrelated Custom form values.
  • Fail explicitly when provider data is unavailable or only daily precision is supported; hourly detail and task averages are never invented.
  • Keep raw prompts and responses out of both the frontend response and analytics cache.
  • Reuse the existing provider discovery, storage, pricing, and Tauri command layers; no dependency was added.

Verification

Tested on Windows 11 x64 through WSL with the Windows Rust toolchain:

  • corepack pnpm verify:versions — PASS
  • corepack pnpm verify:contracts — PASS
  • corepack pnpm lint — PASS
  • corepack pnpm check — PASS (0 errors, 0 warnings)
  • frontend test suite — PASS (240/240), followed by the final affected UsageAnalytics regression suite — PASS (7/7)
  • corepack pnpm build — PASS
  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check — PASS
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings — PASS
  • cargo test --manifest-path src-tauri/Cargo.toml --all-targets — PASS (550/550)

corepack pnpm verify reached the frontend Vitest phase, where the default unbounded worker launch stalled in the WSL/NTFS environment. The same required checks passed separately with bounded workers. Upstream GitHub Actions is awaiting the maintainer's first-time fork approval; no failed CI job exists on the current HEAD.

Reference prices are current published USD prices and are shown only as local estimates, not provider billing data:

Screenshots

Full dashboard with Custom applied, matching the existing main screenshot format (synthetic example data):

Full OpenQuota dashboard with Custom usage applied

Custom range configuration dialog:

Custom usage range dialog

Checklist

  • This pull request is focused on one change.
  • I added or updated tests where behavior changed.
  • I ran the relevant checks, including corepack pnpm verify when possible.
  • I did not include credentials, personal data, build output, or unrelated changes.

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