[HOMEASSIST-4] panel_custom element wrapper and HA types in packages/ui #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/HOMEASSIST-4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket
HOMEASSIST-4 Dashboards: panel_custom element wrapper and HA types in packages/ui
Summary
definePanel(name, Component, { styles })in@ha-dashboards/ui/panel: shadow root + injected CSS string, React mount, hass/narrow/route/panel forwarded via context; render waits for hass and panel, coalesced into one root.render, deferred unmount so same-task detach/reattach keeps the tree.useHass(),useEntity(id),usePanel()hooks; HA types extended (user,language,PanelRoute,PanelInfo,PanelProps).ha-map-panel(the Lovelace cardha-map-cardis replaced, per decision); build:card now emitsha-map-panel.js.document.createElement); host sizing is:hostCSS.panel_customentry in HA config and the deploy-script cleanup of the oldha-map-card.js(HOMEASSIST-6); real-browser/HA verification is deferred to that ticket since happy-dom does not enforce the createElement attribute rule.🤖 Generated with Claude Code
@ -62,0 +63,4 @@callService,user: { id: 'dev-user', name: 'Dev', is_admin: true },language: 'en',};Are
dev-userandDevsignificant? Do I need to create an account with HA to use these or something? Unclear what they're for.@ -62,0 +63,4 @@callService,user: { id: 'dev-user', name: 'Dev', is_admin: true },language: 'en',};Re: "Are
dev-userandDevsignificant?"No. They are placeholder values and don't correspond to any Home Assistant account; you don't need to create anything.
HomeAssistant.useris a required field on the type (packages/ui/src/types/hass.ts), so the dev harness has to supply some value to typecheck. Nothing in the map panel reads it. In production the realhassobject from HA carries the logged-in user, and this harness (dev-only,bun run dev) never ships.I can add a short comment in
DevHarness.tsxsaying so if that would help.--Claude