Skip to content

Editor text fields: use native input instead of ha-textfield — v0.16.4#31

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

Editor text fields: use native input instead of ha-textfield — v0.16.4#31
ryanbuiltthat merged 1 commit into
mainfrom
claude/prism-smart-dashboard-card-rjlks3

Conversation

@ryanbuiltthat

Copy link
Copy Markdown
Owner

Bug

In the power card's visual editor, every text field was missing — Title, Name, Icon, Unit, Decimals, Bar max, Energy label, History window. Only the entity pickers, the accent/mode dropdowns, and the switches showed. So there was no way to set a title (or any other text option) from the UI.

Cause

The shared _tf() editor helper built its fields with ha-textfield. That Home Assistant element isn't guaranteed to be registered in every frontend build — and in the affected instance it was undefined, so each field rendered as an empty, invisible custom element and silently disappeared. The controls that survived use ha-entity-picker, native <select>, and ha-switch, which were loaded.

Fix

Rewrote _tf() to render a native <input class="tf"> inside a labelled .field wrapper — the same native-element approach already used for the dropdowns (<select class="sel">). Same API (type, suffix); added .tf / .tf-row / .tf-suffix styles; removed the now-unused ha-textfield style rule.

This fixes the invisible text fields across all 22 card editors, not just the power card.

Testing

  • Rendered the power card editor in Chromium with ha-textfield deliberately left undefined (reproducing the user's environment): all 8 text fields now render (visible, ~41px), and typing into Title fires config-changed with the new title.
  • bash build.sh + node test/smoke.js green.

VERSION 0.16.3 → 0.16.4.

🤖 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 ac1ce23 into main Jul 21, 2026
1 check failed
@ryanbuiltthat
ryanbuiltthat deleted the claude/prism-smart-dashboard-card-rjlks3 branch July 21, 2026 23:06
@ryanbuiltthat
ryanbuiltthat restored the claude/prism-smart-dashboard-card-rjlks3 branch July 21, 2026 23:13
@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