Persist 24h usage history to flash across reboots - #124
Open
sememtac wants to merge 3 commits into
Open
Conversation
Extends the desk dashboard with more pages, touch-swipe navigation, an
animated burn-rate flame in the corner, and a swipe-to-cycle costume system
for the corner mascot. Physical buttons are unchanged — all new navigation
is via touch gestures. New art is original pixel-art; generators in tools/.
- Pages: Trend (session+weekly sparkline), Burn (%/hr + ETA to 100%), and
Session / Weekly detail. Swipe left/right cycles them (modulo wrap).
(ui.cpp, ui.h, usage_history.{cpp,h})
- Touch-swipe navigation, rotation-aware: the raw touch delta is rotated by
the IMU quadrant so gestures track "screen up" in any orientation. Swipe
left/right = pages, up/down = costumes; a tap still toggles the splash.
- Burn-rate flame: original pixel flame that flickers each frame and smoothly
tracks the live session burn rate. It sits to the right of the battery, and
the battery now shows only when a cell is actually attached (power_hal
reports -1 otherwise) instead of a misleading empty glyph. Battery-less
boards just show the flame. (flame_icon.h via tools/gen_flame.py)
- Costumes on the corner mascot: shades, cat ears, sombrero, pom-pom,
lightsaber, santa, double saber, rainbow; choice persisted to NVS. Each
prop is cropped to its bounding box to keep the data compact.
(costumes.h via tools/gen_costumes.py)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reworks tools/gen_costumes.py so adding a costume for the corner mascot is approachable: a @Costume("name") decorator registers a prop in one place (was a separate function + a parallel list), named anatomy landmarks (A.EYE_L / HEAD_TOP / ...) replace guessed pixel coordinates, per-prop docstrings, a "how to add a costume" guide, and a generated costumes_guide.png (grid + labeled landmarks) to position new props. Generated costumes.h is byte-identical -- no art or firmware change, just a friendlier generator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Widens the usage_history ring to 24h (1440 samples at 60s polling) and saves it to NVS (a compact ~3KB blob) every ~10 samples, restoring it on boot so the Trend/Burn pages show real history across reboots instead of starting empty each time. Restored data is dropped if the daemon's wall-clock shows the newest sample is stale (>26h), so a long-unplugged device doesn't display ancient data as current. usage_history_add() gains an epoch argument for that staleness check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
Weak title and description, temporally linked to your session which I have 0 context of. Unclear what if any human QA was done on this. Example: Casually mentions trend/burn pages as if they are known existing features. Commit history mentions mascot costumes, no mention of them in PR title and description. Very sloppy PR sorry. This I think is a common problem when using agent is they are not aware enough of how to present their work to another person not privy to the current session. |
This was referenced Jul 24, 2026
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.
Widens the
usage_historyring to 24h (1440 samples) and persists it to NVS (~3KB blob) every ~10 min, restoring it on boot so the Trend/Burn pages show real history across reboots instead of starting empty. Restored data is discarded if the daemon's wall-clock shows the newest sample is stale (>26h).usage_history_add()gains an epoch arg for the staleness check.Stacked on #122 → #121 — review the top commit.