Skip to content
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

Editor sheet detents #633

Merged
merged 2 commits into from
Sep 23, 2023
Merged

Editor sheet detents #633

merged 2 commits into from
Sep 23, 2023

Conversation

boscojwho
Copy link
Contributor

@boscojwho boscojwho commented Sep 21, 2023

Checklist

Pull Request Information

About this Pull Request

This PR includes two UI changes to Post editor and Response editor when presented as sheets:

  1. Adds .medium presentation detent, while allowing users to interact with the view behind it while in .medium detent.
  • Note: Interaction with view behind is only available on iOS 16.4 or later.
  1. Disable interactive dismissal when editor has content.

Additional Notes

Sheet initially presents at .medium detent before moving to .large on initial presentation:

  • To immediately present sheet in .large, we should pass a selection binding to .presentationDetents(...), but doing so causes the content view to call into its body, resulting in visible lag when switching between detents.
  • To workaround this animation hitch, we could move the detent binding into each of the composer views, but we would also need to move the sheet's NavigationStack into the composers view, as well, since .sheet(...) expects presentation detent modifiers to be applied on the root view.

Screenshots and Videos

Comment.editor.mov
post.editor.mov

@boscojwho boscojwho requested a review from a team as a code owner September 21, 2023 23:08
@boscojwho boscojwho requested review from mormaer and ShadowJonathan and removed request for a team September 21, 2023 23:08
@EricBAndrews
Copy link
Member

Merging per 12hr principle

@EricBAndrews EricBAndrews merged commit 3072910 into dev Sep 23, 2023
4 checks passed
@EricBAndrews EricBAndrews deleted the bosco/editor-sheet-detents branch September 23, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants