Skip to content

fix(ios): theme the drawer panel and inset it below the status bar - #79

Open
CodyPChristian wants to merge 1 commit into
NativePHP:mainfrom
CodyPChristian:fix/ios-drawer-theme-and-safe-area
Open

fix(ios): theme the drawer panel and inset it below the status bar#79
CodyPChristian wants to merge 1 commit into
NativePHP:mainfrom
CodyPChristian:fix/ios-drawer-theme-and-safe-area

Conversation

@CodyPChristian

Copy link
Copy Markdown
Contributor

Two defects visible the moment a drawer opens on a themed app.

The panel is not themed

drawerView paints Color(.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 pins UIUserInterfaceStyle, 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 \.nativeUITheme like 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 windowSafeAreaTop this file already computes for the ☰ button, and for the same stated reason: a nested GeometryReader reports an unreliable safeAreaInsets.top here.

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.

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.
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.

1 participant