stash icon indicating copy to clipboard operation
stash copied to clipboard

Mobile controls on gallery lightbox

Open sleetx opened this issue 3 years ago • 4 comments

On mobile devices, the gallery lightbox does not respond to standard mobile controls. This is sometimes called "touch gestures" or "swipe navigation". Stash still uses desktop image controls despite being in mobile format.

To reproduce: Open gallery lightbox on a mobile device. When attemping to swipe left or right, the image follows the user's finger moving around the screen - often moving most of the image off-screen depending how far you swipe. In addition, double tapping the image does not control zoom, it simply detects which half of the image you tapped and decides to go back/forward one image (like the desktop controls).

Expected functionality should match most mobile UI interfaces:

  • Left/right swipe moves to the previous or next image
  • Double tap to zoom in; double tap again to fit-to-screen

sleetx avatar Apr 28 '22 07:04 sleetx

Just a note, touch gestures should not be limited to mobile viewports. Swipe navigation is also very useful on laptops and large viewport touch devices.

echo6ix avatar May 19 '22 17:05 echo6ix

From Discord

Not sure what lightbox is being used in stash, but there are a few open source alternatives that support mobile swipe and double-tap zoom controls https://github.com/andreknieriem/simplelightbox

echo6ix avatar May 19 '22 21:05 echo6ix

Photoswipe is also an excellent open source mobile + desktop image gallery. It supports many types of photos including very high resolution images. https://photoswipe.com/

eoop avatar Jul 08 '22 08:07 eoop

Indeed with https://github.com/dromru/react-photoswipe-gallery it should be pretty trivial to do. After experimenting a bit, the main change would be the current lightbox component is used inside of ImageList and GalleryList. The new lightbox would wrap those instead.

ghost avatar Aug 27 '22 05:08 ghost