Fix Dashboard weekly usage labels - #168
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clearedthis day's value. The API already reportsfilters_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:
After:
The matching accessibility hint is now
Pins or clears this week's value.Design and safety
period bucketswording instead of inventing daily semantics.dashboard.usage.day.Nidentifiers remain stable for automation compatibility; only their user-facing hints become truthful.Review order
UsagePane.swiftandDashboardPane.swift— shared granularity wording, Dashboard range subtitle, and pin/clear accessibility semantics.DashboardSnapshotHarness.swiftandUsageSnapshotHarness.swift— one explicit recorded-usage fixture state used by both panes.DashboardInteractionTests.swiftandUsagePeriodPresentationTests.swift— daily, weekly, unknown-granularity, and accessibility contracts.Verification
swift test --filter DashboardSnapshotHarnessTestsproduced 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.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.