Athlon007 / Leomard

A Lemmy client for macOS
GNU General Public License v3.0
66 stars 3 forks source link

[BUG] Post images reload when cell reappears after scrolled off-screen #30

Closed boscojwho closed 1 year ago

boscojwho commented 1 year ago

Describe the bug After a post view loads an image, and user scrolls it out of view, the post view will reload that image when that post view's cell reappears.

To Reproduce Steps to reproduce the behavior:

  1. Launch app to Feed list view.
  2. Wait for First post image to load.
  3. Scroll down so first post is just out of view.
  4. Scroll back to top.
  5. First post's image will reload.

Expected behavior

Information: Version 0.1 (1)

Athlon007 commented 1 year ago

I know of this issue, this is why there is this hacky workaround that retains the height of an image. From what I gathered, it has something to do with LazyVStack and AsyncImage combo.

One solution would likely be switching to normal VStack. This will cost some memory, buuuuut that will fix issues with retention of height and images themselves.

There may be other fixes, but I have not researched them thoroughly.

boscojwho commented 1 year ago

I know of this issue, this is why there is this hacky workaround that retains the height of an image. From what I gathered, it has something to do with LazyVStack and AsyncImage combo.

Indeed: Found this post here with the exact same issue.

boscojwho commented 1 year ago

One solution would likely be switching to normal VStack. This will cost some memory, buuuuut that will fix issues with retention of height and images themselves.

Changing the root view to a VStack doesn't fix the AsyncImage caching issue, and I actually managed to break the layout while doing this, oops.

Athlon007 commented 1 year ago

Fixed in #33