Adopt shared-ui safe-area handling; WindowInsets-backed nav insets - #1008
Merged
Conversation
|
Preview build will be at |
microbit-matt-hillsdon
force-pushed
the
safe-area-nav-apps
branch
from
August 22, 2026 12:48
eed26c8 to
9be3286
Compare
Author
|
Reminder to self: Needs UI linking and testing on Android/iOS, especially Android with navbar — both portrait and landscape. Check the drawer too. Can be sim only. |
The drawer's top-inset spacer becomes a capped negative margin now the shared Drawer reserves the inset itself. The nav-bar-side heuristic hook is deleted in favour of shared-ui's safeAreaNavSource contract, and the hand-spelt env()/var() padding expressions become the new shared-ui safeArea* spacing tokens, which bake the fallbacks in. On Android, the new SafeAreaNavPlugin reports the navigation-bar portion of the window insets in CSS pixels, fed from MainActivity's existing insets listener — real WindowInsets types instead of the size heuristic, so content can flow under a camera cutout while staying clear of the nav bar. It reports zeros on the pre-140 WebView emulation path, where the native padding already applies. In every context without the plugin — the website, ?flag=android simulation, iOS (whose landscape insets are symmetric, making the distinction moot) — the env() fallbacks give the conservative behaviour. Requires unreleased @microbit/ui (SharedUIProvider safeAreaNavSource and the safeArea* tokens). The Java is not yet compiled or device-tested.
microbit-matt-hillsdon
force-pushed
the
safe-area-nav-apps
branch
from
September 1, 2026 17:38
9be3286 to
b4cf236
Compare
Author
|
@microbit-grace this depends on microbit-foundation/ui#108 please could you test them together on Android? |
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's top-inset spacer becomes a capped negative margin now the shared Drawer reserves the inset itself. The nav-bar-side heuristic hook is deleted in favour of shared-ui's safeAreaNavSource contract, and var() fallbacks switch from 0px to the raw env() insets per that contract.
On Android, the new SafeAreaNavPlugin reports the navigation-bar portion of the window insets in CSS pixels, fed from MainActivity's existing insets listener — real WindowInsets types instead of the size heuristic, so content can flow under a camera cutout while staying clear of the nav bar. It reports zeros on the pre-140 WebView emulation path, where the native padding already applies. In every context without the plugin — the website, ?flag=android simulation, iOS (whose landscape insets are symmetric, making the distinction moot) — the env() fallbacks give the conservative behaviour.
Fixes #988