Repository navigation
fix(mobile): keep the reader's header out of the status bar - #832
Merged
Merged
Conversation
On Android a Modal's window is laid out from the top of the screen and the system draws its status bar over it. The reader's header therefore started at y = 0, so the overflow button sat inside the status bar's hit area: taps there pulled the notification shade down instead of opening the menu. The `SafeAreaView` meant to prevent this cannot work inside a Modal — it resolves insets by walking *native* ancestors up to the app's `SafeAreaProvider`, and a Modal is a separate native window, so it found no provider and applied nothing. Measured on the reporting device: the header occupied rows 0-60dp with the status bar drawn over its top half. Read the inset from the provider context instead, and make the geometry deliberate with `statusBarTranslucent` so the reader extends under the status bar on every Android device rather than only where the window happens to end up that way. Only the top edge is ours: the other edges stay the window's. iOS is unchanged — its reader is a `pageSheet`, which the system already places below the status bar.
huichen
enabled auto-merge (squash)
September 25, 2026 11:30
huichen
added a commit
that referenced
this pull request
Sep 25, 2026
#832 padded the reader's surface by the status-bar inset, but the header did not move: Yoga positions an `absoluteFill` child from its parent's *border* edge and sizes it to the border box, so a parent's padding never reaches one. The layers are absoluteFill, so that padding was a no-op and the header stayed under the status bar. Verified against yoga-layout 3.2.1 with this component's structure: an absolute child of a box padded by 30 kept `top = 0` and its full height, and its header landed at screen y = 0 — reproducing the reported overlap — while the same tree with a flex wrapper inside the padding put the header at y = 30. Give the padded surface one normal flex child (`previewStack`) and hang the layers off that, so the inset actually moves the documents. Everything inside a layer keeps its own coordinate space, so the measured header height that positions the overflow menu is still correct.
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.
The file reader's header on Android starts at y = 0 while the system keeps drawing its status bar over the top of the screen, so the header's controls sit inside the status bar's hit area — tapping the "…" button pulls down the notification shade instead of opening the menu.
Measured on the reporting device (723×1600 screenshot of a 1080×2400 / 3x phone, so 1dp ≈ 2px):
minHeight: 60), border at 60.5dpSo the header got no top inset at all. The
SafeAreaViewthat was supposed to provide it cannot work here: it resolves insets by walking native ancestors up to the app'sSafeAreaProvider, and a Modal is its own native window — nothing inside it descends from that provider, so it found none and applied nothing (harmless on iOS, where the reader is apageSheetthe system already places below the status bar).Change
SafeAreaProvidercontext (as every other Modal surface in the app does, viaDialogSurface) and pad the reader's own surface by it on Android.statusBarTranslucenton the reader'sModalso that "the reader is under the status bar" is deliberate on every Android device, instead of depending on how the system happens to lay that window out (WindowCompat.setDecorFitsSystemWindows(true)on the modal window is a no-op once edge-to-edge is enforced, and RN'sfitsSystemWindowsfallback on the modal's content view no longer pads).statusBarTranslucentextends the reader under the status bar alone, the other edges are still laid out by the window.Verification
npx jest --runInBand: 126 suites / 2003 tests pass.npm run typecheck,eslint src/features/chat: clean.fileActionSurfaces.test.tspins both halves (the modal is status-bar translucent, the surface is padded by the context inset on Android and not on iOS); falsified it by removing the padding and confirming it fails.env(safe-area-inset-*), which is 0 in desktop Chrome, so the harness renders identically before and after.Related, not touched here:
ActionMenuandModelSelectorSheetalso wrap a Modal in the sameSafeAreaView, so their bottom inset resolves to nothing on Android too.