Conversation
Test Results1 284 files - 122 1 284 suites - 122 1h 17m 20s ⏱️ - 5m 9s Results for commit fbae707. ± Comparison against base commit 32183d1. ♻️ This comment has been updated with latest results. |
|
mcollovati
reviewed
Mar 26, 2026
Add a per-UI WakeLock facade reached through Page#getWakeLock(). It exposes request(), release(), and an active-state Signal<Boolean>, matching the conventions used for PageVisibility and Geolocation: - Dedicated facade class under com.vaadin.flow.component.page with a package-private constructor. - Client logic lives in flow-client/src/main/frontend/WakeLock.ts and is side-effect-imported from Flow.ts; nothing inlined into Java. - State travels back as a vaadin-wake-lock-change CustomEvent on document.body with an ACTIVE / RELEASED detail; the facade listens on the UI element and writes to a private ValueSignal. - Client transparently re-acquires the lock on visibilitychange so a single request() covers the lifetime of a view; release() clears the "want lock" flag and drops the current sentinel. - Failures (insecure context, unsupported browser, denied) log at DEBUG and leave the active signal in its false state.
|
Member
Author
|
Updated to match other PRs |
Member
Author
|
Continues in #24324 |
Artur-
added a commit
to vaadin/use-cases
that referenced
this pull request
May 13, 2026
Adds a `wake-lock` module mirroring the `page-visibility` and `geolocation` modules, with four use cases exercising the new `Page#getWakeLock()` facade from vaadin/flow#23619: - UC1 Manual toggle — minimal API exercise, button + status badge bound to `wakeLock.activeSignal()`. - UC2 Recipe — lifetime-of-view pattern; `request()` on attach and `release()` on detach. - UC3 Slideshow — `Signal.effect` couples the lock to a `presenting` signal, so reaching the last slide also releases the lock. - UC4 Workout timer — HIIT timer coupling the lock to a `running` signal; uses `TaskScheduler` + `ui.accessLater` for ticks. Each view has a browserless test; tests reach into the package-private `WakeLock#setActive` via a reflective `WakeLockTestSupport` helper, mirroring `PageVisibilityTestSupport`. `wake-lock/API-GAPS.md` records six friction points observed while building the views (notably the missing test simulator and missing server-side feature detection). Pins `flow.version` to `25.2.wake-lock-SNAPSHOT`; revert to a mainline snapshot once the PR is merged.
Artur-
added a commit
to vaadin/use-cases
that referenced
this pull request
May 13, 2026
Adds a `wake-lock` module mirroring the `page-visibility` and `geolocation` modules, with four use cases exercising the new `Page#getWakeLock()` facade from vaadin/flow#23619: - UC1 Manual toggle — minimal API exercise, button + status badge bound to `wakeLock.activeSignal()`. - UC2 Recipe — lifetime-of-view pattern; `request()` on attach and `release()` on detach. - UC3 Slideshow — `Signal.effect` couples the lock to a `presenting` signal, so reaching the last slide also releases the lock. - UC4 Workout timer — HIIT timer coupling the lock to a `running` signal; uses `TaskScheduler` + `ui.accessLater` for ticks. Each view has a browserless test; tests reach into the package-private `WakeLock#setActive` via a reflective `WakeLockTestSupport` helper, mirroring `PageVisibilityTestSupport`. `wake-lock/API-GAPS.md` records six friction points observed while building the views (notably the missing test simulator and missing server-side feature detection). Pins `flow.version` to `25.2.wake-lock-SNAPSHOT`; revert to a mainline snapshot once the PR is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Expose the browser Screen Wake Lock API through Page methods, allowing server-side Java code to prevent the screen from dimming or locking for dashboards, kiosks, and presentations.