Skip to content

A few comment/image improvements#1390

Merged
hjiangsu merged 2 commits intothunder-app:developfrom
micahmo:feature/comment-image-improvements
May 31, 2024
Merged

A few comment/image improvements#1390
hjiangsu merged 2 commits intothunder-app:developfrom
micahmo:feature/comment-image-improvements

Conversation

@micahmo
Copy link
Copy Markdown
Member

@micahmo micahmo commented May 28, 2024

Pull Request Description

This PR makes a couple of changes to comments and images.

  1. Comment contents are now in an AnimatedSize. This means when anything changes with respect to the height of the comments (an example is viewing the raw markdown), it will more nicely animate.
  2. Add a solid color placeholder for images previews in markdown. This should make it more obvious that an image is loading instead of there just being a blank space in comments.
  3. Defer SVG checking, which previously would cause a big delay (and a big jump in comment size, which is annoying when scrolling) before the image placeholder could take its place. Now we assume it's a regular image and only show an SVG if we find otherwise.
  4. Remove the "unable to load" message (especially since this looked bad in the feed) and replace with a more generic placeholder for a "failed" image. (This also makes the SVG loading look less bad than an error message.)

Hopefully that all makes sense!

Hide whitespace.

Screenshots

Bad Image Placeholder

Before After
image image

Image Load

Before

image-load-in-before.mp4

After

image-load-in-after.mp4

Copy link
Copy Markdown
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this - the comment section jumping was also somewhat annoying for me, but I never had the chance to look into it further!

LGTM - just one comment!

Comment thread lib/shared/image_preview.dart Outdated
@hjiangsu hjiangsu added this to the 0.5.0 milestone May 30, 2024
@hjiangsu hjiangsu merged commit 2cc236e into thunder-app:develop May 31, 2024
@micahmo micahmo deleted the feature/comment-image-improvements branch May 31, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants