Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Lightbox] Small tweaks (#6301)

* Tweak lightbox springs

* Speed up dismiss speed

* Don't scroll to top while active lightbox

* Make Android a bit faster

authored by

dan and committed by
GitHub
4ca5267b 3bab7f75

+6 -3
+3 -3
src/view/com/lightbox/ImageViewing/index.tsx
··· 62 62 ? (['top', 'bottom', 'left', 'right'] satisfies Edge[]) 63 63 : (['left', 'right'] satisfies Edge[]) // iOS, so no top/bottom safe area 64 64 65 - const SLOW_SPRING = {stiffness: 120} 65 + const SLOW_SPRING = {stiffness: isIOS ? 180 : 250} 66 66 const FAST_SPRING = {stiffness: 700} 67 67 68 68 export default function ImageViewRoot({ ··· 433 433 if (openProgress.value !== 1 || isFlyingAway.value) { 434 434 return 435 435 } 436 - if (Math.abs(e.velocityY) > 1000) { 436 + if (Math.abs(e.velocityY) > 200) { 437 437 isFlyingAway.value = true 438 438 if (dismissSwipeTranslateY.value === 0) { 439 439 // HACK: If the initial value is 0, withDecay() animation doesn't start. ··· 442 442 } 443 443 dismissSwipeTranslateY.value = withDecay({ 444 444 velocity: e.velocityY, 445 - velocityFactor: Math.max(3000 / Math.abs(e.velocityY), 1), // Speed up if it's too slow. 445 + velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow. 446 446 deceleration: 1, // Danger! This relies on the reaction below stopping it. 447 447 }) 448 448 } else {
+3
src/view/com/util/List.tsx
··· 8 8 import {useScrollHandlers} from '#/lib/ScrollContext' 9 9 import {addStyle} from '#/lib/styles' 10 10 import {isIOS} from '#/platform/detection' 11 + import {useLightbox} from '#/state/lightbox' 11 12 import {useTheme} from '#/alf' 12 13 import {FlatList_INTERNAL} from './Views' 13 14 ··· 52 53 const isScrolledDown = useSharedValue(false) 53 54 const t = useTheme() 54 55 const dedupe = useDedupe(400) 56 + const {activeLightbox} = useLightbox() 55 57 56 58 function handleScrolledDownChange(didScrollDown: boolean) { 57 59 onScrolledDownChange?.(didScrollDown) ··· 143 145 contentOffset={contentOffset} 144 146 refreshControl={refreshControl} 145 147 onScroll={scrollHandler} 148 + scrollsToTop={!activeLightbox} 146 149 scrollEventThrottle={1} 147 150 onViewableItemsChanged={onViewableItemsChanged} 148 151 viewabilityConfig={viewabilityConfig}