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

QuickLook swipe down and less message motion when coming back from GiveBackMyFirstResponder #2482

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Amzd
Copy link
Collaborator

@Amzd Amzd commented Jan 5, 2025

This PR makes the image preview (quicklook) able to be dismissed by swiping down, instead of the default popGestureRecognizer. This is an improvement because A; the popGesture is only enabled when the navigation bars are shown, B; it interferes with swiping to previous image, and C; the animation feels good.

For this to look good I had to reduce the motion on messages when presenting/dismissing view controllers some more. Now after a view is dismissed the scroll updating is delayed by 0.5s which means that first; the ChatViewController can become firstResponder (bringing up the accessory) and then; the text field can become firstResponder (bringing up the keyboard) without the chat scrolling.

Quick Look Dismiss

Before After
RPReplay_Final1736090240.mp4
RPReplay_Final1736090333.mp4

Reduced motion

Before After
RPReplay_Final1736090019.mp4
RPReplay_Final1736089664.mp4

@Amzd Amzd added the enhancement actually in development, user visible enhancement label Jan 5, 2025
@Amzd Amzd requested a review from r10s January 5, 2025 15:54
@Amzd Amzd marked this pull request as ready for review January 5, 2025 15:54
@r10s
Copy link
Member

r10s commented Jan 10, 2025

hm, i am not sure i got the gist of this PR completely.

  • swipe-down-to-exit-gallery worked also before, and at least on iOS 18, even smoother:

    • really only the image is swiped down, not the whole screen including black borders - this looks esp weird for landscape images
    • no 1-second-delay before the message view with the image is shown again
  • opening the gallery without any controls to share etc. may be unexpected: none of whatsapp or telegram do that. the controls only disappear on a second tap

  • the message view scrolling in-sync with the gallery left/right: not sure if that is expected by the user or not - whatsapp does it, telegram does not

  • the reduced motion is nice

however, always good to have options, so thanks for diving into that. and as said, sorry, if i missed sth.

Amzd added 2 commits January 11, 2025 17:47
it was late when i wrote this, idk why it had opacity = 0 on the view that would animate but it slipped through because it worked fine on iOS 16
@Amzd
Copy link
Collaborator Author

Amzd commented Jan 12, 2025

TODO: on iOS 18 the keyboard is hidden after viewing a photo, can be fixed by a GiveBackMyFirstResponder extension for UINavigationController.pushViewController(_: QLPreviewController) that does the same as UIViewController.present(_: QLPreviewController)

@Amzd
Copy link
Collaborator Author

Amzd commented Jan 13, 2025

Scratch that, that opened a massive can of worms. On iOS 18 the keyboard is just hidden when you click on an image in chat and it does not come back automatically, this is a fine UX I think (and not changed by this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement actually in development, user visible enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants