Skip to content

content: Design a "request failed" placeholder for images in messages #265

@chrisbobbe

Description

@chrisbobbe

By default when an image's network request fails, the image just stays blank.

We should override that default with our own custom placeholder. The API gives us the error object, so if we want to, I expect we can offer a different placeholder for different failure modes, like:

  • 404 not found
  • no Internet connection

Note that there's a related but different issue, where we don't handle well the case where an image's srcUrl string doesn't parse. For that, see discussion at: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Handling.20preview-image.20.60src.60.20that.20doesn't.20parse/near/1623918

Details about debug builds

In debug builds, there's an uglier default placeholder:

In message list In lightbox
image image

(And in case it's helpful, here's a video of tapping the preview to open the lightbox, then exiting the lightbox: https://github.com/zulip/zulip-flutter/assets/22248748/1a50401b-eec6-4a2a-8002-583a6ed15e34 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-contentParsing and rendering Zulip HTML content, notably message contentsa-designVisual and UX design

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions