Ein aktualisierter Lightbox für bessere Bildanzeige

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.

Here are some images you can use to try it out:

Please let us know if you have any questions, notice any issues with the new lightbox, or have suggestions for further improvements!

26 „Gefällt mir“

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.

5 „Gefällt mir“

Thanks @Canapin, you’ve made me realize that I’ve missed the opportunity to add an image gallery to the OP so folks can try it out now.

Just tested this out, looks like you should indeed be able to swipe!

6 „Gefällt mir“

I really love this feature! A very clean design, and works really nice too.

One question - is there a way to control whether the pictures ‘loop’ or not?

2 „Gefällt mir“

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?

1 „Gefällt mir“

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.

1 „Gefällt mir“

I meant that when it reaches the end, the next slide is the 1st, and so on. It would be easier, say in posts with many images. But I think the current implementation is also fine.

So it looks like with this image system, the image retains the original filename which is great – that’s one of my small irks with the old system :+1: Being able to drag to pan is also very handy!

One thing I’m not a fan of though is the speed at which the image zooms in when you click the thumbnail. It’s somewhat a matter of personal preference, but I like the fast speed of the old system. In a thread with a lot of images, it’s nice to just get to the image quickly instead of waiting on superfluous animations to finish on every single thumbnail click. I would suggest making it match the previous speed

Thank you :slight_smile:

1 „Gefällt mir“