fix: prevent panel unmount on extended tab inactivity#135
Merged
Conversation
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
Problem
The liebe-panel was still being unmounted/removed by Home Assistant when the tab was inactive for extended periods (e.g., when the tab is not visible for a while). This was despite the previous fix in PR #132.
Solution
Keep-Alive Mechanism: Added a periodic check (every 30 seconds) that:
MutationObserver: Implemented a parent observer that:
Enhanced Initialization:
Comprehensive Logging: Added detailed logging throughout the lifecycle to help debug any future issues
Testing
npm run build:haRelated Issue
This addresses the ongoing issue where the panel disappears after extended periods of tab inactivity.
Previous Attempt
PR #132 addressed tab switching but didn't fully resolve the issue for extended inactive periods.