Skip to content

manager: add inset support to webui#2952

Merged
tiann merged 3 commits into
tiann:mainfrom
KOWX712:inset
Nov 18, 2025
Merged

manager: add inset support to webui#2952
tiann merged 3 commits into
tiann:mainfrom
KOWX712:inset

Conversation

@KOWX712

@KOWX712 KOWX712 commented Nov 18, 2025

Copy link
Copy Markdown
Collaborator

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>
@KOWX712

KOWX712 commented Nov 18, 2025

Copy link
Copy Markdown
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Insets data 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 SuFilePathHandler to serve the generated insets CSS at a special internal/insets.css path

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.

Comment thread manager/app/src/main/java/me/weishu/kernelsu/ui/webui/Insets.kt
Comment thread manager/app/src/main/java/me/weishu/kernelsu/ui/webui/Insets.kt
@tiann tiann requested a review from YuKongA November 18, 2025 12:20
Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com>
@tiann tiann merged commit 4b94c8e into tiann:main Nov 18, 2025
15 checks passed
@KOWX712 KOWX712 deleted the inset branch November 18, 2025 14:46
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
@elysias123 elysias123 mentioned this pull request Dec 18, 2025
3 tasks
aviraxp pushed a commit that referenced this pull request Dec 21, 2025
documentation for #2952, #3083

Signed-off-by: KOWX712 <leecc0503@gmail.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants