Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Composer - make bottom border more consistent when typing (#4343)

* floor values

* fix last line being obscured

* Rm unnecessary runOnUI

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>

authored by

Samuel Newman
Dan Abramov
and committed by
GitHub
d0327342 3e1f0768

+10 -10
+10 -10
src/view/com/composer/Composer.tsx
··· 20 20 } from 'react-native-keyboard-controller' 21 21 import Animated, { 22 22 interpolateColor, 23 - runOnUI, 24 23 useAnimatedStyle, 25 24 useSharedValue, 26 25 withTiming, ··· 396 395 testID="composePostView" 397 396 behavior="padding" 398 397 style={a.flex_1} 399 - keyboardVerticalOffset={replyTo ? 110 : isAndroid ? 180 : 140}> 398 + keyboardVerticalOffset={replyTo ? 115 : isAndroid ? 180 : 162}> 400 399 <View 401 400 style={[a.flex_1, viewStyles]} 402 401 aria-modal ··· 650 649 'worklet' 651 650 652 651 if (typeof newContentHeight === 'number') 653 - contentHeight.value = newContentHeight 652 + contentHeight.value = Math.floor(newContentHeight) 654 653 if (typeof newContentOffset === 'number') 655 - contentOffset.value = newContentOffset 654 + contentOffset.value = Math.floor(newContentOffset) 656 655 if (typeof newScrollViewHeight === 'number') 657 - scrollViewHeight.value = newScrollViewHeight 656 + scrollViewHeight.value = Math.floor(newScrollViewHeight) 658 657 659 658 hasScrolledBottom.value = withTiming( 660 - contentHeight.value - contentOffset.value >= scrollViewHeight.value 659 + contentHeight.value - contentOffset.value - 5 > scrollViewHeight.value 661 660 ? 1 662 661 : 0, 663 662 ) ··· 667 666 668 667 const scrollHandler = useAnimatedScrollHandler({ 669 668 onScroll: event => { 669 + 'worklet' 670 670 hasScrolledTop.value = withTiming(event.contentOffset.y > 0 ? 1 : 0) 671 - 672 - // already on UI thread 673 671 showHideBottomBorder({ 674 672 newContentOffset: event.contentOffset.y, 675 673 newContentHeight: event.contentSize.height, ··· 680 678 681 679 const onScrollViewContentSizeChange = useCallback( 682 680 (_width: number, height: number) => { 683 - runOnUI(showHideBottomBorder)({ 681 + 'worklet' 682 + showHideBottomBorder({ 684 683 newContentHeight: height, 685 684 }) 686 685 }, ··· 689 688 690 689 const onScrollViewLayout = useCallback( 691 690 (evt: LayoutChangeEvent) => { 692 - runOnUI(showHideBottomBorder)({ 691 + 'worklet' 692 + showHideBottomBorder({ 693 693 newScrollViewHeight: evt.nativeEvent.layout.height, 694 694 }) 695 695 },