Skip to content

Fix Dashboard weekly usage labels - #168

Merged
FZ2000 merged 1 commit into
mainfrom
codex/fix-dashboard-weekly-usage-labels
Aug 28, 2026
Merged

Fix Dashboard weekly usage labels#168
FZ2000 merged 1 commit into
mainfrom
codex/fix-dashboard-weekly-usage-labels

Conversation

@FZ2000

@FZ2000 FZ2000 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Why

After selecting the 90-day range in Usage and returning to Dashboard, the chart receives 14 weekly buckets but presented them as last 14 days. Every chart bar also said it pinned or cleared this day's value. The API already reports filters_echo.granularity = weekly; Dashboard discarded that fact and inferred a unit from the bucket count.

Central difference

Dashboard now carries the selected range and the API's effective granularity into chart presentation instead of treating every period bucket as a day.

Before:

Fresh tokens · last 14 days · client reported

After:

Fresh tokens · last 90 days · weekly buckets · client reported

The matching accessibility hint is now Pins or clears this week's value.

Design and safety

  • Daily 7-day and 30-day wording remains unchanged.
  • Weekly copy uses the selected 90-day range rather than multiplying or interpreting bucket boundaries.
  • Missing or unknown granularity falls back to neutral period buckets wording instead of inventing daily semantics.
  • The existing dashboard.usage.day.N identifiers remain stable for automation compatibility; only their user-facing hints become truthful.
  • No totals, aggregation, endpoint, or persistence behavior changes.
  • The deterministic fixture's already-paired 7-day and 90-day responses are shared by Usage and Dashboard snapshot harnesses, preventing stale data from wearing a different range.

Review order

  1. UsagePane.swift and DashboardPane.swift — shared granularity wording, Dashboard range subtitle, and pin/clear accessibility semantics.
  2. DashboardSnapshotHarness.swift and UsageSnapshotHarness.swift — one explicit recorded-usage fixture state used by both panes.
  3. DashboardInteractionTests.swift and UsagePeriodPresentationTests.swift — daily, weekly, unknown-granularity, and accessibility contracts.
  4. Dashboard snapshot tests plus the two new 2240x1800 references — complete 14-bucket light/dark review state.

Verification

  • Red before implementation: swift test --filter DashboardSnapshotHarnessTests produced six artifacts instead of eight and could not load the weekly reference.
  • swift test: 165 tests passed, 6 visual-wrapper skips by design, 0 failures.
  • swift test --filter 'UsagePeriodPresentationTests|DashboardInteractionTests': 42 tests passed.
  • swift build -c release: passed on the final tree.
  • ./Scripts/visual-snapshots verify: About, Dashboard, Menu, Setup, Usage, and Work all matched on the canonical renderer.
  • Final focused Dashboard canonical verification passed after the accessibility audit correction.
  • Both new weekly references were manually inspected in light and dark; the full 14-bucket chart, dates, and corrected subtitle are visible without clipping.
  • git diff origin/main...HEAD --check: passed.

Scope

This fixes Dashboard's presentation of an already-correct weekly response. It does not change the Usage summary API, provider meters, costs, totals, or installed-app update behavior. GitHub CI passed on the PR head: Python 3.11, 3.12, 3.13, and macOS app/UI snapshots.

@FZ2000
FZ2000 merged commit 3d8c065 into main Aug 28, 2026
4 checks passed
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