8000 feat(web): merge the overview tabs and filter it by time range by InfinityPacer · Pull Request #9 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content
< 8000 a hidden="" id="code-view-repo-link" href="/InfinityPacer/meterleaf" data-discover="true">

feat(web): merge the overview tabs and filter it by time range - #9

Merged
InfinityPacer merged 1 commit into
mainfrom
feat/overview-range
Sep 25, 2026
Merged

InfinityPacer merged 1 commit into
mainfrom
feat/overview-range

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

Problem

The overview was split into 「累计总览」 (lifetime totals and account quotas) and 「时间段用量」 (range metrics, trend and model distribution). The overview could not be filtered by time while still showing totals and quotas first, and the range page duplicated the reports page. The range statistics were also thin.

Result

  • One 用量总览 page. The top row is a date range picker, defaulting to the new 「历史至今」 preset, plus the USD basis toggle. Next comes a four-cell summary (Tokens, 费用, 请求, 缓存命中率), then 账户额度, which always follows each account's current quota period, then the trend and model distribution for the selected range. Old #period links and saved page preferences open the overview.
  • The cache hit rate keeps its own cell. A stacked bar splits the input side into cache read, input and cache write, and output is listed as a separate figure. For 历史至今 the summary shows daily averages and the start date. Other ranges show period-over-period change for Tokens, cost and requests.
  • A row under the trend shows the peak bucket, the number of active buckets and the average per request. Clicking a model opens reports filtered to that model with the same range.
  • Reports gain the same summary, a 缓存命中率 column and a 合计 totals row. On wide screens the legend column that duplicated the table is gone.
  • 「历史至今」 is also available on reports and requests. The client resolves it to a Shanghai natural-day range starting from the first ledger record, so the server contract is unchanged. The view adds optional previousTokenSummary and previousCount on both computation paths.
  • Abbreviated numbers keep two decimals, for example 3.00B and 2.95B. Axis ticks stay short.
  • Not included, as agreed: a subscription-versus-API difference metric and CSV export.

Verification

  • bun test tests passes 336 tests. New tests cover the all-history range, preference persistence, previous-period fields, the summary builders, trend insights and the report cache hit rate.
  • bun run build passes.
  • bun tests/browser.smoke.ts passes against an isolated headless Chrome at 1440×1000 and 390×844. It covers the all-history default, range switching without changing quotas, the #period redirect, model drill-down to reports, the report summary, cache hit rate column and totals row, and the existing checks.
  • tests/mobile-app.browser.ts is updated for the merged overview. It still fails on three older assertions that also fail on main before this change. They expect the drawer border colour from before the 0.3.0 redesign and N/A weekly estimates that the demo ledger now provides. They were left unchanged rather than weakened. With only those three bypassed, the run passes across 84 screens.
  • A separate agent reviewed the visuals at 360, 390, 1000, 1440 and 1920 wide, in both themes, including the narrow sidebar layout. It found no blockers, and its should-fix findings are addressed. These cover the totals row rule, the narrow summary layout, sub-line spacing in the cost cell, top alignment at 1000px, clipping of the last axis label, the insight label wrapping, and stale hour granularity carried over from the old tab.
  • The README screenshots for web and mobile, overview and reports, were retaken with demo data.

Web overview

🤖 Generated with Claude Code

The overview is one page again. A date range picker, defaulting to all
history, drives the summary strip, trend and model distribution, while
account quotas always follow their current period. The summary keeps the
cache hit rate in its own cell with an input-side composition bar, shows
daily averages for all history and period-over-period change otherwise.
Reports gain the same summary, a cache hit rate column and a totals row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit 1b069c8 into main Sep 25, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the feat/overview-range branch September 25, 2026 20:42
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

0