Skip to content

Show thumbnail at main image's size in lightbox #830

Closed
@gnprice

Description

@gnprice

With #820 (implementing #799), when you open an image in the lightbox we immediately show the thumbnail (which we'll typically already have loaded, from when you saw the preview in the message list) while we're loading the full image.

One wrinkle is that for some images this means that the thumbnail appears smaller than the full image will, so there's a pop where it expands when the fetch finishes. This is still better than not showing the image at all (at least in cases where the fetch is more than perhaps a few hundred milliseconds), which is why we do it.

But with an extra feature that's now being added in the server, we can do better: the image HTML will encode the original image's dimensions, so we can use those to make sure we show the thumbnail at the same size we'll eventually show the full image. Let's use that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-contentParsing and rendering Zulip HTML content, notably message contentsa-lightboxThe lightbox / image-viewer screenserver-9Things new in Zulip Server 9.0

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions