Window Insets support for Compose for Web#3202
Open
Konstantin (terrakok) wants to merge 8 commits into
Open
Conversation
…ets via `WindowInsets` APIs
…ts` is true Added a warning to notify developers if the `viewport-fit=cover` attribute is missing from the meta viewport tag, ensuring safe area insets are applied correctly.
… `WebWindowInsets`
…recise insets adjustments - Added support for updating insets on canvas resize via `onCanvasResized`. - Enhanced safe area and IME insets calculations to account for canvas position and size.
- Introduced comprehensive test coverage for `WebWindowInsetsManager`. - Validates safe area insets, canvas offset handling, resize updates, and density conversions.
|
I would still prefer to introduce the PlatformEmbeddingStrategy interface with FullPageStrategy and EmbeddedStrategy implementations (as per the youtrack issue). Much of what is explained in the enableBrowserWindowInsets KDoc can be easily understood with this API. PlatformEmbeddingStrategy can be used for other non-insets related APIs that might need different implementation in these modes |
Member
As I understood your idea, FullPageStrategy would take care of configuring the index.html / styles for apps taking the entire viewport? Sort of simplification? |
Oleksandr Karpovich (eymar)
approved these changes
Jul 9, 2026
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.
Added support for system window insets on Web. Compose scenes can now render edge-to-edge while respecting the safe area and the keyboard, exposing everything through the standard
WindowInsetsAPIs (WindowInsets.safeDrawing,WindowInsets.ime, etc.).compressO-Recording.2026-07-07.at.15-33-34.mp4
New experimental API
A new configuration flag on
ComposeViewportConfiguration:Without
viewport-fit=coverthe browser applies safe area padding automatically and allenv(safe-area-inset-*)variables return0px, so insets would always be zero. If the flag is enabled but the meta tag is missing, a warning is logged to the console.Fixes https://youtrack.jetbrains.com/issue/CMP-10141
Testing
Added new web tests
Release Notes
Features - Web