Follow-ups for #8535: css default, doc annotations, EdgeToEdge.enable - #1
Open
kklem0 wants to merge 12 commits into
Open
Follow-ups for #8535: css default, doc annotations, EdgeToEdge.enable#1kklem0 wants to merge 12 commits into
kklem0 wants to merge 12 commits into
Conversation
…ortFitValueHint`
initSystemBars() resolved the option against INSETS_HANDLING_NATIVE while the documentation added in this branch (cli/src/declarations.ts and core/system-bars.md) still states the default is css, and the review discussion proposes flipping the default only in Capacitor 9. Apps that never set insetsHandling and style against the injected --safe-area-inset-* variables without an env() fallback would silently lose those variables in a minor release. Keep css as the default until the major, matching the documented behavior.
The @default tag of SystemBars.style was changed to 'css' alongside the insetsHandling edits. The runtime default is unchanged (DEFAULT), so restore the original annotation.
The option is a string ('auto' | 'contain' | 'cover') resolved against
an empty string at runtime, so document the default as undefined rather
than false, and fix a small typo in the description (in both
declarations.ts and system-bars.md).
The rewritten insets listener assumes an edge-to-edge window on every Android version: both branches pad the decor view (or pass real insets through) with no API level gate. The system only guarantees edge-to-edge on API 35+, and nothing in core opts the window in on older versions, so the listener runs outside its design assumptions there. That mismatch is what the removed VANILLA_ICE_CREAM gate (ionic-team#8439) was compensating for, it is the mechanism behind the API <= 34 double IME compensation described in ionic-team#8528, and it is why the reporter of ionic-team#8525 still saw a navigation bar sized gap on Android 10 after applying this branch, until manually adding EdgeToEdge.enable(this) to MainActivity. The community safe-area plugin this branch derives from documents EdgeToEdge.enable as a required manual setup step; core has no equivalent documentation or call. Call EdgeToEdge.enable() from the plugin when insetsHandling is not disable, so the window state matches the listener's assumptions out of the box. disable keeps the window untouched for apps that manage insets themselves. Doing this in the plugin rather than in BridgeActivity ties the behavior to the plugin configuration and needs no template change. Apps that already call EdgeToEdge.enable(this) themselves are unaffected, the call is idempotent.
3 tasks
tafelnl
reviewed
Aug 4, 2026
| * This option is only supported on Android. | ||
| * | ||
| * @default false | ||
| * @default undefined |
tafelnl
reviewed
Aug 4, 2026
|
|
||
| warnAboutUnsupportedConfigurationValues(); | ||
|
|
||
| if (!INSETS_HANDLING_DISABLE.equals(insetsHandling)) { |
Owner
There was a problem hiding this comment.
I proposed this here. Strictly speaking it's a breaking change. So I didn't include it just yet. If we do though, I think it might be better to call in inside BridgeActivity.onCreate. Because I guess that's where you most expect it to be
tafelnl
force-pushed
the
fix/resolve-issues-with-safe-area
branch
from
August 4, 2026 14:22
7abde6f to
9b35343
Compare
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.
Follow-ups on top of
fix/resolve-issues-with-safe-area(ionic-team#8535), one commit per finding, from reviewing the branch against main and the linked issues. Commits are independent, feel free to cherry-pick.fix(android): keep
cssas the runtime default forinsetsHandling.initSystemBars()resolves the option againstnative, whiledeclarations.tsandsystem-bars.mdin this same branch document the default ascss, and the review discussion proposes flipping the default only in Capacitor 9. Apps that never set the option and style against the injected--safe-area-inset-*variables without anenv()fallback would silently lose those variables in a minor release.docs(cli): restore the
styleoption'sDEFAULTdefault annotation. Its@defaulttag was changed to'css'alongside the insetsHandling edits; the runtime default is unchanged.docs: correct
initialViewportFitValueHintdefault annotation and wording. It is a string option resolved against an empty string at runtime, so@default falsewas misleading, and there was a small typo ("set this value is to").fix(android): enable edge-to-edge whenever SystemBars owns insets. The rewritten listener assumes an edge-to-edge window on every Android version (no more
VANILLA_ICE_CREAMgate), but the system only guarantees that on API 35+, and core never opts older versions in. That gap is what fix(SystemBars): avoid extra view padding on API <= 34 ionic-team/capacitor#8439 was compensating for, it is the mechanism behind the API <= 34 double IME compensation described in fix(SystemBars): avoid extra IME padding on API <= 34 in insets passthrough ionic-team/capacitor#8528, and it is why the reporter of [Bug]: Capacitor v8.3.0 extra gray space when keyboard is visible ionic-team/capacitor#8525 still saw a navigation-bar-sized gap on Android 10 with this branch until manually addingEdgeToEdge.enable(this)toMainActivity(a required setup step in the community plugin docs, with no core equivalent). CallingEdgeToEdge.enable()from the plugin wheninsetsHandlingis notdisablemakes the branch self-consistent out of the box, keepsdisableas the full opt-out, and needs no template change; apps that already call it themselves are unaffected. This also matches your own review note about adding it toBridgeActivity.onCreate; doing it in the plugin ties it to the plugin configuration instead. If you would rather keep it a documented manual step, take commits 1 to 3 and drop this one.Compile-checked with
gradlew compileDebugJavaWithJavac. Unrelated: the red lint job on ionic-team#8535 trips onHttpRequestHandlerTest.javaformatting that was fixed on main by ionic-team#8542, so a rebase onto current main clears it.