Battery Viewer widget#58
Merged
LelsersLasers merged 21 commits intomasterfrom Apr 22, 2026
Merged
Conversation
16d235e to
776bdcf
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Battery Viewer” widget to visualize per-cell voltages/balancing state plus pack-level telemetry, and wires it into the app’s widget spawning flow.
Changes:
- Introduce
BatteryViewerwidget (CAN decoding + egui UI) and integrate it into widget spawning (sidebar + command palette + app counters). - Add UI theme/color helpers and general color interpolation utilities used by the battery view.
- Update tooling (nix flake rust-analyzer component) and adjust CAN serial driver bitrate.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets.rs | Add new widget variant and route show/CAN handling to BatteryViewer. |
| src/util.rs | Add lerp + HSV→Color32 helpers used for cell color rendering. |
| src/ui/theme.rs | New theme color model + ctx persistence helpers for semantic colors. |
| src/ui/sidebar.rs | Add “Add Battery Viewer” button to spawn the new widget. |
| src/ui/scope.rs | Remove stale TODO comments. |
| src/ui/mod.rs | Export new battery and theme UI modules. |
| src/ui/battery.rs | New BatteryViewer widget implementation (CAN parsing + UI rendering). |
| src/can/driver.rs | Change SLCAN nominal bitrate default from 500k to 250k. |
| src/app.rs | Add instance counter and spawn path for BatteryViewer. |
| src/action.rs | Add WidgetType::BatteryViewer and command palette entry. |
| nix_flake/flake.nix | Add rust-analyzer to the nix dev environment extensions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
04d73c8 to
65bbb62
Compare
irvingywang
approved these changes
Apr 21, 2026
Member
|
did we fix the theme thingy or nah |
Member
Author
|
I just cherry picked what I wanted from #54 but I think if it all works in that PR its fine |
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.
Simple widget to view all the cell voltages in the pack (+ which are being balanced) as well as overall battery status (current, pack voltage, overall min/max/diff). Designed specifically to for CCAN/charging right now. When ABOX telemetry is finalized/updated, the message names/signals may also need to update.