@devries-cameron20 / t3code-1 / commits / bc3dc2694b
Fork 0

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

fix(mobile): hide changed-files navigator and restore refresh in raw diff fallback (#9828)

Co-authored-by: James <jamescollard2005@gmail.com>

Lars Nieuwenhuis committed Sep 7, 2026 at 09:18 UTC bc3dc2694b5d15613ef610d693d18ebd904b0d56
1 file changed +50 -6
apps/mobile/src/features/review/ReviewSheet.tsx
+50 -6
@@ -23,6 +23,7 @@ import {
23 FlatList,
24 Platform,
25 Pressable,
26 + RefreshControl,
27 ScrollView,
28 type NativeSyntheticEvent,
29 StyleSheet,
@@ -399,7 +400,11 @@ export function ReviewSheet(props: ReviewSheetProps) {
400 selectedSection,
401 draftMessage,
402 });
402 - const NativeReviewDiffView = resolveNativeReviewDiffView()!;
403 + // Resolution returns null while Expo registers the native view (or forever
404 + // when the binary lacks it). Rendering a null component type crashes the
405 + // app, so callers must fall back — ThreadFeed's ReviewCommentCard does the
406 + // same check.
407 + const NativeReviewDiffView = resolveNativeReviewDiffView();
408 const nativeReviewDiffViewRef = useRef<NativeReviewDiffViewHandle>(null);
409 const showcasedReviewDrawRef = useRef<string | null>(null);
410 // Native pull-to-refresh on the diff surface (replaces the old Refresh menu item).
@@ -597,11 +602,27 @@ export function ReviewSheet(props: ReviewSheetProps) {
602 .filter((part): part is string => Boolean(part))
603 .join(" · ");
604
600 - // The changed-files navigator lives in the workspace inspector column —
601 - // the single right-hand pane per route — instead of an in-screen panel.
605 + // The changed-files navigator drives the native diff surface via
606 + // scrollToFile, so it is only useful when that surface resolved. In raw
607 + // fallback mode the ref is necessarily null and the raw patch neither
608 + // scrolls nor filters — registering the navigator would present working
609 + // controls that cannot navigate.
610 const showChangedFilesPane =
603 - !showConnectionNotice && selectedSection !== null && parsedDiff.kind === "files";
611 + !showConnectionNotice &&
612 + selectedSection !== null &&
613 + parsedDiff.kind === "files" &&
614 + NativeReviewDiffView !== null;
615 useRegisterWorkspaceInspector(showChangedFilesPane ? renderInspector : undefined);
616 + // Raw fallback renders the patch inline with no inspector content, so the
617 + // pane toggle would open an empty column — hide it in exactly that case.
618 + const showChangedFilesToggle =
619 + panes.supportsAuxiliaryPane &&
620 + !(
621 + !showConnectionNotice &&
622 + selectedSection !== null &&
623 + parsedDiff.kind === "files" &&
624 + NativeReviewDiffView === null
625 + );
626
627 const listHeader = useMemo(() => {
628 const children: ReactElement[] = [];
@@ -688,7 +709,7 @@ export function ReviewSheet(props: ReviewSheetProps) {
709
710 {!isAndroid && (showSectionToolbar || panes.supportsAuxiliaryPane || gitMenuAvailable) ? (
711 <NativeHeaderToolbar placement="right">
691 - {panes.supportsAuxiliaryPane ? (
712 + {showChangedFilesToggle ? (
713 <NativeHeaderToolbar.Button
714 accessibilityLabel={
715 panes.auxiliaryPaneVisible ? "Hide changed files" : "Show changed files"
@@ -781,7 +802,7 @@ export function ReviewSheet(props: ReviewSheetProps) {
802 onRetry={handleRetryEnvironment}
803 />
804 </View>
784 - ) : selectedSection && parsedDiff.kind === "files" ? (
805 + ) : selectedSection && parsedDiff.kind === "files" && NativeReviewDiffView ? (
806 <View
807 className="flex-1"
808 style={{
@@ -835,6 +856,16 @@ export function ReviewSheet(props: ReviewSheetProps) {
856 }}
857 showsVerticalScrollIndicator={false}
858 className="flex-1"
859 + refreshControl={
860 + // The native diff surface owns pull-to-refresh via onPullToRefresh;
861 + // the raw fallback (and empty states) need an explicit control —
862 + // iOS has no other refresh affordance here (the explicit
863 + // "Refresh current diff" menu is Android-only).
864 + <RefreshControl
865 + refreshing={isPullRefreshing}
866 + onRefresh={() => void handlePullToRefresh()}
867 + />
868 + }
869 >
870 {listHeader}
871 {!selectedSection ? (
@@ -867,6 +898,19 @@ export function ReviewSheet(props: ReviewSheetProps) {
898 </Text>
899 </ScrollView>
900 </View>
901 + ) : parsedDiff.kind === "files" ? (
902 + // The native diff surface could not be resolved on this binary;
903 + // degrade to the raw patch instead of crashing the app.
904 + <View className="gap-3 border-b border-border bg-card px-4 py-4">
905 + <Text className="text-xs leading-normal text-foreground-muted">
906 + Native diff view unavailable. Showing the raw patch.
907 + </Text>
908 + <ScrollView horizontal showsHorizontalScrollIndicator={false} bounces={false}>
909 + <Text selectable className="font-mono text-xs leading-relaxed text-foreground">
910 + {selectedSection?.diff ?? ""}
911 + </Text>
912 + </ScrollView>
913 + </View>
914 ) : null}
915 </ScrollView>
916 )}