[x] If this PR alters the UI, I have attached pictures/videos
[x] This PR addresses one or more open issues that were assigned to me:
closes #1218
(no open issue) closes community feedback - image viewer broken
(no open issue) fixes stuttery tile feed
Pull Request Information
Review Note
FixedImageView, CircleCroppedImageView,ImageViewer, and FixedImageLoader contain the new "real" code. The rest of the line count is renames (and a couple palette calls).
Major Changes
Updates FixedImageView to use Nuke for image resizing rather than the resizeImage function (through the new FixedImageLoader). This results in significantly smoother performance on image-dense feeds, especially in tile mode, and also makes the image viewer much more responsive (though I'm not entirely sure why).
The above change necessitates passing a size parameter into FixedImageView, since it needs to know ahead-of-time which size to initialize the loader with to perform image sizing. ThumbnailImageView and CircleCroppedImageView now provide and pass through the new frame parameter. This also lets us apply the .frame modifier automatically inside those views using that parameter, which saves us a bunch of lines.
AvatarStackView also now takes a height parameter to accomodate the above.
Bug Fixes
Fixes an issue with how ImageViewer was removing thumbnail sizing information from URLs. Previously it would remove all query components; on instances such as lemm.ee, which use image proxying, this also resulted in the image URL itself being stripped away due to the image proxy using a query param to capture the URL. The ImageViewer now only removes query parameters beginning with thumbnail.
Adds some missing palette calls
Fixes ImageLoader.load being marked @Sendable despite not being sendable. It is now invoked in an .onAppear { Task { ... }} construction.
Checklist
Pull Request Information
Review Note
FixedImageView
,CircleCroppedImageView,
ImageViewer
, andFixedImageLoader
contain the new "real" code. The rest of the line count is renames (and a couple palette calls).Major Changes
FixedImageView
to use Nuke for image resizing rather than theresizeImage
function (through the newFixedImageLoader
). This results in significantly smoother performance on image-dense feeds, especially in tile mode, and also makes the image viewer much more responsive (though I'm not entirely sure why).FixedImageView
, since it needs to know ahead-of-time which size to initialize the loader with to perform image sizing.ThumbnailImageView
andCircleCroppedImageView
now provide and pass through the newframe
parameter. This also lets us apply the.frame
modifier automatically inside those views using that parameter, which saves us a bunch of lines.AvatarStackView
also now takes aheight
parameter to accomodate the above.Bug Fixes
ImageViewer
was removing thumbnail sizing information from URLs. Previously it would remove all query components; on instances such as lemm.ee, which use image proxying, this also resulted in the image URL itself being stripped away due to the image proxy using a query param to capture the URL. TheImageViewer
now only removes query parameters beginning withthumbnail
.palette
callsImageLoader.load
being marked@Sendable
despite not being sendable. It is now invoked in an.onAppear { Task { ... }}
construction.