Skip to content

Editor icon fields: HA icon-picker dropdown with native fallback — v0.16.5 - #32

Merged
ryanbuiltthat merged 1 commit into
mainfrom
claude/prism-smart-dashboard-card-rjlks3
Jul 21, 2026
Merged

Editor icon fields: HA icon-picker dropdown with native fallback — v0.16.5#32
ryanbuiltthat merged 1 commit into
mainfrom
claude/prism-smart-dashboard-card-rjlks3

Conversation

@ryanbuiltthat

Copy link
Copy Markdown
Owner

What

The visual editors now use Home Assistant's searchable icon picker (ha-icon-picker) for the "Icon" field instead of a plain text input.

A new shared _iconField() helper on PrismEditor renders ha-icon-picker when that element is registered in the frontend, and falls back to the native text input otherwise — the same defensive pattern as the v0.16.4 ha-textfield fix, since a missing custom element renders as an invisible node. set hass / _rerender now also propagate hass to ha-icon-picker.

The seven icon fields — stat, power, cover, linear-gauge, switch, light cards, plus the entities-card row editor — now use it. The icon config key and card rendering are unchanged.

Testing

Verified in Chromium both ways:

  • ha-icon-picker defined → the dropdown is used; picking mdi:home fires config-changed with the new icon.
  • ha-icon-picker undefined → falls back to the native Icon (mdi:…) input; no errors.

bash build.sh + node test/smoke.js green.

VERSION 0.16.4 → 0.16.5.

🤖 Generated with Claude Code


Generated by Claude Code

The shared _tf() editor helper built text/number fields with `ha-textfield`.
That Home Assistant element isn't guaranteed to be registered in every frontend
build; when it's missing it renders as an empty invisible custom element, so
every text field silently vanished from the visual editors — Title, Name, Icon,
Unit, Decimals, Bar max, Energy label, History window. The controls that still
showed use ha-entity-picker, native <select>, and ha-switch, which were loaded.

Rewrite _tf() to render a native <input class="tf"> inside a labelled .field
wrapper, matching the native <select class="sel"> already used for dropdowns.
Same API (type, suffix); add .tf/.tf-row/.tf-suffix styles; drop the obsolete
ha-textfield style rule. Fixes invisible text fields across every Prism card
editor, not just the power card.

Verified in Chromium with ha-textfield deliberately undefined: all fields now
render and editing the title fires config-changed. VERSION 0.16.3 -> 0.16.4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014cpNPVU8j1iiU9CnXgr5JY
@ryanbuiltthat
ryanbuiltthat merged commit 6ce352c into main Jul 21, 2026
0 of 2 checks passed
@ryanbuiltthat
ryanbuiltthat deleted the claude/prism-smart-dashboard-card-rjlks3 branch July 21, 2026 23:14
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.

2 participants