Repository navigation
fix(mobile): move the reader's documents below the status bar - #833
Merged
Merged
Conversation
#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.
Follow-up to #832, which did not fix the reported overlap. The header still sat under the status bar after installing that build.
Why #832 was a no-op
#832 padded the reader's own surface by
insets.top. The documents inside it areabsoluteFill, and Yoga positions anabsoluteFillchild from its parent's border edge and sizes it to the border box — a parent's padding never reaches one. So the padding moved nothing: the layers kepttop = 0and full height, and the header stayed exactly where it was.Reproduced against
yoga-layout3.2.1 with this component's structure (mobile/src/features/chat/components/PreviewModal.tsx), status bar 30dp, screen 800dp:(The layout algorithm agrees: in
AbsoluteLayout.cpp, an inset-based absolute child is placed atparent.border()+ inset and sized fromparent.measuredDimension − parent.border(), neverpadding(). TheAbsolutePositionWithoutInsetsExcludesPaddingerrata only covers the no-inset path, so it does not apply toabsoluteFill.)Change
previewStack,flex: 1) and hang the layers off that, so the inset actually moves the documents.Verification
npx jest --runInBand: 126 suites / 2004 tests pass;npm run typecheckandeslintclean.preview-stack, andpreview-stackmust be aflex: 1box inside the padded surface. Falsified it by reverting to the fix(mobile): keep the reader's header out of the status bar #832 shape (layers as direct children of the padded box) — it fails; and by removing the inset — that assertion fails too.env(safe-area-inset-*), which is 0 in desktop Chrome, and web honours padding for absolute children (CSS) where Yoga does not — so the harness renders this identically before and after and cannot catch this class of bug.Please re-check on the phone
The reader's header should now clear the status bar. Note the structural fix is what moves it, so if the header still overlaps, the inset value itself is wrong (i.e. the app's own insets are 0 in that window) and I would look there instead.