Skip to content

feat: modernize dashboard panel UI with visual range gauges and decluttered telemetry - #100

Open
NicoM701 wants to merge 1 commit into
codex/plant-run-redesignfrom
prototype/ui-modernization
Open

feat: modernize dashboard panel UI with visual range gauges and decluttered telemetry#100
NicoM701 wants to merge 1 commit into
codex/plant-run-redesignfrom
prototype/ui-modernization

Conversation

@NicoM701

@NicoM701 NicoM701 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Modernized the PlantRun Home Assistant panel UI with a cleaner, glassmorphic layout for both light and dark themes.
  • Replaced flat text strips with modern metric cards featuring visual target range gauge bars (optimal zone markers and current value needles) for tent temperature, humidity, lighting, and power.
  • Redesigned active plant cards with breeder badges, stage progression timeline bars, integrated telemetry grids (soil moisture, substrate temperature, EC), and Material Design icons (ha-icon).
  • Removed redundant status badges and numerical text ranges to declutter the interface.
  • Updated tests/frontend_harness.html with functional ha-icon MDI 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.js
  • node --check custom_components/plantrun/www/plantrun-panel-views.js
  • node --check custom_components/plantrun/www/plantrun-panel-styles.js
  • Visual validation in browser harness (tests/frontend_harness.html) across dark and light themes.

Remaining risk

Visual changes rely on Home Assistant's native ha-icon element in production deployment.

…ttered telemetry

Co-authored-by: Cursor <cursoragent@cursor.com>

@NicoM701 NicoM701 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. "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 only temperature binding. Prefer an explicit substrate/soil-temp metric (or fall back to unbound) so the card doesn’t lie.
  2. 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).
  3. _renderRangeBar divide-by-zero: if min === max, ((numVal - min) / (max - min)) is NaN/Infinity and the needle CSS breaks. Guard max > min (and optionally clamp targetLow/High into [min,max]).

Medium

  1. Dead / incomplete status badge: _renderStatusBadge is unused; CSS has .zone-badge.bad but the helper never emits bad (only warn/good/neutral). Wire it into the cards or drop it.
  2. Theme selector mismatch: production styles use .theme-light … while the prototype uses html[data-theme="light"]. Confirm the live panel actually gets .theme-light on an ancestor, or light-theme gauge tracks stay wrong.
  3. Prototype vs panel drift: prototype sensor grid is repeat(5, …) vs panel auto-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.
  4. "Letzter Eintrag" uses journal_entries[0]: only correct if the array is newest-first. If not, show the max occurred_at (or whatever the existing helper is).

Low / nits

  1. Stage timeline assumes ≤5 steps via CSS repeat(5, 1fr) while stagePlan(run) can vary — odd layout if plan length ≠ 5.
  2. Unbound tent cards still show hardcoded fallbackSub sample mins/maxes — reads like live history; prefer “Nicht zugeordnet” only.
  3. 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

@NicoM701

NicoM701 commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

Spark review

Model: gpt-5.3-codex-spark · Commit: 8a0dab0780d4

Diff-only review (limited context from the provided patch only). I reviewed only the changed hunks and focused on concrete correctness regressions.

  • P2: Hardcoded German stage names break plant stage timeline for non-German/migrated datacustom_components/plantrun/www/plantrun-panel-views.js:207
    _renderPlantCard builds the timeline from a hardcoded German stages list and matches recorded.has(stg.toLowerCase()) / stage.toLowerCase(). If run data is in English (e.g. older installs with current_stage: "Seedling" and stage_plan: ["Germination","Seedling",…]), no segment is marked active or done, so the progress bar is always blank/future-only. This is a visible correctness regression when opening legacy or non-German datasets.

  • P2: Plant card shows possibly stale journal entry as "latest"custom_components/plantrun/www/plantrun-panel-views.js:244
    _renderPlantCard uses run.journal_entries?.[0] directly for "Letzter Eintrag", assuming index 0 is the newest row. If the backend returns journal entries in insertion/chronological ascending order (common pattern), this renders the oldest entry and mislabels "Letzter Eintrag" after users log more recent entries.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant