Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ThreadFilesRouteScreen.tsx

671 lines23.7 KB

1import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
2import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
3import { useCallback, useEffect, useRef, useState } from "react";
4import { ActivityIndicator, Platform, useColorScheme, View } from "react-native";
5import { useSafeAreaInsets } from "react-native-safe-area-context";
6import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
7import {
8 EnvironmentId,
9 type ProjectListEntriesResult,
10 type ProjectReadFileResult,
11 ThreadId,
12} from "@t3tools/contracts";
13​
14import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
15import { SymbolView } from "../../components/AppSymbol";
16import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
17import { EmptyState } from "../../components/EmptyState";
18import { LoadingScreen } from "../../components/LoadingScreen";
19import { resolveFileSelectionNavigationAction } from "../../lib/adaptive-navigation";
20import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
21import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
22import { useThemeColor } from "../../lib/useThemeColor";
23import { useThreadSelection } from "../../state/use-thread-selection";
24import { useSelectedThreadWorktree } from "../../state/use-selected-thread-worktree";
25import { useEnvironmentQuery } from "../../state/query";
26import { projectEnvironment } from "../../state/projects";
27import {
28 useAdaptiveWorkspaceLayout,
29 useAdaptiveWorkspacePaneRole,
30 useRegisterWorkspaceInspector,
31} from "../layout/AdaptiveWorkspaceLayout";
32import {
33 createNativeMailSearchToolbarItem,
34 NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED,
35} from "../layout/native-mail-search-toolbar";
36import { WorkspaceSidebarToolbar } from "../layout/workspace-sidebar-toolbar";
37import { ReviewHighlighterProvider } from "../review/ReviewHighlighterProvider";
38import { ThreadRouteScreen } from "../threads/ThreadRouteScreen";
39import { FileMarkdownPreview } from "./FileMarkdownPreview";
40import { FileTreeBrowser } from "./FileTreeBrowser";
41import { preloadWorkspaceFileContents } from "./preload-workspace-file";
42import { SourceFileSurface } from "./SourceFileSurface";
43import { ThreadFileNavigatorPane } from "./thread-file-navigator-pane";
44import { WorkspaceFileImagePreview } from "./WorkspaceFileImagePreview";
45import { WorkspaceFileWebPreview } from "./WorkspaceFileWebPreview";
46import {
47 basename,
48 isBrowserPreviewFile,
49 isImagePreviewFile,
50 isMarkdownPreviewFile,
51 isSvgImagePreviewFile,
52} from "./filePath";
53import { useWorkspaceFileAssetUrl } from "./workspaceFileAssetUrl";
54​
55type FileViewMode = "preview" | "source";
56​
57function firstRouteParam(value: string | string[] | undefined): string | null {
58 if (Array.isArray(value)) {
59 return value[0] ?? null;
60 }
61​
62 return value ?? null;
64​
65function normalizeRoutePath(value: string | string[] | undefined): string | null {
66 const path = Array.isArray(value) ? value.join("/") : value;
67 if (path === undefined || path.trim().length === 0) {
68 return null;
69 }
70 return path;
72​
73function normalizeRouteLine(value: string | null): number | null {
74 if (value === null) {
75 return null;
76 }
77 const parsed = Number(value);
78 return Number.isInteger(parsed) && parsed > 0 ? parsed : null;
80​
81function defaultViewMode(path: string | null): FileViewMode {
82 return path !== null && (isBrowserPreviewFile(path) || isImagePreviewFile(path))
83 ? "preview"
84 : "source";
86​
87function FileContent(props: {
88 readonly activeMode: FileViewMode;
89 readonly previewUri: string | null;
90 readonly fileContents: string | null;
91 readonly fileError: string | null;
92 readonly relativePath: string;
93 readonly initialLine: number | null;
94 readonly truncated: boolean;
95 readonly onRefresh?: () => Promise<void> | void;
96}) {
97 const isMarkdown = isMarkdownPreviewFile(props.relativePath);
98 const isBrowserFile = isBrowserPreviewFile(props.relativePath);
99 const isImageFile = isImagePreviewFile(props.relativePath);
100​
101 if (props.activeMode === "preview" && isImageFile) {
102 if (isSvgImagePreviewFile(props.relativePath)) {
103 return <WorkspaceFileWebPreview uri={props.previewUri} />;
104 }
105 return (
106 <WorkspaceFileImagePreview
107 accessibilityLabel={basename(props.relativePath)}
108 uri={props.previewUri}
109 />
110 );
111 }
112​
113 if (props.activeMode === "preview" && isBrowserFile) {
114 return <WorkspaceFileWebPreview uri={props.previewUri} />;
115 }
116​
117 if (props.fileError && props.fileContents === null) {
118 return (
119 <View className="flex-1 items-center justify-center bg-sheet px-6">
120 <EmptyState title="File unavailable" detail={props.fileError} />
121 </View>
122 );
123 }
124​
125 if (props.fileContents === null) {
126 return (
127 <View className="flex-1 items-center justify-center gap-3 bg-sheet px-6">
128 <ActivityIndicator />
129 <Text className="text-center text-sm text-foreground-muted">Loading file...</Text>
130 </View>
131 );
132 }
133​
134 return (
135 <View className="flex-1 bg-sheet">
136 {props.truncated ? (
137 <View className="border-b border-amber-200 bg-amber-50 px-4 py-2 dark:border-amber-900/60 dark:bg-amber-950/40">
138 <Text className="text-2xs font-t3-bold uppercase text-amber-700 dark:text-amber-300">
139 Partial file
140 </Text>
141 <Text className="text-xs leading-snug text-amber-800 dark:text-amber-200">
142 Preview limited to the first 1 MB of a truncated file.
143 </Text>
144 </View>
145 ) : null}
146 {props.activeMode === "preview" && isMarkdown ? (
147 <FileMarkdownPreview markdown={props.fileContents} onRefresh={props.onRefresh} />
148 ) : (
149 <SourceFileSurface
150 contents={props.fileContents}
151 path={props.relativePath}
152 initialLine={props.initialLine}
153 onRefresh={props.onRefresh}
154 />
155 )}
156 </View>
157 );
159​
160type ThreadFilesRouteScreenProps = StaticScreenProps<{
161 readonly environmentId: string;
162 readonly threadId: string;
163}>;
164​
165type ThreadFileRouteScreenProps = StaticScreenProps<{
166 readonly environmentId: string;
167 readonly threadId: string;
168 readonly path: string[];
169 readonly line?: string;
170}>;
171​
172function useThreadFilesWorkspace(params: {
173 readonly environmentId?: string | string[];
174 readonly threadId?: string | string[];
175}) {
176 const routeEnvironmentId = firstRouteParam(params.environmentId);
177 const routeThreadId = firstRouteParam(params.threadId);
178 const { selectedThread, selectedThreadProject } = useThreadSelection();
179 const { selectedThreadCwd } = useSelectedThreadWorktree();
180 const environmentId =
181 routeEnvironmentId !== null
182 ? EnvironmentId.make(routeEnvironmentId)
183 : (selectedThread?.environmentId ?? null);
184 const threadId = routeThreadId !== null ? ThreadId.make(routeThreadId) : null;
185 const project = selectedThreadProject as {
186 readonly title?: string;
187 readonly workspaceRoot?: string;
188 } | null;
189​
190 return {
191 cwd: selectedThreadCwd ?? project?.workspaceRoot ?? null,
192 environmentId,
193 projectName: project?.title ?? "Files",
194 selectedThread,
195 threadId,
196 };
198​
199function FilesUnavailable() {
200 return (
201 <View className="flex-1 items-center justify-center bg-sheet px-6">
202 <NativeStackScreenOptions options={{ title: "Files" }} />
203 <EmptyState
204 title="Files unavailable"
205 detail="This thread does not have an active workspace path."
206 />
207 </View>
208 );
210​
211function FilesToolbarBottomFade() {
212 const sheetColor = String(useThemeColor("--color-sheet"));
213​
214 if (process.env.EXPO_OS !== "ios") {
215 return null;
216 }
217​
218 return (
219 <View
220 pointerEvents="none"
221 accessibilityElementsHidden
222 importantForAccessibility="no-hide-descendants"
223 className="absolute inset-x-0 bottom-0 z-[1] h-28"
224 >
225 <Svg width="100%" height="100%">
226 <Defs>
227 <LinearGradient id="files-toolbar-bottom-fade" x1="0%" x2="0%" y1="0%" y2="100%">
228 <Stop offset="0%" stopColor={sheetColor} stopOpacity={0} />
229 <Stop offset="58%" stopColor={sheetColor} stopOpacity={0.72} />
230 <Stop offset="100%" stopColor={sheetColor} stopOpacity={0.96} />
231 </LinearGradient>
232 </Defs>
233 <Rect width="100%" height="100%" fill="url(#files-toolbar-bottom-fade)" />
234 </Svg>
235 </View>
236 );
238​
239export function ThreadFilesTreeScreen(props: ThreadFilesRouteScreenProps) {
240 useAdaptiveWorkspacePaneRole("inspector");
241 const navigation = useNavigation();
242 const { fileInspector, layout, panes, showAuxiliaryPane, togglePrimarySidebar } =
243 useAdaptiveWorkspaceLayout();
244 const [searchQuery, setSearchQuery] = useState("");
245 const colorScheme = useColorScheme();
246 const isAndroid = Platform.OS === "android";
247 const highlightTheme = colorScheme === "dark" ? "dark" : "light";
248 const iconColor = String(useThemeColor("--color-icon-muted"));
249 const { cwd, environmentId, projectName, selectedThread, threadId } = useThreadFilesWorkspace(
250 props.route.params,
251 );
252 const revealedInspectorRef = useRef(false);
253 const entriesQuery = useEnvironmentQuery(
254 environmentId !== null && cwd !== null && !fileInspector.supported
255 ? projectEnvironment.listEntries({
256 environmentId,
257 input: { cwd },
258 })
259 : null,
260 );
261 const entriesData = entriesQuery.data as ProjectListEntriesResult | null;
262 const handleReturnToThread = useCallback(() => {
263 if (navigation.canGoBack()) {
264 navigation.goBack();
265 return;
266 }
267 if (environmentId !== null && threadId !== null) {
268 navigation.dispatch(
269 StackActions.replace("Thread", {
270 environmentId: String(environmentId),
271 threadId: String(threadId),
272 }),
273 );
274 }
275 }, [environmentId, navigation, threadId]);
276​
277 const handleSelectFile = useCallback(
278 (path: string) => {
279 if (environmentId === null || threadId === null) {
280 return;
281 }
282 const params = {
283 environmentId: String(environmentId),
284 threadId: String(threadId),
285 path: path.split("/").filter((segment) => segment.length > 0),
286 };
287 const navigationAction = resolveFileSelectionNavigationAction({
288 hasPersistentFileInspector: fileInspector.supported,
289 });
290 if (navigationAction === "replace") {
291 navigation.dispatch(StackActions.replace("ThreadFile", params));
292 return;
293 }
294 navigation.navigate("ThreadFile", params);
295 },
296 [environmentId, fileInspector.supported, navigation, threadId],
297 );
298 const renderInspector = useCallback(
299 (headerInset: number) =>
300 environmentId !== null && cwd !== null ? (
301 <ThreadFileNavigatorPane
302 cwd={cwd}
303 environmentId={environmentId}
304 headerInset={headerInset}
305 projectName={projectName}
306 selectedPath={null}
307 onSelectFile={handleSelectFile}
308 />
309 ) : null,
310 [cwd, environmentId, handleSelectFile, projectName],
311 );
312 const handlePreviewFile = useCallback(
313 (relativePath: string) => {
314 if (environmentId === null || cwd === null) {
315 return;
316 }
317 preloadWorkspaceFileContents({
318 cwd,
319 environmentId,
320 relativePath,
321 theme: highlightTheme,
322 });
323 },
324 [cwd, environmentId, highlightTheme],
325 );
326 useEffect(() => {
327 if (fileInspector.supported && cwd !== null && !revealedInspectorRef.current) {
328 revealedInspectorRef.current = true;
329 showAuxiliaryPane("inspector");
330 }
331 }, [cwd, fileInspector.supported, showAuxiliaryPane]);
332​
333 if (selectedThread === null || environmentId === null || threadId === null) {
334 if (fileInspector.supported) {
335 return (
336 <ThreadRouteScreen
337 onReturnToThread={handleReturnToThread}
338 renderInspector={renderInspector}
339 route={props.route}
340 />
341 );
342 }
343 return <LoadingScreen message="Opening files..." messagePlacement="above-spinner" />;
344 }
345​
346 if (cwd === null) {
347 return <FilesUnavailable />;
348 }
349​
350 if (fileInspector.supported) {
351 return (
352 <ThreadRouteScreen
353 onReturnToThread={handleReturnToThread}
354 renderInspector={renderInspector}
355 route={props.route}
356 />
357 );
358 }
359​
360 const usesCompactMailToolbar =
361 Platform.OS === "ios" && !layout.usesSplitView && NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED;
362​
363 return (
364 <>
365 {/* Static header config (glass preset, title, contentStyle) lives in Stack.tsx.
366 Only genuinely dynamic options are set here. */}
367 <NativeStackScreenOptions
368 options={{
369 headerShown: !isAndroid,
370 unstable_headerSubtitle:
371 Platform.OS === "ios" && projectName.length > 0 ? projectName : undefined,
372 // No refresh button: the list already supports pull-to-refresh.
373 unstable_headerToolbarItems: usesCompactMailToolbar
374 ? () => [
375 createNativeMailSearchToolbarItem({
376 onSearchTextChange: setSearchQuery,
377 placeholder: "Search files",
378 searchTextChangeId: "files-search-text",
379 }),
380 ]
381 : undefined,
382 headerSearchBarOptions: usesCompactMailToolbar
383 ? undefined
384 : {
385 allowToolbarIntegration: true,
386 autoCapitalize: "none",
387 hideNavigationBar: false,
388 placeholder: "Search files",
389 onChangeText: (event) => {
390 setSearchQuery(event.nativeEvent.text);
391 },
392 onCancelButtonPress: () => {
393 setSearchQuery("");
394 },
395 },
396 }}
397 />
398 {isAndroid ? (
399 <>
400 <AndroidScreenHeader
401 title="Files"
402 subtitle={projectName}
403 onBack={handleReturnToThread}
404 actions={[
405 {
406 accessibilityLabel: "Refresh files",
407 icon: "arrow.clockwise",
408 onPress: entriesQuery.refresh,
409 },
410 ]}
411 />
412 <View className="flex-row items-center gap-2 border-b border-border px-3 py-2">
413 <SymbolView name="magnifyingglass" size={17} tintColor={iconColor} type="monochrome" />
414 <TextInput
415 accessibilityLabel="Search files"
416 autoCapitalize="none"
417 autoCorrect={false}
418 className="min-h-10 flex-1 rounded-xl py-2 text-sm"
419 placeholder="Search files"
420 value={searchQuery}
421 onChangeText={setSearchQuery}
422 />
423 </View>
424 </>
425 ) : (
426 <>
427 {layout.usesSplitView ? (
428 <NativeHeaderToolbar placement="left">
429 <NativeHeaderToolbar.Button
430 accessibilityLabel={panes.primarySidebarVisible ? "Maximize files" : "Show threads"}
431 icon={
432 panes.primarySidebarVisible
433 ? "arrow.up.left.and.arrow.down.right"
434 : "sidebar.left"
435 }
436 onPress={togglePrimarySidebar}
437 separateBackground
438 />
439 </NativeHeaderToolbar>
440 ) : null}
441 {usesCompactMailToolbar ? null : (
442 <NativeHeaderToolbar placement="bottom">
443 <NativeHeaderToolbar.SearchBarSlot />
444 </NativeHeaderToolbar>
445 )}
446 </>
447 )}
448 <FileTreeBrowser
449 entries={entriesData?.entries ?? []}
450 error={entriesQuery.error}
451 isPending={entriesQuery.isPending}
452 searchQuery={searchQuery}
453 selectedPath={null}
454 onPreviewFile={handlePreviewFile}
455 onRefresh={entriesQuery.refresh}
456 onSelectFile={handleSelectFile}
457 />
458 <FilesToolbarBottomFade />
459 </>
460 );
462​
463export function ThreadFileScreen(props: ThreadFileRouteScreenProps) {
464 useAdaptiveWorkspacePaneRole("inspector");
465 const navigation = useNavigation();
466 const { fileInspector, panes, toggleAuxiliaryPane } = useAdaptiveWorkspaceLayout();
467 const iconColor = useThemeColor("--color-icon");
468 const params = props.route.params;
469 const relativePath = normalizeRoutePath(params.path);
470 const targetLine = normalizeRouteLine(firstRouteParam(params.line));
471 const { cwd, environmentId, projectName, selectedThread, threadId } = useThreadFilesWorkspace(
472 props.route.params,
473 );
474 const [modeOverride, setModeOverride] = useState<{
475 readonly path: string;
476 readonly mode: FileViewMode;
477 } | null>(null);
478 const [previewRevision, setPreviewRevision] = useState(0);
479 const isBrowserFile = relativePath !== null && isBrowserPreviewFile(relativePath);
480 const isImageFile = relativePath !== null && isImagePreviewFile(relativePath);
481 const canPreview =
482 relativePath !== null && (isMarkdownPreviewFile(relativePath) || isBrowserFile || isImageFile);
483 const activeMode =
484 relativePath !== null && modeOverride?.path === relativePath
485 ? modeOverride.mode
486 : defaultViewMode(relativePath);
487 const resolvedActiveMode = canPreview ? activeMode : "source";
488 const assetPreviewPath = isBrowserFile || isImageFile ? relativePath : null;
489 const assetPreviewUri = useWorkspaceFileAssetUrl({
490 cwd,
491 environmentId,
492 relativePath: assetPreviewPath,
493 threadId,
494 });
495 const previewUri =
496 assetPreviewUri === null || previewRevision === 0
497 ? assetPreviewUri
498 : `${assetPreviewUri}${assetPreviewUri.includes("?") ? "&" : "?"}revision=${previewRevision}`;
499 const needsFileContents =
500 relativePath !== null &&
501 (resolvedActiveMode === "source" || isMarkdownPreviewFile(relativePath));
502 const fileQuery = useEnvironmentQuery(
503 environmentId !== null && cwd !== null && relativePath !== null && needsFileContents
504 ? projectEnvironment.readFile({
505 environmentId,
506 input: { cwd, relativePath },
507 })
508 : null,
509 );
510 const fileData = fileQuery.data as ProjectReadFileResult | null;
511​
512 const handleSelectFile = useCallback(
513 (path: string) => {
514 navigation.navigate("ThreadFile", {
515 environmentId: String(environmentId),
516 threadId: String(threadId),
517 path: path.split("/").filter(Boolean),
518 });
519 },
520 [environmentId, navigation, threadId],
521 );
522 const renderInspector = useCallback(
523 (headerInset: number) =>
524 fileInspector.supported && environmentId !== null && cwd !== null ? (
525 <ThreadFileNavigatorPane
526 cwd={cwd}
527 environmentId={environmentId}
528 headerInset={headerInset}
529 projectName={projectName}
530 selectedPath={relativePath}
531 onSelectFile={handleSelectFile}
532 />
533 ) : undefined,
534 [cwd, environmentId, fileInspector.supported, handleSelectFile, projectName, relativePath],
535 );
536 // The workspace inspector column spans the full window height. On iOS the
537 // pane brings its own nested native header; elsewhere it pads itself below
538 // the top inset.
539 const safeAreaInsets = useSafeAreaInsets();
540 const inspectorHeaderInset = Platform.OS === "ios" ? 0 : safeAreaInsets.top;
541 // Hand the file navigator to the workspace so it renders beside the
542 // navigator, outside this screen's native header.
543 const renderWorkspaceInspector = useCallback(
544 () => renderInspector(inspectorHeaderInset),
545 [inspectorHeaderInset, renderInspector],
546 );
547 useRegisterWorkspaceInspector(fileInspector.supported ? renderWorkspaceInspector : undefined);
548​
549 if (selectedThread === null || environmentId === null || threadId === null) {
550 return <LoadingScreen message="Opening file..." messagePlacement="above-spinner" />;
551 }
552​
553 if (cwd === null) {
554 return <FilesUnavailable />;
555 }
556​
557 if (relativePath === null) {
558 return (
559 <View className="flex-1 items-center justify-center bg-sheet px-6">
560 <NativeStackScreenOptions options={{ title: "Files" }} />
561 <EmptyState title="File unavailable" detail="This file path is invalid." />
562 </View>
563 );
564 }
565​
566 const parentDir = relativePath.split("/").slice(0, -1).join("/");
567 const headerSubtitle = [projectName, parentDir].filter(Boolean).join(" · ");
568​
569 return (
570 <ReviewHighlighterProvider>
571 <View className="flex-1 bg-sheet">
572 <NativeStackScreenOptions
573 options={{
574 // Static header config lives in Stack.tsx (SOLID_HEADER_OPTIONS: solid
575 // sheet-colored header — this route's content scrolls internally, so
576 // there is nothing for glass to sample). Only dynamic values here.
577 headerTintColor: iconColor,
578 headerTitle: basename(relativePath),
579 title: basename(relativePath),
580 unstable_headerSubtitle:
581 Platform.OS === "ios" && headerSubtitle.length > 0 ? headerSubtitle : undefined,
582 }}
583 />
584 <WorkspaceSidebarToolbar>
585 {fileInspector.supported ? (
586 <NativeHeaderToolbar.Button
587 accessibilityLabel="Return to chat"
588 icon="chevron.left"
589 onPress={() => {
590 navigation.dispatch(
591 StackActions.replace("Thread", {
592 environmentId: String(environmentId),
593 threadId: String(threadId),
594 }),
595 );
596 }}
597 />
598 ) : null}
599 </WorkspaceSidebarToolbar>
600 <NativeHeaderToolbar placement="right">
601 {fileInspector.supported ? (
602 <NativeHeaderToolbar.Button
603 accessibilityLabel={
604 panes.auxiliaryPaneVisible ? "Hide file navigator" : "Show file navigator"
605 }
606 icon="sidebar.right"
607 onPress={toggleAuxiliaryPane}
608 separateBackground
609 />
610 ) : null}
611 <NativeHeaderToolbar.Menu accessibilityLabel="File actions" icon="ellipsis">
612 {canPreview && !isImageFile ? (
613 <NativeHeaderToolbar.Menu inline>
614 <NativeHeaderToolbar.MenuAction
615 icon="eye"
616 isOn={resolvedActiveMode === "preview"}
617 onPress={() => setModeOverride({ path: relativePath, mode: "preview" })}
618 >
619 Preview
620 </NativeHeaderToolbar.MenuAction>
621 <NativeHeaderToolbar.MenuAction
622 icon="doc.text"
623 isOn={resolvedActiveMode === "source"}
624 onPress={() => setModeOverride({ path: relativePath, mode: "source" })}
625 >
626 Source
627 </NativeHeaderToolbar.MenuAction>
628 </NativeHeaderToolbar.Menu>
629 ) : null}
630 <NativeHeaderToolbar.MenuAction
631 icon="doc.on.doc"
632 onPress={() => copyTextWithHaptic(relativePath)}
633 >
634 Copy path
635 </NativeHeaderToolbar.MenuAction>
636 {isBrowserFile && typeof assetPreviewUri === "string" ? (
637 <NativeHeaderToolbar.MenuAction
638 icon="safari"
639 onPress={() => {
640 void tryOpenExternalUrl(assetPreviewUri, "file-preview");
641 }}
642 >
643 Open in Safari
644 </NativeHeaderToolbar.MenuAction>
645 ) : null}
646 {resolvedActiveMode === "preview" && (isBrowserFile || isImageFile) ? (
647 <NativeHeaderToolbar.MenuAction
648 icon="arrow.clockwise"
649 onPress={() => {
650 setPreviewRevision((current) => current + 1);
651 }}
652 >
653 Refresh
654 </NativeHeaderToolbar.MenuAction>
655 ) : null}
656 </NativeHeaderToolbar.Menu>
657 </NativeHeaderToolbar>
658 <FileContent
659 activeMode={resolvedActiveMode}
660 previewUri={previewUri}
661 fileContents={fileData?.contents ?? null}
662 fileError={fileQuery.error}
663 initialLine={targetLine}
664 relativePath={relativePath}
665 truncated={fileData?.truncated ?? false}
666 onRefresh={() => fileQuery.refresh()}
667 />
668 </View>
669 </ReviewHighlighterProvider>
670 );