We recently introduced an updated lightbox, built using PhotoSwipe, to improve the experience of viewing images and related files on Discourse. This new functionality has been rolled out across all our communities, so you can experience it in your community once you’ve updated to the latest version of Discourse.
What’s changed?
The changes here are pretty subtle. For the most part, the lightbox should function like you’d expect based on similar experiences in other applications.
When you click or tap an image, it opens within the lightbox and increases in size to make it easier for you to see. From there, you can download the image, view the original image, and zoom. If there are multiple images in the post, you can use navigate between them here, too.
It works great on mobile, too, where you can use common gestures like swiping and pinch-zooming.
Oooh, I’m glad Photoswipe was chosen! I remember suggesting it for the feature rework like two years ago, given how I liked this library (I used it for personal projects), but the lightbox rework wasn’t actively worked on then.
Can’t wait to see it on my own forums!
I hope we will be able to swipe the pictures from a gallery by dragging the mouse left or right like on the PhotoSwipe website. It’s a minor feature, but it makes the experience really smooth on desktop.
Do you mean control whether the gallery ends or continues to cycle through the same images? I don’t think there’s a way to control that now…but I’m curious to learn more about your use case here. When would this capability be useful in your community?
The only thing that bugs me is a minor issue that has been present in photoswipe for years.
If you swipe through pictures quickly (in any direction), a grey placeholder appears even for pictures you’ve already viewed, which could be cached.