@devries-cameron20 / t3code-1 / commits / 73acddc2a1
Fork 0

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

fix(mobile): switching pull request tabs no longer jumps the page (#26064)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

oliver committed Oct 27, 2026 at 13:15 UTC 73acddc2a158c4245966b25c2afdf33df7b3587e
1 file changed +13 -8
apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+13 -8
@@ -341,6 +341,8 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
341 const navigation = useNavigation();
342 const insets = useSafeAreaInsets();
343 const [toolbarHeight, setToolbarHeight] = usePullRequestToolbarHeight(insets.bottom);
344 + // Only iOS lists run under the bars; Android lists start below the header.
345 + const barInsets = Platform.OS === "ios" ? insets : { top: 0, bottom: 0 };
346 const params = route.params;
347 usePullRequestEnvironmentFallback(params);
348 const connected = usePullRequestConnected(params.environmentId);
@@ -362,7 +364,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
364 // has its own offset, which only its next scroll would record here.
365 const currentScrollOffset = useRef<{ tab: typeof section; offset: number }>({
366 tab: "overview",
365 - offset: -insets.top,
367 + offset: -barInsets.top,
368 });
369 const bodyY = useRef(0);
370 const [headerHeight, setHeaderHeight] = useState(0);
@@ -386,14 +388,15 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
388 const current =
389 currentScrollOffset.current.tab === from
390 ? currentScrollOffset.current.offset
389 - : (scrollOffsets.current[from] ?? -insets.top);
391 + : (scrollOffsets.current[from] ?? -barInsets.top);
392 scrollOffsets.current[section] = current;
391 - const headerEnd = Math.max(-insets.top, bodyY.current - insets.top);
393 + const headerEnd = Math.max(-barInsets.top, bodyY.current - barInsets.top);
394 const offset = pullRequestTabOffset(current, scrollOffsets.current[next], headerEnd);
395 requestedSection.current = next;
396 scrollOffsets.current[next] = offset;
397 currentScrollOffset.current = { tab: next, offset };
396 - scrollViews.current[next]?.scrollToOffset({ offset, animated: false });
398 + // LegendList clamps to its measured rows, which leave out the short-tab minHeight below.
399 + scrollViews.current[next]?.getNativeScrollRef().scrollTo({ y: offset, animated: false });
400 setSection(next);
401 };
402 const tabContent = activityContent;
@@ -441,7 +444,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
444 });
445 const jumpToFiles = () => {
446 scrollViews.current.overview?.scrollToOffset({
444 - offset: bodyY.current + filesY.current - insets.top,
447 + offset: bodyY.current + filesY.current - barInsets.top,
448 animated: true,
449 });
450 pendingFilesJump.current = false;
@@ -675,7 +678,9 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
678 // UIKit owns the bar's inset, so a minimizing bar and a resized column
679 // move the list in the same frame as the bar.
680 contentInsetAdjustmentBehavior="automatic"
678 - contentInsetStartAdjustment={Platform.OS === "ios" ? insets.top : 0}
681 + contentInsetStartAdjustment={barInsets.top}
682 + // RN scrollTo clamps against raw insets and ignores the automatic bar inset.
683 + scrollToOverflowEnabled
684 refreshControl={
685 <RefreshControl
686 refreshing={section === tab && pullRefresh.refreshing}
@@ -694,7 +699,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
699 pendingDescriptionJump.current = false;
700 // Collapse changes the scroll range; restore the heading after that layout commits.
701 scrollViews.current.overview?.scrollToOffset({
697 - offset: bodyY.current + descriptionY.current - insets.top,
702 + offset: bodyY.current + descriptionY.current - barInsets.top,
703 animated: false,
704 });
705 }}
@@ -705,7 +710,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
710 // Short tabs must still be tall enough to preserve the collapsed header.
711 minHeight: Math.max(
712 0,
708 - viewportHeight + headerHeight - insets.top - insets.bottom,
713 + viewportHeight + headerHeight - barInsets.top - barInsets.bottom,
714 ),
715 }}
716 data={[