perf(core): add use_focus_poll hook + focus class consts #194

Merged
zaelgohary merged 1 commit from development_perf_pause_polls_when_defocused into development 2026-04-29 19:12:23 +00:00
Member

Summary

Adds a shared focus-aware polling helper so each island app stops re-implementing the DOM check + poll-loop boilerplate.

Closes #195

Changes

  • Added is_window_focused + use_focus_poll
  • Added WINDOW_FOCUSED_CLASS + WINDOW_UNFOCUSED_CLASS
  • Added gloo-timers to workspace + core

Test Results

Used by hero_os PR #114 and 9 island app PRs; each verified via the focus_pause smoke test.

## Summary Adds a shared focus-aware polling helper so each island app stops re-implementing the DOM check + poll-loop boilerplate. ## Related Issue Closes #195 ## Changes - Added is_window_focused + use_focus_poll - Added WINDOW_FOCUSED_CLASS + WINDOW_UNFOCUSED_CLASS - Added gloo-timers to workspace + core ## Test Results Used by hero_os PR #114 and 9 island app PRs; each verified via the focus_pause smoke test.
feat(core): add use_focus_poll hook + focus class consts
All checks were successful
Build and Test / build (pull_request) Successful in 7m53s
5bbe92d493
Native islands compiled into hero_os polled on a fixed cadence even when
their window was not the focused one. This adds:

- is_window_focused(window_id) — DOM check via window-shadow-focused class
- use_focus_poll(window_id, ms, body) — drop-in use_future replacement
  that gates body on focus
- WINDOW_FOCUSED_CLASS / WINDOW_UNFOCUSED_CLASS constants used by both
  the host window component and island polling sites

gloo-timers added to workspace + core (web feature) for the hook.
zaelgohary force-pushed development_perf_pause_polls_when_defocused from 5bbe92d493
All checks were successful
Build and Test / build (pull_request) Successful in 7m53s
to ffd89db520
All checks were successful
Build and Test / build (pull_request) Successful in 9m51s
2026-04-29 19:08:38 +00:00
Compare
zaelgohary merged commit 52975c5bbc into development 2026-04-29 19:12:23 +00:00
zaelgohary deleted branch development_perf_pause_polls_when_defocused 2026-04-29 19:12:23 +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_archipelagos!194
No description provided.