Skip to content

Wait for the panel to load in the sidebar, and say when it cannot - #47

Merged
cayossarian merged 3 commits into
mainfrom
feat/sidebar-wait-for-load
Nov 24, 2026
Merged

cayossarian merged 3 commits into
mainfrom
feat/sidebar-wait-for-load

Conversation

@cayossarian

Copy link
Copy Markdown
Member

What

The sidebar dashboard now behaves the way the card does since #46. While Home Assistant starts, a panel is in setup retry, or the connection is lost, every view waits and draws once the panel's entry loads. A panel whose entry failed to set up or is disabled says so, in the card and in the sidebar.

Changes

  • Waiting views: By Panel, Activity, Area, Monitoring, Adopted and Favorites show "Waiting for SPAN Panel to load..." instead of red error text, an error toast, monitoring shown as off, or "No circuits found", and redraw through the existing entry-load handling.
  • Monitoring: reads the topology before the monitoring status, because the integration answers "off" for a panel that hasn't loaded.
  • Status watch: a watch that failed at startup now starts on load, and a panel switch clears the previous panel's watch.
  • Entry states, in a shared module (core/entry-load.ts): loading (not_loaded, setup_in_progress, setup_retry, unload_in_progress), loaded, setup failed (setup_error, migration_error, failed_unload), or disabled. Failure states and a disabled entry show an alert saying where to fix it, and the panel still draws when the entry loads, as after a reauth. config_entries/subscribe statuses now carry disabled_by.
  • Unknown owner after a lost connection: a card whose device list was refused by a lost connection looks its entry's owner up again once the connection is back.
  • Panel list: asks only on the first hass or after a lost connection, and waits out a lost connection with no retries or toast.
  • Removed, because no production state reaches them:
    • the panel list's refusal path with its Retry;
    • the subscription-failure handlers in the card and the sidebar;
    • the bare lost-connection code that websocket library 9.8.0 never sends;
    • no_data as a wait;
    • every superseded() render check, since tab renders run one at a time;
    • Adopted's stale-read path.
  • The version is 0.12.1-beta.2, and dist/ is rebuilt in its own commit.

Changelog (0.12.1, Fixed)

  • The sidebar dashboard, opened while Home Assistant is starting or restarting or while the integration retries a panel it cannot reach, says it is waiting for the panel to load and draws the panel once it has loaded, where it showed errors, monitoring as off or missing favorites meanwhile, and could miss the panel's unreachable warning.
  • A SPAN Panel card or the sidebar dashboard whose panel failed to set up, as when it must be authenticated again, or is disabled, says so and where to set it right, and draws the panel once it has loaded, where the card showed "Unable to connect to SPAN Panel" and the sidebar "SPAN Panel integration is not loaded", monitoring as off or no favorites.

Tests

  • New tests/span-panel-entry-wait.test.ts and tests/entry-load.test.ts cover each view across each waiting refusal and entry state: drawing on load and on a reconnect re-seed, removal, panel and tab switches, the Favorites removal race, and the Adopted detach.
  • The card's wait tests are extended for the entry states and the owner re-lookup.
  • npm test: 1812 passed, exit 0, no unhandled errors. Lint, typecheck and i18n validation are clean.

…y when it cannot

While Home Assistant starts, a panel is in setup retry, or the connection is
lost, every sidebar view now shows the waiting line instead of an error, an
"off" monitoring status or "No circuits found", and draws once the entry loads.
A panel whose entry failed to set up or is disabled says so, in the card and
the sidebar, where both used to wait or fail without saying why.

The entry-state rules live in one shared module (core/entry-load.ts), which the
card and the sidebar both use. Paths that no production state reaches are
removed: the panel list's refusal path, test-only subscription-failure
handlers, and render-supersede checks that the one-at-a-time scheduler makes
unreachable.
@cayossarian
cayossarian merged commit a433e28 into main Nov 24, 2026
2 checks passed
@cayossarian
cayossarian deleted the feat/sidebar-wait-for-load branch November 24, 2026 00:30
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