Repository navigation
feat(native-overlay): add contentSize for non-sheet content - #205
Merged
Merged
Conversation
JS lays non-sheet overlay content out at the window size it last saw, and the Android content host clips the content to that frame. Right after the window rotates, JS still holds the previous size, so content prepared for the rotated window is cut off until JS catches up. contentSize lets a caller lay the content out at the size of the window it is about to rotate into, so the first rotated frame shows all of it. Omitted, the content follows the window size as before. The spec documents the behavior and its platform scope.
7 of 9 tasks
limichange
enabled auto-merge (squash)
November 4, 2026 12:31
Contributor
sidmorizon
reviewed
Nov 5, 2026
originalix
approved these changes
Nov 5, 2026
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.
Summary
Adds an optional
contentSizeprop toOverlayViewfor non-sheet presentations, so a caller can lay its content out at the size of the window it is about to rotate into.Why
JS lays non-sheet overlay content out at the window size it last saw (
useWindowDimensions), and the Android content host clips the content to that frame. JS hears about a rotation only after the window has rotated, so for the first rotated frames the content keeps the previous orientation's frame and is cut off.OneKey's Android native chart fullscreen hits this: it prepares a hidden landscape layer in an
OverlayView, rotates the window, and shows the layer as the rotation starts. WithoutcontentSize, the first landscape frames show only the part of the layer inside the stale portrait frame, with the page visible beside it, until JS processes the new window size.Changes
OverlayViewTypes.ts: optionalcontentSize?: { width, height }(native, non-sheet).contentSize.ts:resolveContentSizepicks the caller size over the window size; omitted, the content follows the window size as before.OverlayView.tsx: the non-sheet content frame usesresolveContentSize.docs/SPEC.md: new "Content size for windows about to rotate" section under 5.6, the prop in the 5.3 component sketch, and the new test in 5.9.Spec audit
Validation
yarn typecheckpasses.yarn lint: 0 errors; the same 12 pre-existing inline-style warnings asmain; Prettier clean.yarn test: 10 suites, 103 tests pass, including the newcontentSize.test.ts.🤖 Generated with Claude Code