I’m wondering if anyone has experiemce with custom panel lifecycles, specifically disappearing due to inactive tab browser throttling.
Background: I’m building a custom integration called Object Registry — an in-memory named JSON object store that lets automations and scripts look up reusable mapping data at runtime via service calls. A concrete use case: mapping ISY/Eisy remote button events to Hue light actions without hardcoding relationships across dozens of automations. The panel provides full CRUD management with live concurrent-edit detection, real-time list updates via WebSocket, validation, and rename warnings. I initially explored a subentry/config flow approach but couldn’t find a clean solution for inline JSON editing in that flow, which drove the decision to build a custom sidebar panel instead.
Repository: ferventgeek/ha-object-registry
Context: The integration uses panel_custom with embed_iframe=False and a vanilla HTMLElement . Everything works great when the tab is active. But, after ~5 minutes in a background tab, Chrome throttles JS execution and the panel goes blank.
What I’ve diagnosed:
Through DOM inspection and console logging I’ve confirmed:
- After background throttling,
<ha-panel-custom>becomes completely empty —<object-registry-panel>is removed from the DOM entirely - While the tab is active,
set hassfires continuously (HA state heartbeat) — confirmed via logging - After throttling,
set hassstops firing (Chrome suspended execution) - On tab return,
set hassresumes but the element is already gone — nothing to receive it visibilitychange+pushState/popstatenavigation workaround fires but doesn’t triggerpartial-panel-resolverto remount the element- Clicking any other sidebar item and returning immediately fixes it —
partial-panel-resolverremounts cleanly
Question: Is there a supported lifecycle hook or event we should listen to that signals partial-panel-resolver is remounting a panel? Or is there a way to prevent ha-panel-custom from being emptied during background throttling?
I’d considered trying to hook into the visibility status change on the DOM, then trying to force a refresh. That would lose any edits in the editor by reloading the list view, but feels hacky and brittle to maintain:
if (!window._objectRegistryVisibilityHandler) {
window._objectRegistryVisibilityHandler = () => {
if (document.visibilityState !== "visible") return;
if (window.location.pathname !== "/object_registry") return; // only our panel
const current = window.location.pathname;
window.history.pushState(null, "", "/");
window.history.pushState(null, "", current);
window.dispatchEvent(new PopStateEvent("popstate"));
};
document.addEventListener("visibilitychange", window._objectRegistryVisibilityHandler);
}
HA version: 2026.4 Panel registration: panel_custom.async_register_panel with embed_iframe=False
Thanks again for any suggestions!