GeezerVison is showing github.com — [Bottom Sheet] Merge duplicate detents + other fixes by lukas-cap · Pull Request #2255 · microsoft/fluentui-apple
Conversation
Platforms Impacted
Description of changes
We saw a bug where the partial detent height wasn't accounting for bottom safe area.
While fixing that, I noticed we have a lot of bugs around detent availability in restricted height scenarios. Dynamic height resolvers can produce a partial height effectively equal to collapsed or expanded. This caused invisible state cycling on handle taps, incorrect pan snapping, and meaningless delegate notifications.
Add supportsCollapsedState and supportsPartialState computed properties that gate detent availability. Partial is skipped when its height is within a merge threshold of collapsed or expanded. Collapsed is skipped when the sheet is height-restricted. Layout changes that invalidate the current detent reposition the sheet to expanded with delegate notification.
Binary change
(how is our binary size impacted -- see https://github.com/microsoft/fluentui-apple/wiki/Size-Comparison)
Verification
(how the change was tested, including both manual and automated tests)
Visual Verification
| Before |
After |
| Screenshot or description before this change |
Screenshot or description with this change |
Pull request checklist
This PR has considered:
- Light and Dark appearances
- iOS supported versions (all major versions greater than or equal current target deployment version)
- VoiceOver and Keyboard Accessibility
- Internationalization and Right to Left layouts
- Different resolutions (1x, 2x, 3x)
- Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
- iPad Pointer interaction
- SwiftUI consumption (validation or new demo scenarios needed)
- Objective-C exposure (provide it only if needed)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…panded
Dynamic height resolvers can produce a partial height effectively equal
to collapsed or expanded. This caused invisible state cycling on handle
taps, incorrect pan snapping, and meaningless delegate notifications.
Add supportsCollapsedState and supportsPartialState computed properties
that gate detent availability. Partial is skipped when its height is
within a merge threshold of collapsed or expanded. Collapsed is skipped
when the sheet is height-restricted. Layout changes that invalidate the
current detent reposition the sheet to expanded with delegate notification.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
When a detent becomes invalid during layout (e.g. partial merges with
collapsed), the controller now properly fires willMoveTo before didMoveTo,
preserving the standard will/did delegate contract. Also avoids redundant
side effects by inlining only the necessary state update instead of calling
handleCompletedStateChange.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.