Skip to content

fix: review sweep — target-republish re-apply, icon restore, unload cleanup, HA 2026.8 interop - #17

Merged
jpettitt merged 6 commits into
mainfrom
fix/review-sweep-2026-8
Aug 4, 2026
Merged

jpettitt merged 6 commits into
mainfrom
fix/review-sweep-2026-8

Conversation

@jpettitt

@jpettitt jpettitt commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes the two injector gaps found in a full review against HA 2026.8: explicit-source rules lost their decoration whenever the target's own integration republished state (nothing re-applied until the source next changed), and release popped the icon attribute outright, dropping icon-customized entities to the domain default glyph. The injector now tracks resolved targets and restores the owner's pre-rule icon on release.
  • Entry unload now removes the sidebar panel and painter extra-JS registration; validation gains 255-char caps on decoration values/mapping keys; rules dropped at load log a WARNING instead of vanishing.
  • Documents and pins HA 2026.8 interop: the entities card now manages inline icon color for all domains (frontend PR #53151); painter tests pin the Lit part-order that keeps decorations winning, README gains an interop section, and DESIGN/TODO are reconciled with as-built behavior.

Test plan

  • .venv/bin/pytest -q — backend tests pass (143, up from 131; also green against HA 2026.8.0b3 in a separate venv)
  • cd frontend && npm run typecheck — zero TypeScript errors
  • cd frontend && npm test — frontend tests pass (118)
  • cd frontend && npm run build — committed bundles match a fresh build

Manual / UI verification: dev container on HA 2026.8.0b4 (rc image): explicit-source decoration survives target toggles across entities/glance/tile cards; rule color beats per-row color: and 2026.8 default state colors; color: none behaves; disable/delete restores the helper's own mdi:lamp icon immediately; integration removal drops the sidebar panel without restart.

Risk

  • Behavior change: while an icon-setting rule is active it re-asserts over a target-integration icon write immediately (previously at the next source change). Clear-time non-clobber is unchanged and tested.
  • Target tracking widens the state subscription; re-entrancy stays convergent via the existing pre-flight no-op check.
  • The 2026.8 color win depends on state-badge template part order — pinned by test, called out in painter.ts.

Suggested follow-ups in human-only files (per AGENTS.md, not touched here): release.yml tag↔manifest version gate; AGENTS.md test count 100→143; min_ha_version manifest key is unread by HA (hacs.json is the floor).

Docs touched

  • README.md
  • CHANGELOG.md
  • TODO.md
  • DESIGN.md
  • docs/examples.md

🤖 Generated with Claude Code

jpettitt and others added 6 commits August 3, 2026 19:02
Both survived unload until restart; re-adding the entry re-registered
the same panel path. Static path registration stays (HA has no removal
API; harmless).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lease

Two halves of the same subscription gap:

- Explicit-source rules only subscribed to sources, so a target
  integration's own state write (which rebuilds the attribute bag)
  wiped the decoration until the source next changed. Track resolved
  targets too and re-apply on their events; the pre-flight no-op check
  keeps re-entrancy convergent. Also fixes late-appearing literal
  targets of explicit-source rules.
- Release popped the icon attribute outright, dropping entities with
  their own icon (helper icon:, integration-published) to the domain
  default glyph until their next republish. Record the owner's icon at
  claim time (refreshed when the owner republishes mid-rule) and write
  it back on release; pop only when no original existed.

Behavior change: an active icon-setting rule now re-asserts over a
target-integration icon write immediately rather than at the next
source change. Clear-time guarantee (never touch a value we didn't
write) is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rules

Decoration values and mapping keys get the same 255-char bound as
source_attribute (icon is recorder-persisted). Rules failing
validation at load now log WARNING with id/targets/reason — with
PREVENT_EXTRA, a downgrade silently discarded rules written by a
newer version.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
'Saved N rules.' rendered in the error banner with role=alert; now a
success-styled role=status notice. Class comment claimed whole-config
export keeps ids — it strips them (identity re-mint is a TODO item).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Since frontend PR #53151 the entities card manages inline color on
ha-state-icon for all domains. We win only because the styleMap part
commits before the stateObj part; pin that with tests for the
decorated and undecorated cases and document the dependency and the
release-time styleMap staleness edge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README: 2026.8 state-color interop, registry-icon glyph limitation,
compat floor aligned to hacs.json, drop inaccurate debounce claim.
DESIGN: PREVENT_EXTRA reality, immediate saves, politeness marked
not-implemented, injector target-tracking + icon restore. TODO: open
decisions (ALLOW_EXTRA, YAML ids, evaluator parity) and suggested
changes to human-only files. CHANGELOG: Unreleased section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jpettitt
jpettitt merged commit a0fda65 into main Aug 4, 2026
2 checks passed
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.

1 participant