Repository navigation
fix(app): leave a gap in History where nothing was recorded - #117
Merged
Merged
Conversation
The charts joined the last sample before a stretch with no recording, such as Chargectl being quit, to the first one after, so a straight line ran across hours with no data, and hovering snapped between the two ends. Draw each unbroken run of samples as its own line, let the hover line follow the pointer with its dot on the line, and say "Not recorded" in a gap. The charger strip stops at a gap too.
Merged
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.
What changed
History charts joined the last sample before a stretch with no recording to the first one after. On this Mac the helper recorded nothing from 4:38 to 9:24 PM because Chargectl was quit (see #118 for why). So the Charge, Temperature and Power charts drew straight lines across five hours, and the hover marker snapped between the two ends instead of following the pointer.
[HistorySample].runssplits samples where two are more than 20 minutes apart. The helper records once a minute while the Mac is awake, and a sleeping Mac wakes to record about every 15 minutes, so sleep stays one line. Each chart draws each run as its own series.sample(near:)finds the sample closest to the pointer, or nil inside a gap.value(at:_:)reads the line between the samples around the pointer, so the dot slides along the line.Verified
SharedModelTestscover runs, the nearest sample and the gap, and the value between samples../scripts/check.shpasses.history-gap, shows the gap in all three charts.Not verified: hovering in the running app, because that needs mouse input.