Oh I’d love to know! There’s 3 issues:
1. It gets stuck on the screen sometimes and won’t go away
2. It blocks interaction while transitioning
3. It’s slow and bad looking
i think deckblue put this on a different post on accident...so uh, sorry if i am posting this twice.
this is what we can achive though with expo-image, reanimated, gesture-handler, and a modal
i.imgur.com/7IVwwtY.mp4
i think im running the latest version, and im seeing the transition issue when i open an image (obviously expo-image is reloading the image). a few things we can do to fix that (i'll look at the code here soon too and actually verify these are the issues...)
for one, see if using expo-image 1.8 causes any issues for you (it shouldn't, i think the breaking changes are in 1.9). i added a few PRs there for image prefetching (also fixed some issues with GIF performance and start/stop animation, which might help you out as well but is unrelated)
what i personally do is prefetch the necessary images once i get the feed data. the default now is to cache to both the disk and to memory. then, if we set cachePolicy to "memory-disk", as images get loaded into the view they will be stored in the memory cache
if you use memory-disk both in the feed *and* in the image viewer, there will be only a *very* minor delay in the subsequent loading (especially since bsky images are so small anyway).
and finally, what we want to do is change how the modal works.
the image inside of the feed should *not* be resized. all we want to do is present a modal with the image originally in the same position as the one in the feed. it will quickly load "ontop of" the image in the feed, so there is zero noticable delay in the loading
and finally, you can set the opacity of the image in the feed to zero while the modal is open, so that when you close the viewer it *looks like* a single image is just moving back to the original position. (using a set timeout of 100ms or so, again to prevent weird issues with the delay)
Yeah super helpful! - you can find me on discord: mozzius
sounds like the way to go is switch from the viewer being a different screen, with a SET, to a custom modal thingy
super briefly (and i can just share code too later when i get home) i have my app wrapped in ImageViewerContext, which has a modal. Whenever I press on a ViewerImage (what is in the feed), it updates the state of the modal with all the necessary info and toggles its visibility.