manager: add inset support to webui#2952
Merged
Merged
Conversation
ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
Collaborator
Author
|
This standard is used in WebUI-X (also known as MMRL) for quite a while, many module's webui has already added support to this, here is a simple guide to add inset support in webui: @import url('https://mui.kernelsu.org/internal/insets.css');
body {
padding-top: var(--window-inset-top, 0px);
padding-bottom: var(--window-inset-bottom, 0px);
}Old WebUI vs New WebUI |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds window insets support to the WebUI feature, allowing web content to properly adapt to device safe areas (status bars, navigation bars, and notches). The implementation is inspired by WebUI-X-Portable project.
- Introduces a new
Insetsdata class that captures and converts system window insets to CSS variables - Updates WebView configuration to track window insets and expose them via a dynamically generated CSS file
- Modifies
SuFilePathHandlerto serve the generated insets CSS at a specialinternal/insets.csspath
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| manager/app/src/main/java/me/weishu/kernelsu/ui/webui/Inset.kt | New data class that stores inset values and generates CSS variables for safe area handling |
| manager/app/src/main/java/me/weishu/kernelsu/ui/webui/WebUIActivity.kt | Updates WebView setup to capture system window insets, convert them from pixels to dp, and pass them to the path handler via a supplier interface |
| manager/app/src/main/java/me/weishu/kernelsu/ui/webui/SuFilePathHandler.java | Adds InsetsSupplier interface and special handling for internal/insets.css path to serve dynamically generated insets CSS |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Seyud
approved these changes
Nov 18, 2025
Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com>
YuKongA
approved these changes
Nov 18, 2025
rsuntk
pushed a commit
to rsuntk/KernelSU
that referenced
this pull request
Nov 20, 2025
ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com> --------- Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: fc5b87cf <rissu.ntk@gmail.com>
YuzakiKokuban
pushed a commit
to YuzakiKokuban/hymo
that referenced
this pull request
Dec 12, 2025
aviraxp
pushed a commit
that referenced
this pull request
Dec 21, 2025
KOWX712
added a commit
to KOWX712/KernelSU
that referenced
this pull request
Dec 21, 2025
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/APatch
that referenced
this pull request
Dec 23, 2025
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
bklynali
pushed a commit
to bklynali/BK-KSU
that referenced
this pull request
Dec 23, 2025
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 4, 2026
ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com> --------- Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com> --------- Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
Prslc
pushed a commit
to Prslc/APatch
that referenced
this pull request
Jan 6, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. minor touch up manager: fix ksu.fullScreen ref: tiann/KernelSU#3126 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 8, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
Admirepowered
pushed a commit
to bmax121/APatch
that referenced
this pull request
Jan 10, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com>
Prslc
pushed a commit
to Prslc/APatch
that referenced
this pull request
Jan 11, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. minor touch up manager: fix ksu.fullScreen ref: tiann/KernelSU#3126 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com> --------- Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Feb 8, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Mar 11, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Mar 11, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Apr 14, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/FolkPatch
that referenced
this pull request
May 29, 2026
The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions. Refactor to match the KernelSU pattern: - Create WebView and configure WebViewAssetLoader on IO dispatcher - Build WebView fully on Main thread outside AndroidView - Defer loadUrl until width > 0 && height > 0 via layout listener - related: - tiann/KernelSU#2952 - tiann/KernelSU#3083 - tiann/KernelSU#3126 - tiann/KernelSU#3190 Signed-off-by: KOWX712 <leecc0503@gmail.com>
matsuzaka-yuki
pushed a commit
to LyraVoid/FolkPatch
that referenced
this pull request
May 30, 2026
#151) The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions. Refactor to match the KernelSU pattern: - Create WebView and configure WebViewAssetLoader on IO dispatcher - Build WebView fully on Main thread outside AndroidView - Defer loadUrl until width > 0 && height > 0 via layout listener - related: - tiann/KernelSU#2952 - tiann/KernelSU#3083 - tiann/KernelSU#3126 - tiann/KernelSU#3190 Signed-off-by: KOWX712 <leecc0503@gmail.com>
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.


ref: https://github.com/MMRLApp/WebUI-X-Portable/blob/master/webui/src/main/kotlin/com/dergoogler/mmrl/webui/model/Insets.kt
Co-Authored-By: Der_Googler 54764558+dergoogler@users.noreply.github.com
Signed-off-by: KOWX712 leecc0503@gmail.com