@devries-cameron20 / t3code-1 / commits / 90f3913a81
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): stop long iOS threads from jumping while scrolling up (#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Theo Browne committed Jul 30, 2026 at 03:05 UTC 90f3913a81380af7aeafac62f8132aeb98345a12
4 files changed +185 -99
apps/mobile/package.json
+1 -1
@@ -49,7 +49,7 @@
49 "@expo-google-fonts/dm-sans": "^0.4.2",
50 "@expo/metro-runtime": "~56.0.15",
51 "@expo/ui": "~56.0.18",
52 - "@legendapp/list": "3.2.0",
52 + "@legendapp/list": "3.3.3",
53 "@noble/curves": "catalog:",
54 "@noble/hashes": "catalog:",
55 "@pierre/diffs": "catalog:",
patches/@legendapp__list@3.3.3.patch renamed
+159 -85
@@ -1,8 +1,8 @@
1 diff --git a/keyboard.d.ts b/keyboard.d.ts
2 -index 5a115ea..2c65d31 100644
2 +index 7bc3bb8..75ec120 100644
3 --- a/keyboard.d.ts
4 +++ b/keyboard.d.ts
5 -@@ -269,7 +269,7 @@ type KeyboardChatComposerInsetListRef = {
5 +@@ -277,7 +277,7 @@ type KeyboardChatComposerInsetListRef = {
6 type KeyboardChatComposerRef = {
7 current: Pick<View, "measure"> | null;
8 };
@@ -11,7 +11,7 @@ index 5a115ea..2c65d31 100644
11 contentInsetEndAdjustment: SharedValue<number>;
12 onComposerLayout: (event: LayoutChangeEvent) => void;
13 };
14 -@@ -278,8 +278,10 @@ declare function useKeyboardScrollToEnd({ freeze: freezeProp, listRef }: UseKeyb
14 +@@ -286,8 +286,10 @@ declare function useKeyboardScrollToEnd({ freeze: freezeProp, listRef }: UseKeyb
15 scrollMessageToEnd: ({ animated, closeKeyboard }: ScrollMessageToEndOptions) => Promise<void>;
16 };
17 declare const KeyboardAwareLegendList: <ItemT>(props: Omit<AnimatedLegendListProps<ItemT>, "anchoredEndSpace" | "contentInsetEndAdjustment" | "renderScrollComponent"> & KeyboardChatScrollViewPropsUnique & {
@@ -187,10 +187,10 @@ index c1dd270..cb0d142 100644
187 renderScrollComponent: memoList,
188 ...rest
189 diff --git a/react-native.d.ts b/react-native.d.ts
190 -index 72d3f59..435a5fc 100644
190 +index 8204015..cdeaab7 100644
191 --- a/react-native.d.ts
192 +++ b/react-native.d.ts
193 -@@ -284,6 +284,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
193 +@@ -293,6 +293,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
194 * The adjustment is also rendered as real content padding so the browser scroll range includes it.
195 */
196 contentInsetEndAdjustment?: number;
@@ -204,10 +204,10 @@ index 72d3f59..435a5fc 100644
204 * Number of columns to render items in.
205 * @default 1
206 diff --git a/react-native.js b/react-native.js
207 -index 8d4ff89..003b2f7 100644
207 +index 229f09a..2a1ceb6 100644
208 --- a/react-native.js
209 +++ b/react-native.js
210 -@@ -1195,7 +1195,7 @@ function setInitialRenderState(ctx, {
210 +@@ -930,7 +930,7 @@ function setInitialRenderState(ctx, {
211 if (didInitialScroll) {
212 state.didFinishInitialScroll = true;
213 }
@@ -215,8 +215,8 @@ index 8d4ff89..003b2f7 100644
215 + const isReadyToRender = Boolean(state.didContainersLayout && state.didFinishInitialScroll && !state.insetEndRevealHold);
216 if (isReadyToRender && !peek$(ctx, "readyToRender")) {
217 set$(ctx, "readyToRender", true);
218 - setAdaptiveRender(ctx, "normal");
219 -@@ -1480,18 +1480,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
218 + setAdaptiveRender(ctx, "normal", "ready");
219 +@@ -1259,18 +1259,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
220 }
221
222 // src/core/clampScrollOffset.ts
@@ -242,7 +242,7 @@ index 8d4ff89..003b2f7 100644
242 return clampedOffset;
243 }
244
245 -@@ -1626,10 +1631,10 @@ function checkFinishedScrollFrame(ctx) {
245 +@@ -1406,10 +1411,10 @@ function checkFinishedScrollFrame(ctx) {
246 finishScrollTo(ctx);
247 }
248 }
@@ -255,7 +255,7 @@ index 8d4ff89..003b2f7 100644
255 x: ctx.state.props.horizontal ? offset : 0,
256 y: ctx.state.props.horizontal ? 0 : offset
257 });
258 -@@ -1676,7 +1681,10 @@ function checkFinishedScrollFallback(ctx) {
258 +@@ -1456,7 +1461,10 @@ function checkFinishedScrollFallback(ctx) {
259 });
260 scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS);
261 } else if (shouldRetryUnalignedEndScroll) {
@@ -267,10 +267,10 @@ index 8d4ff89..003b2f7 100644
267 scheduleFallbackCheck(100);
268 } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) {
269 finishScrollTo(ctx);
270 -@@ -1737,9 +1745,18 @@ function doMaintainScrollAtEnd(ctx) {
270 +@@ -1517,9 +1525,18 @@ function doMaintainScrollAtEnd(ctx) {
271 }
272 - state.pendingMaintainScrollAtEnd = false;
272 if (shouldMaintainScrollAtEnd) {
273 + state.pendingMaintainScrollAtEnd = false;
274 + const maintainAnchoredEndSpace = state.props.anchoredEndSpace;
275 + const maintainAnchorIndex = maintainAnchoredEndSpace == null ? void 0 : maintainAnchoredEndSpace.anchorIndex;
276 + if (maintainAnchorIndex !== void 0 && maintainAnchorIndex >= 0 && maintainAnchorIndex < state.props.data.length && !areKnownOrFixedItemSizesAvailable(ctx, maintainAnchorIndex, state.props.data.length - 1)) {
@@ -287,7 +287,7 @@ index 8d4ff89..003b2f7 100644
287 }
288 if (!state.maintainingScrollAtEnd) {
289 const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant";
290 -@@ -1759,9 +1776,18 @@ function doMaintainScrollAtEnd(ctx) {
290 +@@ -1539,9 +1556,18 @@ function doMaintainScrollAtEnd(ctx) {
291 y: 0
292 });
293 } else {
@@ -309,7 +309,18 @@ index 8d4ff89..003b2f7 100644
309 }
310 setTimeout(
311 () => {
312 -@@ -1888,7 +1914,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) {
312 +@@ -1571,6 +1597,10 @@ function doMaintainScrollAtEnd(ctx) {
313 + function requestAdjust(ctx, positionDiff, dataChanged) {
314 + const state = ctx.state;
315 + if (Math.abs(positionDiff) > 0.1) {
316 ++ // Timestamp for ReanimatedPositionView: repositions caused by an MVCP
317 ++ // size adjustment are already compensated by a contentOffset shift, so
318 ++ // animating them would make rows visibly lurch and slide back.
319 ++ state.lastMVCPAdjustTime = Date.now();
320 + const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff;
321 + const doit = () => {
322 + if (needsScrollWorkaround) {
323 +@@ -1674,7 +1704,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) {
324 if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) {
325 return 0;
326 }
@@ -320,7 +331,7 @@ index 8d4ff89..003b2f7 100644
331 const clampDelta = maxScroll - state.scroll;
332 if (unresolvedAmount < 0) {
333 return Math.max(unresolvedAmount, Math.min(0, clampDelta));
323 -@@ -1950,7 +1978,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) {
334 +@@ -1736,7 +1768,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) {
335 settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta);
336 return true;
337 }
@@ -329,7 +340,7 @@ index 8d4ff89..003b2f7 100644
340 const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll);
341 const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON;
342 if (isAtExpectedNativeClamp) {
332 -@@ -2083,7 +2111,7 @@ function prepareMVCP(ctx, dataChanged) {
343 +@@ -1869,7 +1901,7 @@ function prepareMVCP(ctx, dataChanged) {
344 if (diff > 0) {
345 diff = Math.max(0, totalSize - state.scroll - state.scrollLength);
346 } else {
@@ -338,7 +349,7 @@ index 8d4ff89..003b2f7 100644
349 state.scroll = maxScroll;
350 state.scrollPending = maxScroll;
351 diff = 0;
341 -@@ -2374,8 +2402,121 @@ function scrollToIndex(ctx, {
352 +@@ -2274,8 +2306,121 @@ function scrollToIndex(ctx, {
353 }
354
355 // src/core/initialScroll.ts
@@ -460,7 +471,7 @@ index 8d4ff89..003b2f7 100644
471 const requestedIndex = target.index;
472 const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0;
473 const itemSize = getItemSizeAtIndex(ctx, index);
463 -@@ -2804,7 +2945,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) {
474 +@@ -2704,7 +2849,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) {
475 return;
476 }
477 if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) {
@@ -471,7 +482,7 @@ index 8d4ff89..003b2f7 100644
482 if (!shouldKeepEndTargetAlive) {
483 if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) {
484 clearPendingInitialScrollFooterLayout(ctx, {
474 -@@ -4646,7 +4789,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
485 +@@ -4637,7 +4784,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
486 }
487 contentBelowAnchor += footerSize + stylePaddingBottom;
488 isReady = !hasUnknownTailSize;
@@ -481,7 +492,7 @@ index 8d4ff89..003b2f7 100644
492 } else if (anchorIndex >= 0) {
493 isReady = false;
494 }
484 -@@ -4664,6 +4808,12 @@ function maybeUpdateAnchoredEndSpace(ctx) {
495 +@@ -4655,6 +4803,12 @@ function maybeUpdateAnchoredEndSpace(ctx) {
496 updateScroll(ctx, state.scroll, true);
497 }
498 (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize });
@@ -494,7 +505,7 @@ index 8d4ff89..003b2f7 100644
505 }
506 return nextSize;
507 }
497 -@@ -6462,6 +6612,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
508 +@@ -6960,6 +7114,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
509 dataVersion,
510 drawDistance = 250,
511 contentInsetEndAdjustment,
@@ -502,15 +513,15 @@ index 8d4ff89..003b2f7 100644
513 estimatedItemSize = 100,
514 estimatedListSize,
515 extraData,
505 -@@ -6492,6 +6643,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
516 +@@ -6990,6 +7145,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
517 onLayout: onLayoutProp,
518 onLoad,
519 onMomentumScrollEnd,
520 + onScrollBeginDrag,
521 onRefresh,
522 onScroll: onScrollProp,
512 - onStartReached,
513 -@@ -6577,7 +6729,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
523 + onScrollBeginDrag,
524 +@@ -7076,7 +7232,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
525 const combinedRef = useCombinedRef(refScroller, refScrollView);
526 const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
527 const stickyHeaderIndices = stickyHeaderIndicesProp;
@@ -519,15 +530,15 @@ index 8d4ff89..003b2f7 100644
530 const previousContentInsetEndAdjustmentRef = React2.useRef(contentInsetEndAdjustmentResolved);
531 const alwaysRenderIndices = React2.useMemo(() => {
532 const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
522 -@@ -6710,6 +6862,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
533 +@@ -7215,6 +7371,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
534 contentContainerAlignItems: contentContainerStyle.alignItems,
535 contentInset,
536 contentInsetEndAdjustment: contentInsetEndAdjustmentResolved,
537 + contentInsetStartAdjustment,
538 data: dataProp,
539 + dataKey,
540 dataVersion,
529 - drawDistance,
530 -@@ -6789,6 +6942,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
541 +@@ -7303,6 +7460,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
542 return void 0;
543 }
544 const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
@@ -541,20 +552,15 @@ index 8d4ff89..003b2f7 100644
552 return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
553 }, [usesBootstrapInitialScroll]);
554 React2.useLayoutEffect(() => {
544 -@@ -6995,6 +7155,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
545 - onMomentumScrollEnd(event);
546 - }
547 - },
548 -+ onScrollBeginDrag: (event) => {
555 +@@ -7526,6 +7690,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
556 + onScroll: (event) => onScroll(ctx, event),
557 + onScrollBeginDrag: (event) => {
558 + var _a4, _b2;
559 + ctx.state.didUserDrag = true;
550 -+ if (onScrollBeginDrag) {
551 -+ onScrollBeginDrag(event);
552 -+ }
553 -+ },
554 - onScroll: (event) => onScroll(ctx, event)
555 - }),
556 - []
557 -@@ -7019,6 +7185,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
560 + prepareReachedEdgeForNextUserScroll(ctx);
561 + (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event);
562 + },
563 +@@ -7555,6 +7720,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
564 onLayout,
565 onLayoutFooter,
566 onMomentumScrollEnd: fns.onMomentumScrollEnd,
@@ -563,10 +569,10 @@ index 8d4ff89..003b2f7 100644
569 recycleItems,
570 refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React2__namespace.cloneElement(refreshControlElement, {
571 diff --git a/react-native.mjs b/react-native.mjs
566 -index 2e96ca7..fc88d4b 100644
572 +index c2e0f38..5313086 100644
573 --- a/react-native.mjs
574 +++ b/react-native.mjs
569 -@@ -1174,7 +1174,7 @@ function setInitialRenderState(ctx, {
575 +@@ -909,7 +909,7 @@ function setInitialRenderState(ctx, {
576 if (didInitialScroll) {
577 state.didFinishInitialScroll = true;
578 }
@@ -574,8 +580,8 @@ index 2e96ca7..fc88d4b 100644
580 + const isReadyToRender = Boolean(state.didContainersLayout && state.didFinishInitialScroll && !state.insetEndRevealHold);
581 if (isReadyToRender && !peek$(ctx, "readyToRender")) {
582 set$(ctx, "readyToRender", true);
577 - setAdaptiveRender(ctx, "normal");
578 -@@ -1459,18 +1459,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
583 + setAdaptiveRender(ctx, "normal", "ready");
584 +@@ -1238,18 +1238,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
585 }
586
587 // src/core/clampScrollOffset.ts
@@ -601,7 +607,7 @@ index 2e96ca7..fc88d4b 100644
607 return clampedOffset;
608 }
609
604 -@@ -1605,10 +1610,10 @@ function checkFinishedScrollFrame(ctx) {
610 +@@ -1385,10 +1390,10 @@ function checkFinishedScrollFrame(ctx) {
611 finishScrollTo(ctx);
612 }
613 }
@@ -614,7 +620,7 @@ index 2e96ca7..fc88d4b 100644
620 x: ctx.state.props.horizontal ? offset : 0,
621 y: ctx.state.props.horizontal ? 0 : offset
622 });
617 -@@ -1655,7 +1660,10 @@ function checkFinishedScrollFallback(ctx) {
623 +@@ -1435,7 +1440,10 @@ function checkFinishedScrollFallback(ctx) {
624 });
625 scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS);
626 } else if (shouldRetryUnalignedEndScroll) {
@@ -626,10 +632,10 @@ index 2e96ca7..fc88d4b 100644
632 scheduleFallbackCheck(100);
633 } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) {
634 finishScrollTo(ctx);
629 -@@ -1716,9 +1724,18 @@ function doMaintainScrollAtEnd(ctx) {
635 +@@ -1496,9 +1504,18 @@ function doMaintainScrollAtEnd(ctx) {
636 }
631 - state.pendingMaintainScrollAtEnd = false;
637 if (shouldMaintainScrollAtEnd) {
638 + state.pendingMaintainScrollAtEnd = false;
639 + const maintainAnchoredEndSpace = state.props.anchoredEndSpace;
640 + const maintainAnchorIndex = maintainAnchoredEndSpace == null ? void 0 : maintainAnchoredEndSpace.anchorIndex;
641 + if (maintainAnchorIndex !== void 0 && maintainAnchorIndex >= 0 && maintainAnchorIndex < state.props.data.length && !areKnownOrFixedItemSizesAvailable(ctx, maintainAnchorIndex, state.props.data.length - 1)) {
@@ -646,7 +652,7 @@ index 2e96ca7..fc88d4b 100644
652 }
653 if (!state.maintainingScrollAtEnd) {
654 const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant";
649 -@@ -1738,9 +1755,18 @@ function doMaintainScrollAtEnd(ctx) {
655 +@@ -1518,9 +1535,18 @@ function doMaintainScrollAtEnd(ctx) {
656 y: 0
657 });
658 } else {
@@ -668,7 +674,18 @@ index 2e96ca7..fc88d4b 100644
674 }
675 setTimeout(
676 () => {
671 -@@ -1867,7 +1893,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) {
677 +@@ -1550,6 +1576,10 @@ function doMaintainScrollAtEnd(ctx) {
678 + function requestAdjust(ctx, positionDiff, dataChanged) {
679 + const state = ctx.state;
680 + if (Math.abs(positionDiff) > 0.1) {
681 ++ // Timestamp for ReanimatedPositionView: repositions caused by an MVCP
682 ++ // size adjustment are already compensated by a contentOffset shift, so
683 ++ // animating them would make rows visibly lurch and slide back.
684 ++ state.lastMVCPAdjustTime = Date.now();
685 + const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff;
686 + const doit = () => {
687 + if (needsScrollWorkaround) {
688 +@@ -1653,7 +1683,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) {
689 if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) {
690 return 0;
691 }
@@ -679,7 +696,7 @@ index 2e96ca7..fc88d4b 100644
696 const clampDelta = maxScroll - state.scroll;
697 if (unresolvedAmount < 0) {
698 return Math.max(unresolvedAmount, Math.min(0, clampDelta));
682 -@@ -1929,7 +1957,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) {
699 +@@ -1715,7 +1747,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) {
700 settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta);
701 return true;
702 }
@@ -688,7 +705,7 @@ index 2e96ca7..fc88d4b 100644
705 const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll);
706 const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON;
707 if (isAtExpectedNativeClamp) {
691 -@@ -2062,7 +2090,7 @@ function prepareMVCP(ctx, dataChanged) {
708 +@@ -1848,7 +1880,7 @@ function prepareMVCP(ctx, dataChanged) {
709 if (diff > 0) {
710 diff = Math.max(0, totalSize - state.scroll - state.scrollLength);
711 } else {
@@ -697,7 +714,7 @@ index 2e96ca7..fc88d4b 100644
714 state.scroll = maxScroll;
715 state.scrollPending = maxScroll;
716 diff = 0;
700 -@@ -2353,8 +2381,121 @@ function scrollToIndex(ctx, {
717 +@@ -2253,8 +2285,121 @@ function scrollToIndex(ctx, {
718 }
719
720 // src/core/initialScroll.ts
@@ -819,7 +836,7 @@ index 2e96ca7..fc88d4b 100644
836 const requestedIndex = target.index;
837 const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0;
838 const itemSize = getItemSizeAtIndex(ctx, index);
822 -@@ -2783,7 +2924,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) {
839 +@@ -2683,7 +2828,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) {
840 return;
841 }
842 if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) {
@@ -830,7 +847,7 @@ index 2e96ca7..fc88d4b 100644
847 if (!shouldKeepEndTargetAlive) {
848 if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) {
849 clearPendingInitialScrollFooterLayout(ctx, {
833 -@@ -4625,7 +4768,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
850 +@@ -4616,7 +4763,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
851 }
852 contentBelowAnchor += footerSize + stylePaddingBottom;
853 isReady = !hasUnknownTailSize;
@@ -840,7 +857,7 @@ index 2e96ca7..fc88d4b 100644
857 } else if (anchorIndex >= 0) {
858 isReady = false;
859 }
843 -@@ -4643,6 +4787,12 @@ function maybeUpdateAnchoredEndSpace(ctx) {
860 +@@ -4634,6 +4782,12 @@ function maybeUpdateAnchoredEndSpace(ctx) {
861 updateScroll(ctx, state.scroll, true);
862 }
863 (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize });
@@ -853,7 +870,7 @@ index 2e96ca7..fc88d4b 100644
870 }
871 return nextSize;
872 }
856 -@@ -6441,6 +6591,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
873 +@@ -6939,6 +7093,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
874 dataVersion,
875 drawDistance = 250,
876 contentInsetEndAdjustment,
@@ -861,15 +878,7 @@ index 2e96ca7..fc88d4b 100644
878 estimatedItemSize = 100,
879 estimatedListSize,
880 extraData,
864 -@@ -6471,6 +6622,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
865 - onLayout: onLayoutProp,
866 - onLoad,
867 - onMomentumScrollEnd,
868 -+ onScrollBeginDrag,
869 - onRefresh,
870 - onScroll: onScrollProp,
871 - onStartReached,
872 -@@ -6556,7 +6708,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
881 +@@ -7055,7 +7210,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
882 const combinedRef = useCombinedRef(refScroller, refScrollView);
883 const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
884 const stickyHeaderIndices = stickyHeaderIndicesProp;
@@ -878,15 +887,15 @@ index 2e96ca7..fc88d4b 100644
887 const previousContentInsetEndAdjustmentRef = useRef(contentInsetEndAdjustmentResolved);
888 const alwaysRenderIndices = useMemo(() => {
889 const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
881 -@@ -6689,6 +6841,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
890 +@@ -7194,6 +7349,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
891 contentContainerAlignItems: contentContainerStyle.alignItems,
892 contentInset,
893 contentInsetEndAdjustment: contentInsetEndAdjustmentResolved,
894 + contentInsetStartAdjustment,
895 data: dataProp,
896 + dataKey,
897 dataVersion,
888 - drawDistance,
889 -@@ -6768,6 +6921,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
898 +@@ -7282,6 +7438,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
899 return void 0;
900 }
901 const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
@@ -900,20 +909,15 @@ index 2e96ca7..fc88d4b 100644
909 return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
910 }, [usesBootstrapInitialScroll]);
911 useLayoutEffect(() => {
903 -@@ -6974,6 +7134,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
904 - onMomentumScrollEnd(event);
905 - }
906 - },
907 -+ onScrollBeginDrag: (event) => {
912 +@@ -7505,6 +7668,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
913 + onScroll: (event) => onScroll(ctx, event),
914 + onScrollBeginDrag: (event) => {
915 + var _a4, _b2;
916 + ctx.state.didUserDrag = true;
909 -+ if (onScrollBeginDrag) {
910 -+ onScrollBeginDrag(event);
911 -+ }
912 -+ },
913 - onScroll: (event) => onScroll(ctx, event)
914 - }),
915 - []
916 -@@ -6998,6 +7164,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
917 + prepareReachedEdgeForNextUserScroll(ctx);
918 + (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event);
919 + },
920 +@@ -7534,6 +7698,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
921 onLayout,
922 onLayoutFooter,
923 onMomentumScrollEnd: fns.onMomentumScrollEnd,
@@ -922,10 +926,10 @@ index 2e96ca7..fc88d4b 100644
926 recycleItems,
927 refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React2.cloneElement(refreshControlElement, {
928 diff --git a/reanimated.d.ts b/reanimated.d.ts
925 -index 7e2d11f..d5b0d66 100644
929 +index 940da28..28dccbe 100644
930 --- a/reanimated.d.ts
931 +++ b/reanimated.d.ts
928 -@@ -285,6 +285,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
932 +@@ -294,6 +294,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
933 * The adjustment is also rendered as real content padding so the browser scroll range includes it.
934 */
935 contentInsetEndAdjustment?: number;
@@ -938,3 +942,73 @@ index 7e2d11f..d5b0d66 100644
942 /**
943 * Number of columns to render items in.
944 * @default 1
945 +diff --git a/reanimated.js b/reanimated.js
946 +index f1265fa..16dcef0 100644
947 +--- a/reanimated.js
948 ++++ b/reanimated.js
949 +@@ -116,7 +116,7 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
950 + const [positionValue = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
951 + const prevItemKeyRef = React__namespace.useRef(void 0);
952 + let shouldSkipTransitionForRecycleReuse = false;
953 +- if (recycleItems && layoutTransition) {
954 ++ if (layoutTransition) {
955 + const itemKeySignal = `containerItemKey${id}`;
956 + const itemKey = peek$(ctx, itemKeySignal);
957 + shouldSkipTransitionForRecycleReuse = itemKey !== void 0 && prevItemKeyRef.current !== void 0 && prevItemKeyRef.current !== itemKey;
958 +@@ -130,10 +130,20 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
959 + () => [style, horizontal ? { left: positionValue } : { top: positionValue }],
960 + [horizontal, positionValue, style]
961 + );
962 ++ // Two kinds of repositions must not animate: (1) MVCP size adjustments,
963 ++ // which are compensated by an equal contentOffset shift so the row should
964 ++ // not visibly move — animating turns the invisible correction into a
965 ++ // lurch-and-settle; (2) any reposition while the user is actively
966 ++ // scrolling, where rows shifting under the finger reads as jank. The
967 ++ // transition exists to smooth at-rest shifts (streaming text, work-log
968 ++ // folds), so gate it to at-rest moments.
969 ++ const now = Date.now();
970 ++ const isMVCPReposition = now - (ctx.state.lastMVCPAdjustTime || 0) < 300 ||
971 ++ now - (ctx.state.lastNativeScrollTime || 0) < 300;
972 + return /* @__PURE__ */ React__namespace.createElement(
973 + Reanimated__default.default.View,
974 + {
975 +- layout: shouldSkipTransitionForRecycleReuse ? void 0 : layoutTransition,
976 ++ layout: shouldSkipTransitionForRecycleReuse || isMVCPReposition ? void 0 : layoutTransition,
977 + ref: refView,
978 + style: viewStyle,
979 + ...rest
980 +diff --git a/reanimated.mjs b/reanimated.mjs
981 +index 29a00d5..9c25ec5 100644
982 +--- a/reanimated.mjs
983 ++++ b/reanimated.mjs
984 +@@ -92,7 +92,7 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
985 + const [positionValue = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
986 + const prevItemKeyRef = React.useRef(void 0);
987 + let shouldSkipTransitionForRecycleReuse = false;
988 +- if (recycleItems && layoutTransition) {
989 ++ if (layoutTransition) {
990 + const itemKeySignal = `containerItemKey${id}`;
991 + const itemKey = peek$(ctx, itemKeySignal);
992 + shouldSkipTransitionForRecycleReuse = itemKey !== void 0 && prevItemKeyRef.current !== void 0 && prevItemKeyRef.current !== itemKey;
993 +@@ -106,10 +106,20 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
994 + () => [style, horizontal ? { left: positionValue } : { top: positionValue }],
995 + [horizontal, positionValue, style]
996 + );
997 ++ // Two kinds of repositions must not animate: (1) MVCP size adjustments,
998 ++ // which are compensated by an equal contentOffset shift so the row should
999 ++ // not visibly move — animating turns the invisible correction into a
1000 ++ // lurch-and-settle; (2) any reposition while the user is actively
1001 ++ // scrolling, where rows shifting under the finger reads as jank. The
1002 ++ // transition exists to smooth at-rest shifts (streaming text, work-log
1003 ++ // folds), so gate it to at-rest moments.
1004 ++ const now = Date.now();
1005 ++ const isMVCPReposition = now - (ctx.state.lastMVCPAdjustTime || 0) < 300 ||
1006 ++ now - (ctx.state.lastNativeScrollTime || 0) < 300;
1007 + return /* @__PURE__ */ React.createElement(
1008 + Reanimated.View,
1009 + {
1010 +- layout: shouldSkipTransitionForRecycleReuse ? void 0 : layoutTransition,
1011 ++ layout: shouldSkipTransitionForRecycleReuse || isMVCPReposition ? void 0 : layoutTransition,
1012 + ref: refView,
1013 + style: viewStyle,
1014 + ...rest
pnpm-lock.yaml
+24 -12
@@ -74,7 +74,7 @@ patchedDependencies:
74 '@effect/vitest@4.0.0-beta.102': a607339aab944136a084a05f159aa0f5a69776934d4b835dab8f9992f1c13425
75 '@expo/metro-config@56.0.14': 8cb08b5bb7051ed9d2dbe46a2c293c5a1e17f1bd6ddf30de27909e18c921ff46
76 '@ff-labs/fff-node@0.9.4': 2b16019ce7ab61aec6478dd02f79ef468cc1d5c51e9d00764f7d2ab8167210c8
77 - '@legendapp/list@3.2.0': 9203ec3db86574a31e157a265cefd8997b259cc420a0c4c61c580c80ed8cf78d
77 + '@legendapp/list@3.3.3': d162d67b73933ab077d00627cdf52b18ea88b28c4fae4e8340a854df25026f09
78 '@pierre/diffs@1.3.0-beta.10': 7ef7cb0cbabb17c15cdb137554068b36f15f6f5265e73fb51452aa3380db91aa
79 '@react-native-menu/menu@2.0.0': 5ea3ae4bf1d9baf5443b65c269bb09621c27a68d556f713778f37b1e8d46aaae
80 '@react-navigation/native-stack@7.17.6': c7fc101b78d434904425e5a24c22fb0042298dec6f807250486e784f3c717273
@@ -212,8 +212,8 @@ importers:
212 specifier: ~56.0.18
213 version: 56.0.18(3cdc0dde9f93166d952f1e1bd0cb25c0)
214 '@legendapp/list':
215 - specifier: 3.2.0
216 - version: 3.2.0(patch_hash=9203ec3db86574a31e157a265cefd8997b259cc420a0c4c61c580c80ed8cf78d)(react-dom@19.2.3(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.85.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6))(react@19.2.3)
215 + specifier: 3.3.3
216 + version: 3.3.3(patch_hash=d162d67b73933ab077d00627cdf52b18ea88b28c4fae4e8340a854df25026f09)(react-dom@19.2.3(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.85.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6))(react@19.2.3)
217 '@noble/curves':
218 specifier: 'catalog:'
219 version: 1.9.1
@@ -545,7 +545,7 @@ importers:
545 version: 0.9.0
546 '@legendapp/list':
547 specifier: 3.2.0
548 - version: 3.2.0(patch_hash=9203ec3db86574a31e157a265cefd8997b259cc420a0c4c61c580c80ed8cf78d)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
548 + version: 3.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
549 '@lexical/react':
550 specifier: ^0.41.0
551 version: 0.41.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(yjs@13.6.31)
@@ -2975,6 +2975,18 @@ packages:
2975 react-native:
2976 optional: true
2977
2978 + '@legendapp/list@3.3.3':
2979 + resolution: {integrity: sha512-p3g4xG6f//s4XQKhuus2189GCQgOHEIbJXHePqeDxj+6UQQQyij4YBjyArNSCgqoP0c03sxDPSOuCFB128Ql6g==}
2980 + peerDependencies:
2981 + react: '*'
2982 + react-dom: '*'
2983 + react-native: '*'
2984 + peerDependenciesMeta:
2985 + react-dom:
2986 + optional: true
2987 + react-native:
2988 + optional: true
2989 +
2990 '@lexical/clipboard@0.41.0':
2991 resolution: {integrity: sha512-Ex5lPkb4NBBX1DCPzOAIeHBJFH1bJcmATjREaqpnTfxCbuOeQkt44wchezUA0oDl+iAxNZ3+pLLWiUju9icoSA==}
2992
@@ -12982,7 +12994,14 @@ snapshots:
12994 dependencies:
12995 jsbi: 4.3.2
12996
12985 - '@legendapp/list@3.2.0(patch_hash=9203ec3db86574a31e157a265cefd8997b259cc420a0c4c61c580c80ed8cf78d)(react-dom@19.2.3(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.85.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6))(react@19.2.3)':
12997 + '@legendapp/list@3.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
12998 + dependencies:
12999 + react: 19.2.6
13000 + use-sync-external-store: 1.6.0(react@19.2.6)
13001 + optionalDependencies:
13002 + react-dom: 19.2.6(react@19.2.6)
13003 +
13004 + '@legendapp/list@3.3.3(patch_hash=d162d67b73933ab077d00627cdf52b18ea88b28c4fae4e8340a854df25026f09)(react-dom@19.2.3(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.85.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6))(react@19.2.3)':
13005 dependencies:
13006 react: 19.2.3
13007 use-sync-external-store: 1.6.0(react@19.2.3)
@@ -12990,13 +13009,6 @@ snapshots:
13009 react-dom: 19.2.3(react@19.2.3)
13010 react-native: 0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.85.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6)
13011
12993 - '@legendapp/list@3.2.0(patch_hash=9203ec3db86574a31e157a265cefd8997b259cc420a0c4c61c580c80ed8cf78d)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
12994 - dependencies:
12995 - react: 19.2.6
12996 - use-sync-external-store: 1.6.0(react@19.2.6)
12997 - optionalDependencies:
12998 - react-dom: 19.2.6(react@19.2.6)
12999 -
13012 '@lexical/clipboard@0.41.0':
13013 dependencies:
13014 '@lexical/html': 0.41.0
pnpm-workspace.yaml
+1 -1
@@ -127,7 +127,7 @@ patchedDependencies:
127 "@effect/vitest@4.0.0-beta.102": patches/@effect__vitest@4.0.0-beta.102.patch
128 "@expo/metro-config@56.0.14": patches/@expo%2Fmetro-config@56.0.14.patch
129 "@ff-labs/fff-node@0.9.4": patches/@ff-labs__fff-node@0.9.4.patch
130 - "@legendapp/list@3.2.0": patches/@legendapp__list@3.2.0.patch
130 + "@legendapp/list@3.3.3": patches/@legendapp__list@3.3.3.patch
131 "@pierre/diffs@1.3.0-beta.10": patches/@pierre%2Fdiffs@1.3.0-beta.10.patch
132 "@react-native-menu/menu@2.0.0": patches/@react-native-menu__menu@2.0.0.patch
133 "@react-navigation/native-stack@7.17.6": patches/@react-navigation%2Fnative-stack@7.17.6.patch