feat: modernize dashboard panel UI with visual range gauges and decluttered telemetry - #100
feat: modernize dashboard panel UI with visual range gauges and decluttered telemetry#100NicoM701 wants to merge 1 commit into
Conversation
…ttered telemetry Co-authored-by: Cursor <cursoragent@cursor.com>
NicoM701
left a comment
There was a problem hiding this comment.
Review: dashboard UI modernization
Solid direction — sensor cards + range gauges are a clear UX win over the flat tent strip. Tests/harness coverage and the stated pass list are appreciated. A few issues before this should land:
High
- "Substrat-Temp" likely bound to tent ambient temperature (
plantrun-panel-views.js_renderPlantCard):bindingForMetric(run, tent, "temperature")with label Substrat-Temp will show zelt/air temp if that’s the onlytemperaturebinding. Prefer an explicit substrate/soil-temp metric (or fall back to unbound) so the card doesn’t lie. - Hardcoded target bands as product truth: tent gauges use fixed ranges (e.g. 24–28 °C, 65–75 % RH, light/energy bands). Same for plant telemetry (moisture 45–65, EC 0.8–1.4). Wrong stage/crop → misleading green zone. Drive targets from stage/run config (or mark them as illustrative defaults in the UI).
_renderRangeBardivide-by-zero: ifmin === max,((numVal - min) / (max - min))isNaN/Infinityand the needle CSS breaks. Guardmax > min(and optionally clamp targetLow/High into[min,max]).
Medium
- Dead / incomplete status badge:
_renderStatusBadgeis unused; CSS has.zone-badge.badbut the helper never emitsbad(only warn/good/neutral). Wire it into the cards or drop it. - Theme selector mismatch: production styles use
.theme-light …while the prototype useshtml[data-theme="light"]. Confirm the live panel actually gets.theme-lighton an ancestor, or light-theme gauge tracks stay wrong. - Prototype vs panel drift: prototype sensor grid is
repeat(5, …)vs panelauto-fit/ 4 metrics; different minmaxs on plant gallery. Either sync or keep the prototype out of this PR so production doesn’t inherit stale layout assumptions. - "Letzter Eintrag" uses
journal_entries[0]: only correct if the array is newest-first. If not, show the maxoccurred_at(or whatever the existing helper is).
Low / nits
- Stage timeline assumes ≤5 steps via CSS
repeat(5, 1fr)whilestagePlan(run)can vary — odd layout if plan length ≠ 5. - Unbound tent cards still show hardcoded
fallbackSubsample mins/maxes — reads like live history; prefer “Nicht zugeordnet” only. - Large prototype HTML churn in the same PR as production panel makes review noisy; consider splitting.
What’s good
- Escape via
e()on user-facing strings looks consistent. - Gauge math clamping to 0–100% is otherwise fine.
- Declutter (drop redundant badges) matches the PR goal.
Ask: fix (1)–(3) at least; clarify intent on substrate binding + whether targets are temporary placeholders. No approve/merge from me.
— Reviewed by Grok Bot
Spark reviewModel: Diff-only review (limited context from the provided patch only). I reviewed only the changed hunks and focused on concrete correctness regressions.
Automated diff-only review. No tests executed; this is not a merge approval. Posted by the local Spark reviewer using the PR author’s GitHub account. |
Summary
ha-icon).tests/frontend_harness.htmlwith functionalha-iconMDI SVG rendering and multi-sensor preview state.Test plan
python -m unittest discover -s tests -p 'test_*.py'(160 tests passing)node --check custom_components/plantrun/www/plantrun-panel.jsnode --check custom_components/plantrun/www/plantrun-panel-views.jsnode --check custom_components/plantrun/www/plantrun-panel-styles.jstests/frontend_harness.html) across dark and light themes.Remaining risk
Visual changes rely on Home Assistant's native
ha-iconelement in production deployment.