Skip to content

feat: Add pageVisibilitySignal() to Page for tracking browser tab visibility#23614

Draft
Artur- wants to merge 5 commits intomainfrom
PageVisibility
Draft

feat: Add pageVisibilitySignal() to Page for tracking browser tab visibility#23614
Artur- wants to merge 5 commits intomainfrom
PageVisibility

Conversation

@Artur-
Copy link
Member

@Artur- Artur- commented Feb 21, 2026

Add a read-only signal-based API on Page that tracks whether the browser tab is visible and focused, visible but not focused, or hidden. Uses the browser Page Visibility API combined with focus/blur events, with a Firefox workaround for deferred visibilitychange. Client-side logic lives in page-visibility.js loaded via @jsmodule on UI.

@github-actions
Copy link

github-actions bot commented Feb 21, 2026

Test Results

1 262 files   -   120  1 262 suites   - 120   1h 22m 6s ⏱️ - 1m 34s
8 581 tests  - 1 291  8 527 ✅  - 1 274  52 💤  - 19  0 ❌ ±0  2 🔥 +2 
9 054 runs   - 1 291  8 991 ✅  - 1 274  61 💤  - 19  0 ❌ ±0  2 🔥 +2 

For more details on these errors, see this check.

Results for commit ae39776. ± Comparison against base commit 2a81ded.

This pull request removes 1294 and adds 3 tests. Note that renamed tests count towards both.
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplateWithComments_commentsProperlyIgnored
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeInRenderBeforeHtml_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlAfterRender_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlBeforeRender_templateProperlyParsed
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_disabled_exceptionIsThrown
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setAttributeBinding_attributeIsIgnored
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setClass_classIsSetAsAttribute
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setDynamicValue_attributeIsIgnored
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setHref_hrefIsSetAsAttribute
…
com.vaadin.flow.component.page.PageVisibilitySignalTest ‑ pageVisibilitySignal_defaultsToVisible
com.vaadin.flow.component.page.PageVisibilitySignalTest ‑ pageVisibilitySignal_isReadOnly
com.vaadin.flow.component.page.PageVisibilitySignalTest ‑ pageVisibilitySignal_tracksVisibilityChanges

♻️ This comment has been updated with latest results.

…ibility

Add a read-only signal-based API on Page that tracks whether the browser
tab is visible and focused, visible but not focused, or hidden. Uses the
browser Page Visibility API combined with focus/blur events, with a
Firefox workaround for deferred visibilitychange. Client-side logic lives
in page-visibility.js loaded via @jsmodule on UI.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants