Skip to content

Add FloatingPanelDetent.Preference #1163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: v.next
Choose a base branch
from

Conversation

dfeinzimer
Copy link
Collaborator

@dfeinzimer dfeinzimer commented May 10, 2025

In certain situations, a view presented in a floating panel needs the map view to be revealed for user interaction:

Typically, this would require the presented view to have a binding to the floating panel's detent; however, the view might not be presented in a floating panel. By providing this internal preference, Toolkit components can communicate a preferred detent to the Floating Panel without developers needing to write any code. Example usage.


@dfeinzimer dfeinzimer requested a review from mhdostal May 10, 2025 00:26
@dfeinzimer dfeinzimer self-assigned this May 10, 2025
@dfeinzimer dfeinzimer added the enhancement New feature or request label May 10, 2025
mhdostal
mhdostal previously approved these changes May 12, 2025
Copy link
Member

@mhdostal mhdostal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good and is a nice way to override the detentions when a component needs to.

@dfeinzimer
Copy link
Collaborator Author

A reservation I have with this approach is that supporting the same behavior for sheets seems problematic. Sheets (surprisingly) don't animate nicely when nested views with the presentationDetents(_:) modifier applied appear and disappear:

Should we forego this magic approach and instead have developers manage their detents by adding more cases to FeatureFormView.EditingEvent like mapInteractionStarted/mapInteractionEnded?

@mhdostal
Copy link
Member

Should we forego this magic approach and instead have developers manage their detents by adding more cases to FeatureFormView.EditingEvent like mapInteractionStarted/mapInteractionEnded?

Will this alleviate the problems with sheets?

@dfeinzimer
Copy link
Collaborator Author

Will this alleviate the problems with sheets?

It doesn't seem to. There's some discussion about this issue here, but I haven't yet been able to make the suggestions work correctly with our views.

Regardless, it might be best overall to take the sheet/panel agnostic approach and just report what the user is doing via the new cases suggested above on FeatureFormView.EditingEvent or another new enum altogether.

@mhdostal
Copy link
Member

Regardless, it might be best overall to take the sheet/panel agnostic approach and just report what the user is doing via the new cases suggested above on FeatureFormView.EditingEvent or another new enum altogether.

Ok. Let's try and make it the default/predominant use case work with little or not extra code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants