Safe-area support for the Drawer; nav-side inset contract - #108
Draft
microbit-matt-hillsdon wants to merge 1 commit into
Draft
Safe-area support for the Drawer; nav-side inset contract#108microbit-matt-hillsdon wants to merge 1 commit into
microbit-matt-hillsdon wants to merge 1 commit into
Conversation
Deploying ui with
|
| Latest commit: |
969b777
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://20348197.ui-2wg.pages.dev |
| Branch Preview URL: | https://safe-area-nav.ui-2wg.pages.dev |
The Drawer now pads by the safe-area insets and paints the status-bar strip with the statusBarBg gradient, matching the full-size dialog. Side insets are placement-aware and mirrored under dir=rtl. Drawer and full-size dialog side paddings distinguish the system navigation bar (content must stay clear) from a camera cutout (content may flow under) — a split env() cannot express. New runtime variables --safe-area-nav-left/right carry it: SharedUIProvider writes them from an app-supplied safeAreaNavSource, a native shell with real inset metadata such as Android's WindowInsets API via a Capacitor plugin. Without a source they stay unset and consumers fall back to the raw env() insets — conservative, never occluded. New spacing tokens safeAreaTop/Bottom/NavLeft/NavRight define the inset expressions (fallbacks included) once; the recipes and app code consume the tokens. See the README's CSS-variable contract. ml-trainer's size heuristic (larger side inset = nav bar) was considered and dropped rather than moved here: its output only differs from the env() fallback on Android landscape with 3-button nav and a cutout, exactly the case the native source answers with real data.
microbit-matt-hillsdon
force-pushed
the
safe-area-nav
branch
from
August 22, 2026 12:48
064ca1c to
969b777
Compare
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.
The Drawer now pads by the safe-area insets and paints the status-bar strip with the statusBarBg gradient, matching the full-size dialog. Side insets are placement-aware and mirrored under dir=rtl.
Drawer and full-size dialog side paddings read new runtime variables, --safe-area-nav-left/right, falling back to the raw env() insets. The variables distinguish the system navigation bar (content must stay clear) from a camera cutout (content may flow under) — a split env() cannot express. SharedUIProvider writes them from an app-supplied safeAreaNavSource: a native shell with real inset metadata, e.g. Android's WindowInsets API via a Capacitor plugin. Without a source they stay unset and the env() fallbacks apply — conservative, never occluded. See the README's CSS-variable contract.
ml-trainer's size heuristic (larger side inset = nav bar) was considered and dropped rather than moved here: its output only differs from the env() fallback on Android landscape with 3-button nav and a cutout, exactly the case the native source answers with real data.