Fix Android safe area insets for edge-to-edge display in .NET 10 #75
+25
−34
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.
Fix seamless status bar and navigation bar on Android (.NET 10)
This PR fixes the issue where the status bar and navigation bar overlay app content without proper safe area handling on Android.
Changes made:
.page-headerto usetop: env(safe-area-inset-top)instead oftop: 0to respect safe area.status-bar-safe-areadiv from HTML (no longer needed with CSS env variables).status-bar-safe-areaCSS rules (consolidated into page-header).page-bodybottom padding to respect bottom safe area insetsTechnical Details:
The key fix was changing
.page-headerfromtop: 0totop: env(safe-area-inset-top). This ensures the sticky header respects the status bar area on Android.The previous approach using a separate
.status-bar-safe-areadiv didn't work because:#appdiv where Blazor renders.page-headerwithposition: sticky; top: 0would stick to the viewport top, ignoring the safe area divThe new approach uses CSS environment variables directly in the page header positioning, which properly accounts for system UI insets on both Android and iOS.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.