Fix compatibility with Home Assistant 20260304.0 - #119
Open
fmierlo wants to merge 1 commit into
Open
Conversation
- Replace ha-md-menu/ha-md-menu-item with ha-dropdown/ha-dropdown-item and use .open=true instead of removed .show() method - Replace mwc-button with ha-button - Add _openingMenu flag and wa-after-hide handler to prevent dropdown drifting to top-left after page re-renders - Cache _columnsToDisplay by narrow to prevent unnecessary ha-data-table re-renders and lit-virtualizer range changes - Replace _rows getter with _tableRows @State updated only in loadData() so ha-data-table receives a stable data reference between reloads - Extract connect() to load config/registry once; loadData() now fetches tags and tasks, setting all state synchronously to avoid intermediate empty renders that caused lit-virtualizer to miss visible items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tasks
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.
Summary
Home Assistant 20260304.0 removed several UI components and APIs that this integration relied on, causing the actions menu to break and buttons to disappear. This PR updates the panel to use the current HA component API.
Resolves: #118
Changes
Broken component replacements
ha-md-menu→ha-dropdownandha-md-menu-item→ha-dropdown-item: theha-md-menucomponent was removed in 20260304.0. The actions menu now usesha-dropdownwith@wa-selectfor item handling and.open = trueinstead of the removed.show()method.mwc-button→ha-button: replaced all uses of the deprecated Material Web Component button.Dropdown anchor stability
Added
_openingMenuflag with@wa-after-show/@wa-after-hideevent handlers on the dropdown to properly clearanchorElementwhen the menu closes. Without this, the dropdown drifted to the top-left corner after any page re-render because the anchor button (insideha-data-tablerows) was recreated bylit-virtualizer.Prevent unnecessary re-renders
_columnsToDisplayis now cached bynarrowvalue, returning a stable object reference toha-data-tableunless the layout actually changes._rowsgetter →_tableRows@state(): table rows are now computed once perloadData()call instead of on every render. This preventsha-data-tablefrom seeing a changeddatareference on every parent render, which was causinglit-virtualizerto fire constantrangeChangedevents and recreate all row elements.Data loading improvements
connect()to load config, registry, and label registry once on component mount.loadData()now fetches tags and tasks first and then sets all state synchronously, ensuring LitElement batches everything into a single render. This preventsha-data-tablefrom briefly rendering with empty data (which causedlit-virtualizerto initialize with an empty range and fail to display rows when the table was initially off-screen).Testing