Skip to content

chore: [draft] ui default virtual screen + screen inset, ported to auth-server for scene testing - #1517

Draft
leanmendoza wants to merge 6 commits into
auth-serverfrom
chore/ui-default-vscreen-inset-authserver
Draft

chore: [draft] ui default virtual screen + screen inset, ported to auth-server for scene testing#1517
leanmendoza wants to merge 6 commits into
auth-serverfrom
chore/ui-default-vscreen-inset-authserver

Conversation

@leanmendoza

Copy link
Copy Markdown
Contributor

Draft — testing vehicle, not for merge as-is.

Port of #1489 (default virtual screen + default screen inset area) onto auth-server, plus two follow-up changes, so we can publish an SDK build the studio scenes can actually consume and measure the blast radius on real experiences instead of estimating it from source.

Why a branch off auth-server

10 of the 11 studio scenes we want to test pin an auth-server build, not a prod release:

Scene @dcl/sdk Origin
Pigeon-Deluxe 7.24.1 prod (npm)
CleanTheClub ^7.25.1-30310486734.commit-5ffe873 auth-server
flagtag 7.24.6-29505165911.commit-d270434 auth-server
dead-surge / SkyChaser 7.24.4-28592331167.commit-697ce9e auth-server
kickoff-2026 7.23.4-26106700711.commit-2afa13b auth-server
Alienscrap / venetian-hunt ^7.23.2-25521226778.commit-1828100 auth-server
cozy-farm / TheLivingGarden / towerofmadness 7.21.1-22918726402.commit-ee210ee auth-server

So the path to those scenes is a build from this branch, not from main.

Contents

Cherry-picks of #1489's own commits, unchanged:

  • chore: ui renderer default virtual screen
  • corrected mistaken file change
  • feat: screenInset property for ui renderer

Plus two follow-ups also pushed to #1489:

  • fix(react-ecs): stop dividing UI layout by devicePixelRatiouiScaleFactor becomes exactly the contain-fit of the design resolution in the canvas, and scaleOnDim resolves Nvw/Nvh to N% of the canvas dimension, as in CSS. devicePixelRatio is a density hint each renderer computes differently, so dividing by it made UI size inversely proportional to whichever value the scene happened to get.
  • feat(react-ecs): default screenInset to 'device' — a renderer that passes no screenInset now lands in the device safe area. 'none' opts back into the whole screen.

#1489's rebuilt snapshots commit is deliberately not cherry-picked: it also reverts 94 lines of main-specific lockfile churn. Snapshots are regenerated against auth-server here instead.

The UI feature code is byte-identical to #1489 — the only diffs against that branch are pre-existing auth-server vs main differences (auth-server has no uiInputBinding).

Verification

Full clean cycle on this branch — git clean -xdf && make install && make build && make test:

Test Suites: 1 skipped, 158 passed, 158 of 159 total
Tests:       25 skipped, 1202 passed, 1227 total

Working tree clean after the rebuild, so the committed snapshots are exactly what a from-scratch build produces. No ERR! lines in test/snapshots/.

What we want to measure

Both follow-ups only bite where devicePixelRatio != 1 (mobile, Retina desktop) or where screenInsetArea is non-zero (notched devices), which is exactly what source review cannot settle. Highest-signal scenes:

  • CleanTheClub — the only one hit by both changes. src/ui.tsx is calibrated explicitly against the old uiScaleFactor = canvasH/VIRTUAL_H/dpr, and src/client/safeArea.ts already derives its own insets from interactableArea as fractions of the full canvas, so the device-inset wrapper compounds with it.
  • Pigeon-Deluxe — the only prod-pinned scene; its full-screen fade (width:'100%', height:'100%', absolute) is the clearest failure mode for the inset default.
  • dead-surge — compensates for dpr by hand (lobbyStoreUi.tsx:71-74) and is the only scene mixing vw/vh with %.

pravusjif and others added 6 commits August 4, 2026 16:38
(cherry picked from commit 2dab9fa)
`uiScaleFactor` is now exactly the contain-fit of the design resolution
inside the canvas, and `scaleOnDim` resolves 'Nvw'/'Nvh' and string
`fontSize` to N% of the canvas dimension, as in CSS.

devicePixelRatio is a density hint for picking a 1x/2x/3x asset, and each
renderer computes it differently, so dividing by it made UI size inversely
proportional to whichever value the scene happened to get. The field stays
on PBUiCanvasInformation and `ScaleContext.ratio` stays in the public API.
No renderer change is required.

BREAKING CHANGE: scenes that set a virtual size and were calibrated against
the current behaviour will render devicePixelRatio times larger. Scenes that
pass no virtual size keep uiScaleFactor === 1 and are unaffected.

(cherry picked from commit 2995d67)
(cherry picked from commit 266483d)
Drawing under a notch, a status bar or a rounded corner is a bug in every
scene that ships it, so the device safe area is now what a renderer gets when
it doesn't ask for anything. Creators who do want the whole screen opt in with
`screenInset: 'none'`, and `'interactable'` is still there for UI that must
also clear the Explorer's native HUD.

Both setUiRenderer and addUiRenderer default to it, each renderer still
honoring its own value.

Test suites that assert the UI tree hanging directly off the canvas root now
pass the shared WHOLE_SCREEN option, so the wrapper entity stays covered in
ui-renderer-screen-inset.spec.tsx and out of everyone else's assertions.

BREAKING CHANGE: a scene that passes no screenInset now renders inside the
device safe area instead of the whole screen, with one extra wrapper entity
in the UI tree.

(cherry picked from commit 96a0cea)
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying js-sdk-toolchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fcc349
Status: ✅  Deploy successful!
Preview URL: https://97971aa6.js-sdk-toolchain.pages.dev
Branch Preview URL: https://chore-ui-default-vscreen-ins.js-sdk-toolchain.pages.dev

View logs

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/ui-default-vscreen-inset-authserver/dcl-sdk-7.25.1-30944713340.commit-59080f3.tgz"
  • The @dcl/js-runtime package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/ui-default-vscreen-inset-authserver/@dcl/js-runtime/dcl-js-runtime-7.25.1-30944713340.commit-59080f3.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/ui-default-vscreen-inset-authserver/dcl-sdk-commands-7.25.1-30944713340.commit-59080f3.tgz"
    npx $SDK_COMMANDS init
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/chore/ui-default-vscreen-inset-authserver-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=chore/ui-default-vscreen-inset-authserver

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