Repository navigation
Work again on Home Assistant 2026.8 and 2026.9, modern toolchain, release baseline - #1
Merged
Merged
Conversation
…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.
|
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 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-*-yamlkeys), a failed theme lookup now degrades to no theme styles instead of no styles at all, the more-info dialog is patched throughha-adaptive-dialog, dialog selectors match the adaptive dialog and popover, the developer-tools panel patch is replaced byha-panel-toolswith the old theme keys kept as aliases,ha-drawerstyling is enabled, and thecm_updatelistener 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 todist/card-mod.jsandhacs.jsonnames it.Verification checklist
npm run lint,npm test(32 passed, 1 offline skip),npm run build; second build leavesdist/unchangednpm audit --audit-level=moderatecleanpython scripts/build_release_artifacts.py --validate-onlyprints 2026.09.08.1Risk 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