Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🐛 Fix: Image Tap Delay Issue
Fixes #9049
📝 Problem Description
When tapping on images in posts to open the lightbox viewer, there was a consistent 1+ second delay that made the app appear to hang. This was particularly noticeable on posts with multiple images and significantly degraded the user experience.
🔧 Root Cause Analysis
The delay was caused by
InteractionManager.runAfterInteractions()
in theonPressIn
handler ofImageEmbed.tsx
. This API waits for all pending interactions to complete before executing the image prefetching, which created a blocking operation that users perceived as the app freezing.✅ Solution
1. Removed InteractionManager bottleneck
InteractionManager.runAfterInteractions()
from the imageonPressIn
handler2. Added proactive image prefetching
useEffect
to prefetch full-size images when the component mounts3. Optimized lightbox animations
SLOW_SPRING
toFAST_SPRING
configuration🧪 Testing
📱 User Impact
📁 Files Changed
src/components/Post/Embed/ImageEmbed.tsx
- Removed InteractionManager, added proactive prefetchingsrc/view/com/lightbox/ImageViewing/index.tsx
- Optimized animation timing🎯 Platform Tested
This fix addresses the Android issue reported in #9049, but the optimizations benefit all platforms by making image interactions more responsive across the board.