Skip to content

Work again on Home Assistant 2026.8 and 2026.9, modern toolchain, release baseline - #1

Merged
trooperthorn merged 13 commits into
mainfrom
ha-dev/card-mod-20260908
Sep 8, 2026
Merged

trooperthorn merged 13 commits into
mainfrom
ha-dev/card-mod-20260908

Conversation

@trooperthorn

Copy link
Copy Markdown
Owner

Change

Fixes card-mod on Home Assistant 2026.8 and 2026.9: theme YAML sections are parsed with js-yaml instead of a detached developer-tools router that no longer exists (the cause of every style silently stopping when a theme has card-mod-*-yaml keys), a failed theme lookup now degrades to no theme styles instead of no styles at all, the more-info dialog is patched through ha-adaptive-dialog, dialog selectors match the adaptive dialog and popover, the developer-tools panel patch is replaced by ha-panel-tools with the old theme keys kept as aliases, ha-drawer styling is enabled, and the cm_update listener no longer leaks on detached nodes. Merges the unmerged upstream 2026.4 dialog fixes. Ports upstream PR thomasloven#610 (skip unstyled elements and idle icons) and UIX's theme-lookup coalescing. Replaces rollup 2 plus Babel with rollup 3 and TypeScript 5.6 strict, adds vitest with 32 tests including a hook-contract test against frontend tag 20260826.6, and applies the SHA-pinned validate, security, release, and prepare-release workflows with .release.json, SECURITY.md, CODEOWNERS, dependabot, and the docs set. Borrowed UIX code is MIT and recorded in docs/THIRD_PARTY.md with both copyright lines in LICENSE.txt.

Compatibility: element name, card_mod: key, and theme keys are unchanged; the shipped file moves from the repo root to dist/card-mod.js and hacs.json names it.

Verification checklist

Risk and rollback

A theme parse failure now logs a collapsed console group and continues. Rollback is re-adding the upstream repository in HACS; keys and element names are identical.

🤖 Generated with Claude Code

dcapslock and others added 13 commits March 30, 2026 23:25
…g params, notification-manager patch

Keeps the source fixes from the v4.2.1-202604 prerelease branch. The branch's package.json version bump and rebuilt card-mod.js are not taken; the bundle is regenerated by the new toolchain.
Theme YAML keys are parsed with js-yaml (YAML 1.1 schema, mapping root
required, line-marked error and empty result on failure) instead of a
detached partial-panel-resolver and developer-tools-router surrogate, which
no longer resolve since the developer tools moved under ha-panel-config as
ha-panel-tools. A failed theme lookup no longer blocks card_mod config
styles: get_theme errors and the themesReady timeout fall back to an empty
theme with one warning.

ha-more-info-dialog is styled through ha-adaptive-dialog with ha-dialog as
fallback. The dialog patch adds ha-adaptive-popover and drops ha-md-dialog
and ha-wa-dialog, which do not exist in frontend 20260826.6. The
ha-panel-developer-tools patch becomes ha-panel-tools with theme type
"tools"; card-mod-developer-tools and card-mod-developer-tools-yaml stay
valid as aliases. The ha-drawer patch is enabled. The cm_update listener
is registered in connectedCallback and removed once a node stays detached.
stripHtmlAndFunctions returns undefined for a true cycle and keeps shared
references, with tests. hacs.json declares the filename and a 2026.8.0
floor. package-lock.json is regenerated with the toolchain change.
… vitest

Babel and rollup-plugin-terser are gone; the bundle is an ES module built
by @rollup/plugin-typescript, node-resolve, commonjs, json and
@rollup/plugin-terser into dist/card-mod.js, which is committed. The root
card-mod.js is removed because hacs.json names the file. strict mode is on
with noImplicitAny off; the type fixes are annotations only. Unused
simple-hash helper removed. package-lock.json regenerated.
Ports upstream PR thomasloven#610: a theme key index (theme_index) and an icon-variable
tracker (icon_usage) let apply_card_mod return early for elements with no
card_mod config, no earlier card-mod element and no theme key for their
type, and let the icon patches skip getComputedStyle until a style uses
--card-mod-icon. The index follows the developer-tools alias and lets
card-mod-<type>-debug keys through. get_theme coalesces concurrent calls
per element, waits for the next animation frame before reading computed
style, and follows a card-mod-theme key to another theme. Icon binding
stops for detached elements and dedupes in-flight work. The entities
patch checks the row is an Element. Glance entity styles match frontend
20260826.6.
Fetches frontend 20260826.6 over HTTPS and asserts each patched private
method, selector and element tag still exists, so a frontend release breaks
CI instead of dashboards. Skips when the tag is unreachable or
CARD_MOD_OFFLINE=1.
.release.json, the three release scripts, validate, security, release and
prepare-release workflows with SHA-pinned actions, dependabot, CODEOWNERS,
pull request template and SECURITY.md with card-mod's boundaries. The
upstream stale workflow and issue label bot config are removed.
@rollup/plugin-terser 1.0.0 and vitest 5 replace the versions with open
advisories so npm audit at moderate level passes.
README rewritten for the fork (install, extra_module_url, switching from
upstream, what changed versus 4.2.1); the upstream styling reference moves
to docs/usage.md; docs/ adds design, decisions, operations, security,
quality-scale, backlog and THIRD_PARTY; LICENSE.txt carries both copyright
lines; CHANGELOG starts at 2026.09.08.1. Code comments trimmed to one-line
constraints with rationale moved to docs/design.md; the dead get_paths
block in main.ts is removed.
@trooperthorn
trooperthorn merged commit 1d7d16a into main Sep 8, 2026
11 checks passed
@trooperthorn
trooperthorn deleted the ha-dev/card-mod-20260908 branch September 8, 2026 07:56
@vanackej

Copy link
Copy Markdown

Hi @trooperthorn

I just saw you mentionned one of the pull requests I made on the original integration repository.

I submitted 2 other performances related PR, don't know if they are covered by the changes you made since you fork the card, let me know if you want me to have a look and contribute them here !

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.

3 participants