Samuel
Made the decision to drop the shared element transitions from the image viewer. Unfortunately, react-native-reanimated is not quite there yet :(
2 1 7
hailey
if you want...i can throw a few things over your way. i think i know a few of the issues you're having there.
2 3
hailey
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...)
1 1
hailey
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)
1 1
hailey
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
1 2
hailey
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.
1 2
hailey
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
1 2
hailey
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)
1 2
hailey
sorry for the long and maybe incoherent thread...if you have discord or something im happy to share some stuff there if thats easier 😅
1 2
Samuel
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
1 1
hailey
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.
1 2
hailey
i need to clean up the code a bit (its honestly a mess of logic, i see why there are not any good image viewer packages available!) but i should probably just put it on npm
1 2
hailey
you and me both. there are a few (the one bsky uses is quite old and is partly using a scrollview (lol)) that either use the old animated api or are just not customizable at all. having to roll my own was a pita, but i feel like ive just *absolutely* mastered reanimated 😅
1 3
hailey
(don't worry, i'll encounter an obscure reanimated error sometime later this week and be crying)
1 3
dan
i think we ended up forking/rewriting a lot of the one we previously used, see here github.com/bluesky-soci... it’s still structured similarly but uses reanimated now and any ideas on improving are welcome! i really want to get the transition in too but not sure how yet
2 6
hailey
also, i *think* i saw you (similar or same avatar?) had opened an issue about expo-image on android causing issues. did that ever get cleared up? have you guys tried doing anything with image prefetching to help with the unloaded images when scrolling?
2 2
dan
that issue got fixed, it was some metaprogramming they’re doing in expo modules being slow in kotlin. they switched to java apis to fix it. that was specifically startup time related tho, one-time cost
2 4
dan
i’m not familiar with problems re: scrolling and unloading. btw one thing we need to fix is that currently all avatars are huge images
1 2
Samuel
@samuel.fm
What’s the plan there - extra avatarThumb field or something?
1 1
dan
anticipating bikeshedding that is actually what i got stuck on
2