Repository navigation
Conversation
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.
Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.
Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Skip Pull Request Checklist:
swift testCode generated by Codex under supervision - all changes were validated manually on test devices
Summary
This fixes multiple visual glitches observed while working with the Android sheet view: sizing and transient clipping + support solid presentation background colors.
Breaking it down:
onGeometryChangereport the full measured layout size even when a scroll viewport clips the view. Frame queries retain their existing clipped bounds..height(...)as usable content height, accounting for bottom system bars and capping oversized values at the large-sheet boundary..presentationBackground(Color)for sheets and full-screen covers, resolving adaptive colors inside the presentation's color scheme. Clear backgrounds reveal the presenter; omitting the modifier preserves the default background.Usage Example
API Shape
The Android
PresentationRootentry point also gains an optionalbackgroundColor: Color? = nilparameter. Geometry observation keeps its existing public API.Testing
After rebasing onto upstream
0787680:Limitations
Color, applied directly to presented content; other shape styles and custom background views remain unsupported.Pre-existing limitations, unchanged by this PR
Neither of the following is introduced by this PR:
Sheet clipping regression
Tests/SkipUITests/Skip/SheetPresentationTests.ktexercises the production AndroidSheetPresentationwith a minimal Compose body. It needs no application,network service, account, or measured-content sizing code.
The regression changes a fixed detent from 260 to 520 points. The header's
layout moves immediately. Before the fix, the clipping outline can still use
the previous top inset for one frame, hiding the header. The fix reads the inset
while constructing the outline instead of capturing it earlier in composition.
Why the original code could hide content
The sheet uses the same top inset for two jobs: positioning the content below
its reserved top space, and clipping away that space. Those values must agree
in the frame being drawn.
Previously,
SheetPresentationreadtopInset.valuein its outer compositionand captured the resulting pixel value in the
GenericShapeclosure. TheModalBottomSheetcontent then resolved the current detent and window insetsand wrote a new value to
topInsetlater in composition.For example, when a sheet expands from 260 to 520 points:
away the newly positioned header. The content exists but is not drawn.
The change keeps the inset calculation and content layout intact. It moves only
its state read into outline construction:
This addresses inconsistent clipping during a layout transition. It does not
suppress general recomposition or change detent selection, measurement, or
animation. The modified presenter serves Android sheets and full-screen covers;
it does not change the shared geometry observer, alerts, or iOS presentation.
The regression fails on the original code and passes with the change on a
Samsung SM-S721U and Pixel 9 Pro emulator, both running Android 16. Frame inspection supports the narrow clipping
finding; the brief artifact is not a persuasive normal-speed video demonstration
of a broader flicker improvement.