Skip to content

fix(sidebar): add method to handle sidebar DOM updates during Home Assistant state changes#76

Merged
ngocjohn merged 2 commits intodevfrom
sidebar-config-not-reflected
Feb 18, 2026
Merged

fix(sidebar): add method to handle sidebar DOM updates during Home Assistant state changes#76
ngocjohn merged 2 commits intodevfrom
sidebar-config-not-reflected

Conversation

@ngocjohn
Copy link
Copy Markdown
Owner

@ngocjohn ngocjohn commented Feb 18, 2026

Implement a method to prevent sidebar updates when Home Assistant is not running, avoid unnecessary re-renders.

closes: #73

@ngocjohn ngocjohn self-assigned this Feb 18, 2026
@ngocjohn ngocjohn marked this pull request as ready for review February 18, 2026 21:01
Copilot AI review requested due to automatic review settings February 18, 2026 21:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses issue #73 where the sidebar configuration was not being reflected correctly due to Home Assistant state changes during startup. The PR implements safeguards to prevent sidebar updates when Home Assistant is not fully running, avoiding unnecessary re-renders and configuration loss.

Changes:

  • Added HA_STATE enum and validation to prevent sidebar operations when Home Assistant is not in RUNNING state
  • Implemented a shouldUpdate override on the ha-sidebar component to block re-renders during HA startup
  • Enhanced diff checking with href validation to detect invalid sidebar items
  • Improved configuration processing order by moving settings manipulation after new items are added

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/constants/dom.ts Added HA_STATE enum with state constants and SHOULD_UPDATE_PROPS (unused)
src/sidebar-organizer.ts Added state checking in run() method, shouldUpdate override for ha-sidebar, improved diff validation, reordered config processing
src/utilities/model/store.ts Added _haNotRunningToast() method to notify users when HA is starting up, added BOTTOM_GRID to config update
src/components/sidebar-dialog.ts Improved console logging formatting for consistency

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sidebar-organizer.ts Outdated
Comment thread src/sidebar-organizer.ts Outdated
Comment thread src/sidebar-organizer.ts
Comment thread src/constants/dom.ts Outdated
Comment thread src/sidebar-organizer.ts
@ngocjohn ngocjohn merged commit d3c2833 into dev Feb 18, 2026
2 checks passed
@ngocjohn ngocjohn deleted the sidebar-config-not-reflected branch February 18, 2026 21:11
github-actions Bot pushed a commit that referenced this pull request Feb 18, 2026
## [3.0.2-beta.1](v3.0.1...v3.0.2-beta.1) (2026-02-18)

### Bug Fixes

* **sidebar:** add method to handle sidebar DOM updates during Home Assistant state changes ([#76](#76)) ([d3c2833](d3c2833)), closes [#73](#73)
@github-actions
Copy link
Copy Markdown

πŸŽ‰ This PR is included in version 3.0.2-beta.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions Bot pushed a commit that referenced this pull request Feb 20, 2026
## [3.0.2](v3.0.1...v3.0.2) (2026-02-20)

### Bug Fixes

* **download:** update download method for companion app integration ([#79](#79)) ([7571f2e](7571f2e))
* **sidebar:** add method to handle sidebar DOM updates during Home Assistant state changes ([#76](#76)) ([d3c2833](d3c2833)), closes [#73](#73)
@github-actions
Copy link
Copy Markdown

πŸŽ‰ This PR is included in version 3.0.2 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants