fix(android): sync upstream SystemBars fixes #8480 and #8481 - #106
Conversation
(cherry picked from commit d4ad7ff) Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> (cherry picked from commit 4c6c321)
setHidden(.., "") hides or shows every bar at once, but only the per-bar branches updated navBarVisible, so the API < 30 safe-area fallback reported a nav bar height for a hidden bar. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
Beta npm buildMaintainers can publish one Capacitor Plus workspace package from this PR to npm for fast testing. Comment Examples: /publish-beta core
/publish-beta cli
/publish-beta @capacitor-plus/coreIf exactly one workspace package changed, Packages:
The workflow will:
Security note: beta publish is only enabled for branches inside this repository. |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
The upstream SystemBars test only exercises setHidden's show path, so the nav bar visibility tracking behind the API < 30 safe-area fallback had no coverage. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
What
Syncs two SystemBars fixes that are merged in
ionic-team/capacitorbut missing fromplus:insetsHandling: "disable"Plus one integration fix needed to make the two work together (details below).
Why
Both were carried by the stale upstream-sync branches, bundled with the "upstream-preferred fallback" resolution that renamed
@capacitor-plus/*back to@capacitor/*and wiped the fork's changelogs. Stripping that damage from #71/#83/#85/#87/#88 also dropped these two genuine fixes on the floor. CodeRabbit flagged both as out-of-diff findings while reviewing #67, which is how they resurfaced.They are worth having on their own merits:
insetsHandling: "disable"did not work. Upstream fix(SystemBars): makesafe-area-inset-xavailable on API <= 34 ionic-team/capacitor#8424 removed theinsetHandlingEnabledguard, so the listener was installed and insets were rewritten regardless of config. chore: sync upstream PR #8454 - Fix navigation bar overlay in edge-to-edge mode on Android #67 restored the guard on the CSS injections; fix(SystemBars): respectinsetsHandlingdisable ionic-team/capacitor#8481 finishes the job by returning early frominitWindowInsetsListener, gatingonDOMReady, and validating the config value with a warning on unknown input.setHidden(false, "StatusBar")calledshow(Type.systemBars()), which covers both bars. fix(android): show only the requested system bar ionic-team/capacitor#8480 narrows each branch to the bar actually requested and addsSystemBarsTest.How
Cherry-picked
d4ad7ffand4c6c321withgit cherry-pick -x, preserving upstream authorship.d4ad7ffconflicted with #67, which had just landed and reworks the same methods. Resolved by keeping #67's structure and layering ionic-team#8481's config handling on top:insetHandlingEnabled(boolean) becomesinsetsHandling(String), with all five call sites migrated toINSETS_HANDLING_CSS.equals(insetsHandling).ViewCompat.getRootWindowInsets(v)ininitSafeAreaCSSVariablesrather than upstream'sWindowInsetsCompat.CONSUMEDfallback, which yields zeros below API 35.ViewCompat.requestApplyInsets(parentView)inonDOMReadyover upstream'sgetBridge().getWebView().requestApplyInsets().The third commit is a fork-specific integration fix.
navBarVisible(added by #67) was only updated in the per-bar branches, but ionic-team#8480 restructuredsetHiddensobar.isEmpty()— the pathinitSystemBarsuses for thehiddenconfig — hides or shows every bar at once. Withhidden: truethe navigation bar was hidden whilenavBarVisiblestayedtrue, so the API < 30 safe-area fallback reported a nav bar height for a bar that was not on screen. Upstream cannot have this bug becausenavBarVisibleonly exists here.Testing
bun run eslintandbun run prettier --checkpass locally.SystemBarsTest.javacomes from upstream fix(android): show only the requested system bar ionic-team/capacitor#8480 and runs intest-android.Not Tested
insetsHandling: "disable", of hiding a single bar, or of thenavBarVisiblefix on an API < 30 device. All three are reasoned from the code and upstream's intent.Opened by an AI agent (Cursor).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.