Skip to content

manager: defer module repo WebViews until pager settles - #3641

Open
Zhanfg wants to merge 1 commit into
tiann:mainfrom
Zhanfg:fix/module-repo-webview-lifecycle-3636
Open

manager: defer module repo WebViews until pager settles#3641
Zhanfg wants to merge 1 commit into
tiann:mainfrom
Zhanfg:fix/module-repo-webview-lifecycle-3636

Conversation

@Zhanfg

@Zhanfg Zhanfg commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Mitigates a crash reported when navigating from the module README page to
the Releases page for modules with large release descriptions.

The README and release descriptions are rendered using WebViews. During an
animated pager transition, both the previous page and the target page may be
composed at the same time. This can cause the README WebView and multiple
release-description WebViews to coexist temporarily, significantly increasing
memory pressure.

This change defers creation of the heavy Markdown/WebView content until the
pager has settled on the corresponding page.

The same lifecycle handling is applied to both the Material and Miuix module
repository detail implementations.

Changes

  • only compose README Markdown after the pager settles on the README page
  • only compose release Markdown after the pager settles on the Releases page
  • keep lightweight page structure available during pager animation
  • apply the same behavior to Material and Miuix UIs

Testing

  • built KernelSU Manager with:
    clean assembleRelease -PIS_PR_BUILD=true
  • verified both Manager UI implementations compile successfully

Addresses #3636.

The reported navigation pattern is consistent with overlapping heavy WebView
composition and increased memory pressure. The issue currently has no usable
crash log, so this PR intentionally does not claim that the root cause has been
conclusively proven.

@github-actions
github-actions Bot force-pushed the fix/module-repo-webview-lifecycle-3636 branch from bb853f2 to b1f46bc Compare August 16, 2026 04:57
@aviraxp

aviraxp commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Have you verified it or this is what AI outputs?

@Zhanfg

Zhanfg commented Aug 16, 2026

Copy link
Copy Markdown
Author

I actually ran into this while working on a downstream project based on KernelSU Manager, so I ended up looking into the upstream implementation and fixed it along the way.

In my case the crash happened around README -> Releases navigation on modules with larger release notes. Looking through the code, the pager transition can keep the README WebView alive while the Releases page starts composing additional Markdown/WebViews, which matched what I was seeing downstream.

I did use AI to help with the investigation and implementation, but it wasn't just AI output pasted into a PR — I reviewed the code and built both the Material and Miuix variants myself.

I don't have a clean upstream crash trace proving this is the only root cause, though, so I kept the PR wording as “mitigates” rather than claiming it's conclusively verified.

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

Defers heavy module-repository WebViews until the destination pager tab settles, reducing memory pressure during transitions.

Changes:

  • Gates README and release Markdown WebViews on the settled page.
  • Applies equivalent behavior to Material and Miuix interfaces.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ModuleRepoMiuix.kt Defers Miuix README and release WebViews.
ModuleRepoMaterial.kt Defers Material README and release WebViews.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants