Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions apps/mobile/src/features/review/ReviewSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ export function ReviewSheet(props: ReviewSheetProps) {
selectedSection,
draftMessage,
});
const NativeReviewDiffView = resolveNativeReviewDiffView()!;
// Resolution returns null while Expo registers the native view (or forever
// when the binary lacks it). Rendering a null component type crashes the
// app, so callers must fall back — ThreadFeed's ReviewCommentCard does the
// same check.
const NativeReviewDiffView = resolveNativeReviewDiffView();
const nativeReviewDiffViewRef = useRef<NativeReviewDiffViewHandle>(null);
const showcasedReviewDrawRef = useRef<string | null>(null);
// Native pull-to-refresh on the diff surface (replaces the old Refresh menu item).
Expand Down Expand Up @@ -780,7 +784,7 @@ export function ReviewSheet(props: ReviewSheetProps) {
onRetry={handleRetryEnvironment}
/>
</View>
) : selectedSection && parsedDiff.kind === "files" ? (
) : selectedSection && parsedDiff.kind === "files" && NativeReviewDiffView ? (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable the changed-files navigator in raw fallback mode

When resolveNativeReviewDiffView() returns null for an older or incompletely registered binary, showChangedFilesPane still registers ReviewFileNavigator. Selecting a file updates the row's selected state, but handleSelectFile only calls nativeReviewDiffViewRef.current?.scrollToFile(...); the ref is necessarily null in this branch, and the raw patch is neither scrolled nor filtered. The navigator therefore presents working controls that cannot navigate, so either hide it when the native view is unavailable or connect it to the fallback renderer.

Useful? React with 👍 / 👎.

<View
className="flex-1"
style={{
Expand Down Expand Up @@ -866,6 +870,19 @@ export function ReviewSheet(props: ReviewSheetProps) {
</Text>
</ScrollView>
</View>
) : parsedDiff.kind === "files" ? (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore a refresh action for the iOS fallback

On iOS when the native view is unavailable, this branch renders a plain ScrollView, but the iOS toolbar has no refresh action because refresh is normally provided only through the native surface's onPullToRefresh; the explicit "Refresh current diff" menu is Android-only. Users on the affected iOS binaries therefore cannot refresh a working-tree or branch diff while remaining in the review screen. Add a RefreshControl or expose the toolbar refresh action in fallback mode.

Useful? React with 👍 / 👎.

// The native diff surface could not be resolved on this binary;
// degrade to the raw patch instead of crashing the app.
<View className="gap-3 border-b border-border bg-card px-4 py-4">
<Text className="text-xs leading-normal text-foreground-muted">
Native diff view unavailable. Showing the raw patch.
</Text>
<ScrollView horizontal showsHorizontalScrollIndicator={false} bounces={false}>
<Text selectable className="font-mono text-xs leading-relaxed text-foreground">
{selectedSection?.diff ?? ""}
</Text>
</ScrollView>
</View>
) : null}
</ScrollView>
)}
Expand Down
Loading