deltachat / deltachat-desktop

Email-based instant messaging for Desktop.
GNU General Public License v3.0
950 stars 170 forks source link

unexpected zoom/scroll behavior in gallery #2632

Open r10s opened 2 years ago

r10s commented 2 years ago

in the gallery, images can be zoom meanwhile, which is great.

however, the used gestures are not standard and unexpected:

we should either disable two finger sliding at all (i would not like that), or, much better, move the zoomed image around so that the user can actually enlarger every detail of an image and not only the center. the latter is also what eg. telegram is doing and most other apps i know about.

Simon-Laux commented 2 years ago

this might be difficult because there are multiple targets:

also we used a library and did not implement it ourselves so we gotta fork that library I guess.

r10s commented 2 years ago

yip, mouse works as expected, at a first glance (i do not have a mouse, but click-move on the touchpad moves the image around).

maybe the library just treats "scrollwheel == two finger gesture "- and devices to zoom in this case. which might be okayish for mouse, but is definitely wrong for touchpad. (even for mouse, usually zoom is sth. as ctrl+wheel, wheel usually just moves up/down)

maybe we can disable the two-finger thingie but keep scrollwheel? the library should treat that differently, however.

also we used a library and did not implement it ourselves so we gotta fork that library I guess.

of do a change upstream? or file a bug there?

Simon-Laux commented 2 years ago

https://prc5.github.io/react-zoom-pan-pinch/?path=/story/examples-big-image--big-image

wheel.wheelDisabled fixes the strange behaviour on fancy apple touchpads, but then scrolling to zoom with a mouse does not work anymore. wheel.touchPadDisabled could be what we need in theory but does not work on their demo site :(.

if you want to file a bug, upstream is here: https://github.com/prc5/react-zoom-pan-pinch

I think the expected behaviour for the Mac touchpad would be:

r10s commented 2 years ago

I think the expected behaviour for the Mac touchpad would be:

2 finger diagonal pinching (moving together) for zooming 2 finger panning (moving together in one direction) for moving around in the zoomed in image

yes. but that is not limited to mac, there is nothing fancy in that any longer :) windows uses the same gestures (pinch/punch to zoom and two-fingers to scroll) and iirc i also used the same in many ubuntu apps.

also, Delta Chat supports two-finger-panning in the chat-and in the message-lists.

wheel.wheelDisabled fixes the strange behaviour [...]

so, pinch-to-zoom and two-finger-scroll works then?

i would go for disabling wheel then, this is the minor issue. wheel zooming without a qualifier key is a bit special anyway (there is sth. as wheel.activationKeys, however, not sure about all these interactions :)

r10s commented 2 years ago

to sum up: to fix the bug:

that would still not allow two-finger-panning, but also would not result in unexpected jittering when trying so.

panning can still be done by dragging.

of course, having real two-finger-panning would be nice as well, but that is beyond the bug fix.

Jikstra commented 2 years ago

Sorry but I don't really see this as an issue with any priority (not that you communicated this directly, but this issue already got quite some detailed replies from you so it feels like its an important one for you). If anyone feels like working on this that's of course appreciated but besides this it's an annoyance that only sooome people will experience. I think besides @treefits mac no other dev device even supports multi gestures on the hardware side. Plus I for myself wouldnt even know with which browser apis a gesture slide would be detectable. For sure possible but probably would need some learning of new apis. So I think there's a looot of other things that have more value for more people then this bug.

r10s commented 2 years ago

this issue is not more important to me than other ones :) but i agree that this is not the most important bug. and yes, it is hard to target for devs not using touchpads supporting gestures.

but it is still pretty annoying and unusual ui/ux - and not only for sooome mac (or only for me :), but for most ppl using a touchpad - gestures are quite usual on all systems nowadays :)

as one probably cannot really see the issue when not using touchpads, here is a little video showing how things look like when zooming to a point (works) and then try to pan around (works not - results in zooming and jittering):

https://user-images.githubusercontent.com/9800740/159467122-d8b14765-5b68-4599-a428-409aa9e2b92e.mov

so, i think, that should be targeted somehow, see details and suggestions to solve it above above - but we can do that later and we can remove it from the 1.30 project to make room for more important bugs.

Simon-Laux commented 2 years ago

so you want two fingers to be panning additionally to not be scrolling?

Simon-Laux commented 1 year ago

https://github.com/prc5/react-zoom-pan-pinch/issues/113 https://github.com/prc5/react-zoom-pan-pinch/issues/370

maxphilippov commented 1 month ago

@r10s I don't use gestures a lot, but does Profile Image Selector work the way you describe? Could it be worth to just factor out zoom/pan code from there and apply it to Gallery?

Simon-Laux commented 1 month ago

Profile Image Selector

On that note, we should check if the todo items in https://github.com/deltachat/deltachat-desktop/issues/3893 are still to do.

r10s commented 1 month ago

I don't use gestures a lot, but does Profile Image Selector work the way you describe?

in the profile image selector, the zoom gestures are differently, but not correct. EDIT: i created a dedicated issue for that at https://github.com/deltachat/deltachat-desktop/issues/4218