Repository navigation
Add interactive battery timeline - #24
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cabe140ee3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let previousWindowEnd = timelinePreparedData == nil ? nil : timelineWindowEnd | ||
| let requestHours = StatsTimelineRefresh.requestHours( | ||
| previousWindowEnd: previousWindowEnd, | ||
| windowEnd: windowEnd, | ||
| retentionHours: Self.timelineHours) |
There was a problem hiding this comment.
Requery historical rows after startup backfill
When Stats is opened before SamplerService.backfillIfNeeded() finishes, the initial 90-day query can miss points that are subsequently imported into gaps throughout the previous seven days. Once timelinePreparedData is set, this refresh policy queries only the elapsed interval plus the two-minute overlap—normally one hour—so those older rows never reach mergedSamples while the window remains open. Detect backfill completion or periodically reload the affected historical horizon.
Useful? React with 👍 / 👎.
Summary
Why
Battery history was difficult to inspect and long retained windows made the chart expensive to redraw. This keeps the existing data semantics while making exploration responsive and readable.
Verification
swift test --filter StatsTimelineInteractionTests(22 tests passed)swift test --filter PopoverLayoutTests --no-parallel -j 1(4 tests passed in five consecutive runs)swift test --no-parallel -j 1(339 tests passed)make app(signed universal Juice Dev bundle verified; x86_64 + arm64, signing team U2MBGTFZM5)git diff --check