Skip to content

perf(web): pause plan, heating, settings, and card polls when the tab is hidden #1141

Closed

Description

@frahlg

#881 covers chart and energy-flow animation while a view is hidden. Status polling in app.js now respects document.hidden. Several other dashboard pollers do not.

Found on master 6eadec3f while checking leftover #881 work. This is not a duplicate of #881: that issue explicitly left polling, settings, and routing out of scope.

What still runs while the tab is hidden

Surface Cadence File
Energy-flow particles rAF, no document.hidden web/components/ftw-energy-flow.js (still #881)
Plan panel 30s × ~6 fetches, including full /api/config web/plan.js
Heating 30s web/heating.js
History / savings cards 5 min web/components/ftw-history-card.js, ftw-savings-card.js
Price chart 5 min web/components/ftw-price-chart.js
Loadpoints / twins / models 10s while advanced web/loadpoints.js, web/twins.js
Settings HA / EV / system 5s, not cleared on close web/settings/tabs/*.js

web/dashboard-poll-visibility.test.mjs only asserts document.hidden for the status/live-history path. web/components/ has no visibility checks.

Plan's /api/config every 30s is the worst: whole document, secrets masked, still large, still SQLite (and still DuckDB after #1129).

Settings tab timers keep firing after the modal closes.

What a fix needs

If visibility detection fails, keep polling rather than leave stale UI.

Related: #881 (animation loops). Keep that issue for chart/energy-flow paint; use this one for network polls.

Activity

  1. frahlg commented on Oct 18, 2026

    @frahlg
    MemberAuthor

    The implementation and behavioral regressions from #1177 already landed through #1225 (e5f281fe). Current Plan/heating/Settings/card pollers retain their visibility handling; the current full web suite passes. Closing #1177's obsolete branch and this polling issue. #881's route/layer animation work and performance evidence remain separate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions