fix(ios): theme the drawer panel and inset it below the status bar - #79
Open
CodyPChristian wants to merge 1 commit into
Open
fix(ios): theme the drawer panel and inset it below the status bar#79CodyPChristian wants to merge 1 commit into
CodyPChristian wants to merge 1 commit into
Conversation
Two defects, both visible the moment a drawer opens on a themed app. The panel painted Color(.systemBackground). The drawer's own content is only as tall as it is, so everything below the last row fell through to the system colour — white on an app that pins UIUserInterfaceStyle, whatever the site's palette. A themed panel that turns white halfway down reads as a rendering fault, because it is one. It now paints theme.background. The panel also ignores the safe area so its background can reach the top of the screen, but the CONTENT ignored it too, so the first row slid under the status bar and the title overlapped the clock. The content is now padded by the window's top inset — the same windowSafeAreaTop this file already computes for the ☰ button, and for the same reason: a nested GeometryReader reports an unreliable value here. Reported against a white-label app whose drawer showed the site name overlapping the status bar with the lower half of the panel rendering white.
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.
Two defects visible the moment a drawer opens on a themed app.
The panel is not themed
drawerViewpaintsColor(.systemBackground). The drawer's content is only as tall as it is, so everything below the last row falls through to the system colour — white on an app that pinsUIUserInterfaceStyle, whatever the theme says.A themed panel that turns white halfway down reads as a rendering fault, because it is one. It now paints
theme.background, read from\.nativeUIThemelike every other renderer.The content ignores the safe area along with the background
The panel deliberately ignores the safe area so its background can reach the top of the screen. The content ignores it too, so the first row slides under the status bar — on a white-label app this put the site name directly over the clock.
The content is now padded by the window's top inset, reusing the
windowSafeAreaTopthis file already computes for the ☰ button, and for the same stated reason: a nestedGeometryReaderreports an unreliablesafeAreaInsets.tophere.Note for consumers
A drawer view that declares its own
safe-area(or its own scroll view) should drop it — the host provides both, and declaring them again double-counts the inset and nests a scroll view inside a scroll view.Reported against a white-label app whose drawer showed the site name overlapping the status bar with the lower half of the panel rendering white.