Skip to content

馃馃馃 Restore disabled chart entities after refresh - #81

Merged
buggedcom merged 1 commit into
mainfrom
codex/restore-chart-visibility
Oct 12, 2026
Merged

buggedcom merged 1 commit into
mainfrom
codex/restore-chart-visibility

Conversation

@buggedcom

@buggedcom buggedcom commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refreshing a page with disabled entities restores the target rows, but the chart renders those entities because setConfig runs before the inner chart exists. Seed its saved visibility when the card first mounts; keep later redraws from overwriting user interactions.

configure card before mount
  store saved hidden entities
mount inner chart
+ apply saved chart view state
  draw history

Includes a regression spec, a Storybook interaction scenario, and the rebuilt bundle.

Evidence

  • Before: The configure-before-mount regression failed (expected false to be true). Chrome DevTools on the supplied HA URL showed five disabled entities in the card but an empty hidden-entity set in the chart.
    After: 68 focused unit tests and all 5 history-card stories pass. Temporarily applying the missing initial view state in the authenticated HA browser correctly hides all five entities. A browser replay of the captured HA history payload with configuration set before mounting draws exactly the two enabled temperature series and only the enabled sauna-door row. Disabling the mount fix reproduces five temperature series and an extra heating row. The running HA card still has no _syncChartViewState, so the built bundle has not been deployed to HA.
  • pnpm build, pnpm sb:build, pnpm format, pnpm lint:types, and pnpm lint pass.

Merge Danger

Door: Two-way

Blast Radius: History

Initial saved chart view state only. Ordinary renders preserve live visibility changes.

@buggedcom
buggedcom merged commit 85f534f into main Oct 12, 2026
15 of 16 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