v0.6.2
[0.6.2] — 2026-07-03
Fixes a real bug in the v0.6.1 threshold color-palette popover, reported
with a screenshot right after v0.6.1 shipped: the popover opened hundreds
of pixels off to the side, half off-screen.
Fixed
- The threshold color-palette popover opened far off to the side (or was
invisible entirely) when used inside HA's real card-edit dialog. Root
cause was two-fold, and only reproducible inside the real dialog —
palette_check.mjs's standalone-mounted panel (no<dialog>ancestor)
never exercised either path:- HA's dialog nests a native
<dialog>two shadow roots deep
(ha-dialog→wa-dialog→<dialog>), and that<dialog>carries
transform: matrix(1,0,0,1,0,0)— an identity matrix with no visible
effect, but per the CSS spec any transform value other thannone
still establishes a new containing block forposition: fixed
descendants. The popover'stop/left(computed from viewport-relative
coordinates) were being applied relative to that dialog's own top-left
corner instead of the viewport, and clipped by itsoverflow: hidden. - The dialog is shown via
showModal(), promoting it to the browser's
"top layer" — nothing outside it can paint above it regardless of
z-index, so naively fixing #1 by rendering the popover into a portal
ondocument.bodymade it correctly positioned but fully invisible,
hidden behind the modal.
Fixed by rendering the popover into a portal appended as a child of the
nearest open modal<dialog>ancestor when one exists (found by walking
the flattened DOM tree — piercing shadow hosts and<slot>assignments,
not justparentElement) — keeping it in the top layer — with position
computed relative to that dialog's own rect instead of the viewport's,
since the dialog is now deliberately its containing block. Falls back to
document.bodywith viewport-relative positioning when there's no dialog
ancestor (e.g. used standalone, as inpalette_check.mjs). Verified
against a live HA instance across six viewport sizes (1920×1080 down to
800×600) and with a new permanent regression check that opens the real
dialog and confirms the popover isn't just present in the DOM but
genuinely clickable at its rendered position, piercing shadow roots via
nestedelementFromPointcalls
(tools/sandbox/harness/dialog_popover_check.mjs).
- HA's dialog nests a native
What's Changed
- Fix threshold color-palette popover mispositioned/invisible in the re… by @DerTrolli in #23
Full Changelog: v0.6.1...v0.6.2