perf(polling): pause health/RPC polls when island isn't focused #22

Merged
zaelgohary merged 2 commits from development_perf_pause_polls_when_defocused into development 2026-04-29 19:29:48 +00:00
Member

Summary

Pause /health and /rpc polls when this island isn't the focused window in the hero_os shell.

Closes #23

Changes

  • Migrated polling loops to use_focus_poll
  • Threaded window_id prop through navbar + tabs

Test Results

hero_os focus_pause.spec.ts passes (47s).

Depends on

hero_archipelagos PR #194.

## Summary Pause /health and /rpc polls when this island isn't the focused window in the hero_os shell. ## Related Issue Closes #23 ## Changes - Migrated polling loops to use_focus_poll - Threaded window_id prop through navbar + tabs ## Test Results hero_os focus_pause.spec.ts passes (47s). ## Depends on hero_archipelagos PR #194.
perf(polling): pause health/RPC polls when island isn't focused
Some checks failed
CI / cargo test (pull_request) Failing after 4s
CI / cargo check + clippy (pull_request) Failing after 4s
Build and Test / build (pull_request) Failing after 2m14s
3c5cc6301f
Native islands ran their use_future polling loops on a fixed
cadence regardless of whether the user was looking at them.
With multiple islands open in a saved space this drove ~14k
needless requests/hour against backends.

Each polling site now uses hero_archipelagos_core::use_focus_poll,
which gates the body on is_window_focused(window_id). When the
window's class flips off window-shadow-focused, the body is
skipped; the interval keeps ticking so polling resumes within
one cycle of refocus.

connection-status.js (iframe-mode fallback) gains a parallel
parent-DOM check so iframe pages also pause when their containing
window isn't focused.

Depends on hero_archipelagos PR 194.
zaelgohary force-pushed development_perf_pause_polls_when_defocused from 3c5cc6301f
Some checks failed
CI / cargo test (pull_request) Failing after 4s
CI / cargo check + clippy (pull_request) Failing after 4s
Build and Test / build (pull_request) Failing after 2m14s
to a441d40cb3
Some checks failed
Build and Test / build (pull_request) Failing after 2m37s
CI / cargo check + clippy (pull_request) Failing after 2m7s
CI / cargo test (pull_request) Failing after 2m32s
2026-04-29 19:09:26 +00:00
Compare
chore(deps): bump hero_archipelagos for use_focus_poll
All checks were successful
Build and Test / build (pull_request) Successful in 6m11s
CI / cargo check + clippy (pull_request) Successful in 1m50s
CI / cargo test (pull_request) Successful in 1m55s
29bf922f40
zaelgohary merged commit 92f81671cf into development 2026-04-29 19:29:48 +00:00
zaelgohary deleted branch development_perf_pause_polls_when_defocused 2026-04-29 19:29:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_db!22
No description provided.