fix: prevent stale AI Usage day details across ranges (B19) - #1210
Merged
Merged
Conversation
Model: gpt-6.1-sol
Model: gpt-6.1-sol
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.
Related issue
B19. Same-repository maintainer branch; no separate GitHub Issue.
Problem / pressure
Selecting a day in AI Usage and changing the range already clears the selection,
but an old resize/scroll callback can select it again. The active timeline can
then report “No usage” while the independent day query renders the old day's
full totals. Controlled callback delivery reproduces this on the starting main
source; the exact production bundle and native callback sequence remain unverified.
Summary
Separate explicit day selection from caret positioning in the hourly panel and
year calendar. Accept position updates only for the current selected date, using
the existing synchronous date ref. Retain the day cache, animations and 30d ↔ All
selection behavior. Extend the owning mounted regression suite, add an interactive
range-switching Story, and document the contract and ablation in the bilingual
timeline Spec and
2026-10-02-usage-range-selectionAgent Note.Visual explanation
sequenceDiagram participant View as Usage view participant State as Selection owner participant Query as Day query owner View->>State: Click day A State->>Query: Select A View->>State: Switch hourly range State->>Query: Clear selected date View->>State: Old resize/scroll measures A Note over State: Current date differs: discard position updateBefore / after
Test plan
NODE_OPTIONS=--no-experimental-webstorage NODE_ENV=test pnpm checkpassed, including 4,657 components tests and 199 Electron tests. The RPC suite retains three existing skipped tests.pnpm buildpassed for the local desktop;pnpm formatandpnpm run docs checkpassed. Existing build/docs warnings remain; no SHA-protected topics.Context handoff
Same-repository maintainer contribution. No captured user/agent transcripts or account data included.