Skip to content

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

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#33
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.

Note: this re-lands v0.16.5. The previous attempt (PR #32) accidentally pushed a stale branch, so that merge was a no-op and this content never reached main. This PR carries the actual icon-picker change.

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

…— v0.16.5

Add a shared _iconField() helper on PrismEditor that renders HA's searchable
ha-icon-picker when that element is registered in the frontend, falling back to
the native text input otherwise (same defensive pattern as the ha-textfield fix
— a missing custom element would render invisible). set hass / _rerender now
also propagate hass to ha-icon-picker.

Switch the seven "Icon (mdi:…)" text fields (stat, power, cover, linear-gauge,
switch, light cards + the entities-card row editor) to _iconField. The `icon`
config key and card rendering are unchanged.

Verified in Chromium both ways: with ha-icon-picker defined the dropdown is used
and picking an icon fires config-changed; without it the native input fallback
renders. VERSION 0.16.4 -> 0.16.5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014cpNPVU8j1iiU9CnXgr5JY
@ryanbuiltthat
ryanbuiltthat merged commit 41fbd20 into main Jul 21, 2026
1 check failed
@ryanbuiltthat
ryanbuiltthat deleted the claude/prism-smart-dashboard-card-rjlks3 branch July 21, 2026 23:15
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