Skip to content

feat: Add Fullscreen API wrapping the browser Fullscreen API#23616

Draft
Artur- wants to merge 3 commits into
mainfrom
fullscreen-api
Draft

feat: Add Fullscreen API wrapping the browser Fullscreen API#23616
Artur- wants to merge 3 commits into
mainfrom
fullscreen-api

Conversation

@Artur-
Copy link
Copy Markdown
Member

@Artur- Artur- commented Feb 21, 2026

Adds Component.requestFullscreen() that uses a wrapper approach to handle Vaadin theming and overlay components correctly, along with Page.requestFullscreen() for whole-page fullscreen, Page.exitFullscreen(), Page.isFullscreenEnabled(), and Page.addFullscreenChangeListener().

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 21, 2026

Test Results

1 285 files   -   121  1 285 suites   - 121   1h 18m 27s ⏱️ - 4m 2s
8 810 tests  - 1 329  8 759 ✅  - 1 310  51 💤  - 19  0 ❌ ±0 
9 285 runs   - 1 329  9 225 ✅  - 1 310  60 💤  - 19  0 ❌ ±0 

Results for commit 1c6b4ef. ± Comparison against base commit 32183d1.

♻️ This comment has been updated with latest results.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 9, 2026

@mshabarov mshabarov moved this from 🔎Iteration reviews to 🟢Ready to Go in Vaadin Flow | Hilla | Kits ongoing work Apr 1, 2026
@mshabarov mshabarov moved this from 🟢Ready to Go to 🪵Product backlog in Vaadin Flow | Hilla | Kits ongoing work Apr 22, 2026
Adds Component.requestFullscreen() that uses a wrapper approach to handle
Vaadin theming and overlay components correctly, along with
Page.requestFullscreen() for whole-page fullscreen, Page.exitFullscreen(),
and Page.fullscreenSignal() for reactive observation of the fullscreen
state (FULLSCREEN, NOT_FULLSCREEN, UNSUPPORTED, UNKNOWN).

The signal is seeded from the initial client bootstrap (v-fs parameter)
and updated via a vaadin-fullscreen-change DOM event, mirroring the
page-visibility wiring. The client-side bridge lives in
flow-client/src/main/frontend/Fullscreen.ts, imported from Flow.ts the
same way Geolocation.ts is.

Fixes #21902
Artur- added 2 commits May 11, 2026 09:14
The file already has an exported function (currentFullscreenState), so
the trailing `export {}` is flagged by
@typescript-eslint/no-useless-empty-export and breaks the flow-client
build.
Reworks the Fullscreen API based on API-GAPS feedback:

- Page.requestFullscreen() and Component.requestFullscreen() now return
  a FullscreenSession with a state signal carrying PENDING / ACTIVE /
  REJECTED / EXITED_BY_USER / EXITED_BY_CODE. This covers three gaps in
  one shape: which component is fullscreen (session.owner()), how the
  session ended (terminal state), and whether the browser accepted the
  request (PENDING -> ACTIVE or REJECTED).

- The JS connector now returns { ok, error? } from each request so
  rejections (no user activation, permissions policy, document detached,
  fullscreen unsupported) reach the server and are logged at WARN level
  with the browser-provided message.

- Page#requestFullscreen(Component) overload lets code that already
  holds a Page reference start a component session without reaching
  through the component.

- Component#exitFullscreen() restores symmetry with requestFullscreen(),
  delegating to Page#exitFullscreen() so component code does not need
  to reach for getUI().getPage().

- Page#simulateFullscreenChange(FullscreenState) exposes a public
  test-only seam so downstream tests no longer have to reflect into the
  package-private setter.

- Javadoc on Page#fullscreenSignal() and Page#requestFullscreen() now
  carries worked binding / lifecycle examples.

The page-level Page#fullscreenSignal() is unchanged: it answers the
broad "is anything fullscreen right now" question across sessions.
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

Projects

Status: 🪵Product backlog

Development

Successfully merging this pull request may close these issues.

2 participants