Skip to content

feat: Add Screen Orientation API support to Page#24327

Open
Artur- wants to merge 3 commits into
mainfrom
feature/screen-orientation
Open

feat: Add Screen Orientation API support to Page#24327
Artur- wants to merge 3 commits into
mainfrom
feature/screen-orientation

Conversation

@Artur-
Copy link
Copy Markdown
Member

@Artur- Artur- commented May 12, 2026

Expose the browser Screen Orientation API through Page methods,
providing a read-only signal for tracking orientation changes and
methods to lock/unlock screen orientation for tablet and mobile apps.

Artur- added 2 commits May 8, 2026 15:13
Expose the browser Screen Orientation API through Page methods,
providing a read-only signal for tracking orientation changes and
methods to lock/unlock screen orientation for tablet and mobile apps.
Addresses three API gaps surfaced while building use cases against the
screen orientation API:

- Add ScreenOrientation.isLandscape() / isPortrait() so adaptive layouts
  do not have to spell out the two-value disjunction.
- Add ScreenOrientation.UNSUPPORTED, distinct from UNKNOWN: the client
  now reports "unsupported" from the bootstrap when screen.orientation
  is absent, so callers can tell "no data yet" from "the platform will
  never produce data."
- Replace lockOrientation's PendingJavaScriptResult return with the
  Geolocation.getPosition-style onSuccess/onError callbacks, plus a
  ScreenOrientationLockError record carrying the DOMException name and
  message. Rejected lock requests now surface reactively instead of
  vanishing unless the caller chained .then(...) themselves. A
  fire-and-forget single-arg overload logs failures at DEBUG.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Test Results

 1 406 files  + 2   1 406 suites  +2   1h 21m 19s ⏱️ - 1m 23s
10 148 tests +20  10 078 ✅ +20  70 💤 ±0  0 ❌ ±0 
10 623 runs  +20  10 544 ✅ +20  79 💤 ±0  0 ❌ ±0 

Results for commit f896243. ± Comparison against base commit 09ccde4.

♻️ This comment has been updated with latest results.

…lback

Adds ExtendedClientDetails#isScreenOrientationSupported() for a synchronous
feature-detect (mirrors the Page screen-orientation signal) and a
Page#unlockOrientation(SerializableRunnable) overload that fires once the
unlock round-trip completes — symmetric with the lockOrientation callbacks.
@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: 🔎Iteration reviews

Development

Successfully merging this pull request may close these issues.

2 participants