Open History to see the last commit
1import { uuidv4 } from "../../lib/uuid";
2import { useNavigation } from "@react-navigation/native";
3import {
4 claimThreadOpen,
5 nextShownOrder,
6 threadSearchSubject,
7 type EnvironmentThreadSearchMatch,
8 type ShownOrder,
9} from "@t3tools/client-runtime/state/thread-search";
10import { THREAD_JUMP_KEYBINDING_COMMANDS } from "@t3tools/contracts";
11import {
12 foldSearchQuery,
13 PALETTE_MESSAGE_LIMIT,
14 rankMessageMatches,
15 splitSearchText,
16 pickedQuery,
17 threadRecentUse,
18} from "@t3tools/shared/paletteSearch";
19import { useCallback, useEffect, useMemo, useRef, useState } from "react";
20import {
21 FlatList,
22 KeyboardAvoidingView,
23 Modal,
24 Pressable,
25 Text as NativeText,
26 TextInput,
27 useWindowDimensions,
28 View,
29 type TextInputInstance,
30} from "react-native";
31
32import { GestureHandlerRootView } from "react-native-gesture-handler";
33
34import { ProjectFavicon } from "../../components/ProjectFavicon";
35import { GlassSurface } from "../../components/ui/GlassSurface";
36import { RowPressable } from "../../components/ui/RowPressable";
37import { AppText as Text } from "../../components/ui/AppText";
38import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol";
39import { cn } from "../../lib/cn";
40import { deriveBottomControlInsets } from "../../lib/reserved-regions";
41import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
42import { useNativeLayoutMetrics } from "../../native/native-layout-metrics";
43import { T3KeyboardCommands } from "../../native/T3KeyboardCommands";
44import { useProjects, useThreadShell, useThreadShells } from "../../state/entities";
45import { useThreadSearch } from "../../state/queries";
46import { requestThreadMessageJump } from "../threads/threadMessageJump";
47import { threadEnvironment } from "../../state/threads";
48import { useAtomCommand } from "../../state/use-atom-command";
49import { useWorkspaceEnvironments } from "../../state/workspace";
50import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
51import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
52import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
53import { ThreadSearchMatchExcerpt } from "../threads/thread-search-match";
54import {
55 filterCommandPaletteItems,
56 nextPaletteIndex,
57 type CommandPaletteItem,
58 type CommandPaletteResult,
59} from "./commandPaletteItems";
60import { parseActiveThreadPath, type HardwareKeyboardCommand } from "./hardwareKeyboardCommands";
61import { threadJumpIndex } from "./threadKeyboardShortcuts";
62import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
63
64const PALETTE_COMMANDS: ReadonlyArray<HardwareKeyboardCommand> = [
65 "commandPalette",
66 "paletteDismiss",
67 "paletteNext",
68 "palettePrevious",
69 ...THREAD_JUMP_KEYBINDING_COMMANDS,
70];
71const ROW_HEIGHT = 50;
72// The "In messages" label above the first message match; server results always come last.
73const SECTION_LABEL_HEIGHT = 26;
74
75const ACTION_ICONS: Record<string, AppSymbolName> = {
76 newTask: "square.and.pencil",
77 newThread: "square.and.pencil",
78 addProject: "folder.badge.plus",
79 settings: "gearshape",
80 appearance: "paintbrush",
81 environments: "desktopcomputer",
82 usage: "chart.bar.xaxis",
83 archive: "archivebox",
84 files: "doc.text",
85 terminal: "terminal",
86 review: PullRequestGlyph.pullRequest,
87 copyThreadReference: "link",
88};
89
90function itemIcon(item: CommandPaletteItem): AppSymbolName {
91 if (item.kind === "thread") return "text.bubble";
92 return ACTION_ICONS[item.key] ?? "ellipsis";
93}
94
95function PaletteRow(props: {
96 readonly item: CommandPaletteResult;
97 readonly index: number;
98 readonly selected: boolean;
99 readonly searchMatch?: EnvironmentThreadSearchMatch;
100 readonly searchQuery: string;
101 readonly onSelect: () => void;
102}) {
103 const foregroundClassName = props.selected
104 ? "text-thread-selected-foreground"
105 : "text-foreground";
106 const mutedForegroundClassName = props.selected
107 ? "text-thread-selected-foreground-muted"
108 : "text-foreground-muted";
109 return (
110 <RowPressable
111 accessibilityRole="button"
112 interactionOpacity={props.selected ? 0 : 1}
113 accessibilityState={{ selected: props.selected }}
114 onPress={props.onSelect}
115 className={
116 props.selected
117 ? "mx-2 flex-row items-center gap-3 rounded-xl bg-thread-selected px-3"
118 : "mx-2 flex-row items-center gap-3 rounded-xl px-3"
119 }
120 style={{ height: ROW_HEIGHT }}
121 >
122 <View className="w-7 items-center">
123 {props.item.project ? (
124 <ProjectFavicon
125 environmentId={props.item.project.environmentId}
126 faviconPath={props.item.project.faviconPath}
127 projectIcon={props.item.project.projectIcon}
128 projectTitle={props.item.project.title}
129 size={20}
130 workspaceRoot={props.item.project.workspaceRoot}
131 />
132 ) : (
133 <SymbolView
134 name={itemIcon(props.item)}
135 size={20}
136 tintColorClassName={
137 props.selected ? "accent-thread-selected-foreground" : "accent-icon"
138 }
139 />
140 )}
141 </View>
142 <View className="flex-1">
143 <View className="flex-row items-baseline gap-2">
144 <Text numberOfLines={1} className={cn("shrink text-base", foregroundClassName)}>
145 {props.item.titleRanges?.length
146 ? splitSearchText(props.item.title, props.item.titleRanges).map((part) => (
147 <Text
148 key={part.start}
149 className={cn("text-base", part.highlighted && "font-t3-bold")}
150 >
151 {part.text}
152 </Text>
153 ))
154 : props.item.title}
155 </Text>
156 {/* The second line shows the snippet or hint, so keep where the thread
157 lives, unless the hint already names it. */}
158 {(props.searchMatch ||
159 (props.item.matchHint &&
160 props.item.matchHint.label !== "Project" &&
161 props.item.matchHint.label !== "Environment")) &&
162 props.item.detail ? (
163 <Text
164 numberOfLines={1}
165 className={cn("max-w-[45%] shrink-0 text-sm", mutedForegroundClassName)}
166 >
167 {props.item.detail}
168 </Text>
169 ) : null}
170 </View>
171 {props.searchMatch ? (
172 <ThreadSearchMatchExcerpt
173 match={props.searchMatch}
174 query={props.searchQuery}
175 selected={props.selected}
176 compact
177 />
178 ) : props.item.matchHint ? (
179 <Text numberOfLines={1} className={cn("text-sm", mutedForegroundClassName)}>
180 {props.item.matchHint.label}:{" "}
181 {splitSearchText(props.item.matchHint.text, props.item.matchHint.ranges).map((part) => (
182 <Text key={part.start} className={cn("text-sm", part.highlighted && "font-t3-bold")}>
183 {part.text}
184 </Text>
185 ))}
186 </Text>
187 ) : props.item.detail ? (
188 <Text numberOfLines={1} className={cn("text-sm", mutedForegroundClassName)}>
189 {props.item.detail}
190 </Text>
191 ) : null}
192 </View>
193 {props.index < 9 ? (
194 <NativeText
195 className={cn("w-8 shrink-0 text-right text-sm tabular-nums", mutedForegroundClassName)}
196 >
197 ⌘{props.index + 1}
198 </NativeText>
199 ) : null}
200 </RowPressable>
201 );
202}
203
204/** Mounted only while open, so the app root does not subscribe to the full thread catalog. */
205export function CommandPalette(props: {
206 readonly pathname: string;
207 readonly onClose: () => void;
208 readonly onCommand: (command: HardwareKeyboardCommand) => void;
209}) {
210 const navigation = useNavigation();
211 const { themeVariables } = useAppearancePreferences();
212 const { selectThread, selectThreadRoute } = useAdaptiveWorkspaceLayout();
213 const runCommand = props.onCommand;
214 const projects = useProjects();
215 const threads = useThreadShells();
216 const activeThreadRef = useMemo(() => parseActiveThreadPath(props.pathname), [props.pathname]);
217 const activeThread = useThreadShell(activeThreadRef);
218 const visitThread = useAtomCommand(threadEnvironment.visit, { reportFailure: false });
219 const environments = useWorkspaceEnvironments();
220 const { savedConnectionsById } = useSavedRemoteConnections();
221 const [query, setQuery] = useState("");
222 // Ranking is relative to when the palette opened, so rows do not reorder as time passes.
223 const [now] = useState(() => Date.now());
224 const [selection, setSelection] = useState<string | null>(null);
225 const [visible, setVisible] = useState(true);
226 const pendingAction = useRef<(() => void) | null>(null);
227 const closing = useRef(false);
228 const inputRef = useRef<TextInputInstance>(null);
229 const listRef = useRef<FlatList<CommandPaletteResult>>(null);
230 const { width, height } = useWindowDimensions();
231 // The palette floats above every column, so it keeps itself inside the window's side insets
232 // and to one side of a book fold.
233 const bounds = deriveBottomControlInsets(useNativeLayoutMetrics());
234 const searchEnvironmentIds = useMemo(
235 () =>
236 environments
237 .filter((environment) => environment.connectionState === "connected")
238 .map((environment) => environment.environmentId),
239 [environments],
240 );
241 const search = useThreadSearch(searchEnvironmentIds, query.startsWith(">") ? "" : query);
242 const contentMatchByKey = useMemo(
243 () =>
244 new Map(
245 search.matches
246 .filter((match) => match.source === "user" || match.source === "assistant")
247 .map((match) => [scopedThreadKey(match.environmentId, match.threadId), match]),
248 ),
249 [search.matches],
250 );
251 const items = useMemo(() => {
252 const actions: CommandPaletteItem[] = [
253 {
254 key: "newTask",
255 kind: "action",
256 title: "New thread in…",
257 searchTerms: ["new task", "chat", "create", "project"],
258 run: () => runCommand("newTask"),
259 },
260 {
261 key: "addProject",
262 kind: "action",
263 title: "Add project",
264 searchTerms: ["folder", "clone", "repository", "git"],
265 run: () => navigation.navigate("AddProject"),
266 },
267 {
268 key: "settings",
269 kind: "action",
270 title: "Open settings",
271 searchTerms: ["preferences", "configuration"],
272 run: () =>
273 navigation.navigate("SettingsSheet", {
274 screen: "SettingsContent",
275 params: { screen: "Settings" },
276 }),
277 },
278 {
279 key: "appearance",
280 kind: "action",
281 title: "Appearance",
282 searchTerms: ["theme", "colors", "dark", "light"],
283 run: () =>
284 navigation.navigate("SettingsSheet", {
285 screen: "SettingsContent",
286 params: { screen: "SettingsAppearance" },
287 }),
288 },
289 {
290 key: "environments",
291 kind: "action",
292 title: "Manage environments",
293 searchTerms: ["connections", "server", "remote"],
294 run: () =>
295 navigation.navigate("SettingsSheet", {
296 screen: "SettingsContent",
297 params: { screen: "SettingsEnvironments" },
298 }),
299 },
300 {
301 key: "scheduledTasks",
302 kind: "action",
303 title: "Scheduled tasks",
304 searchTerms: ["schedule", "automations", "recurring"],
305 run: () =>
306 navigation.navigate("SettingsSheet", {
307 screen: "SettingsContent",
308 params: { screen: "SettingsScheduledTasks" },
309 }),
310 },
311 {
312 key: "usage",
313 kind: "action",
314 title: "Usage",
315 searchTerms: ["limits", "accounts", "quota"],
316 run: () =>
317 navigation.navigate("SettingsSheet", {
318 screen: "SettingsContent",
319 params: { screen: "SettingsUsage" },
320 }),
321 },
322 {
323 key: "archive",
324 kind: "action",
325 title: "Archived threads",
326 searchTerms: ["restore", "history"],
327 run: () =>
328 navigation.navigate("SettingsSheet", {
329 screen: "SettingsContent",
330 params: { screen: "SettingsArchive" },
331 }),
332 },
333 ];
334 const projectByKey = new Map(
335 projects.map((project) => [scopedProjectKey(project.environmentId, project.id), project]),
336 );
337 const activeProject = activeThread
338 ? projectByKey.get(scopedProjectKey(activeThread.environmentId, activeThread.projectId))
339 : null;
340 if (activeProject) {
341 actions.unshift({
342 key: "newThread",
343 kind: "action",
344 title: `New thread in ${activeProject.title}`,
345 searchTerms: ["new task", "chat", "create"],
346 run: () =>
347 selectThreadRoute({
348 draft: {
349 requestId: uuidv4(),
350 environmentId: activeProject.environmentId,
351 projectId: activeProject.id,
352 title: activeProject.title,
353 },
354 }),
355 });
356 }
357 if (activeThreadRef) {
358 const threadActions = [
359 ["files", "Go to file", ["open", "files", "browse", "search"]],
360 ["terminal", "Open terminal", ["shell", "console"]],
361 ["review", "Review changes", ["diff", "git", "pull request"]],
362 ["copyThreadReference", "Copy PR link or thread ID", ["reference", "clipboard"]],
363 ] as const;
364 actions.push(
365 ...threadActions.map(([command, title, searchTerms]) => ({
366 key: command,
367 kind: "action" as const,
368 title,
369 searchTerms,
370 run: () => runCommand(command),
371 })),
372 );
373 }
374 const projectItems: CommandPaletteItem[] = projects.map((project) => ({
375 key: `project:${scopedProjectKey(project.environmentId, project.id)}`,
376 kind: "project",
377 project,
378 title: project.title,
379 detail: `New thread · ${savedConnectionsById[project.environmentId]?.environmentLabel ?? project.environmentId}`,
380 searchTerms: [project.workspaceRoot, "new thread", "project"],
381 run: () =>
382 selectThreadRoute({
383 draft: {
384 requestId: uuidv4(),
385 environmentId: project.environmentId,
386 projectId: project.id,
387 title: project.title,
388 },
389 }),
390 }));
391 const threadItems: CommandPaletteItem[] = threads
392 .filter(
393 (thread) =>
394 thread.archivedAt === null && thread.lineage.relationshipToParent !== "subagent",
395 )
396 .map((thread) => {
397 const project = projectByKey.get(scopedProjectKey(thread.environmentId, thread.projectId));
398 const environment =
399 savedConnectionsById[thread.environmentId]?.environmentLabel ?? thread.environmentId;
400 return {
401 key: scopedThreadKey(thread.environmentId, thread.id),
402 kind: "thread",
403 title: thread.title || "Untitled thread",
404 detail: [project?.title, environment].filter(Boolean).join(" · "),
405 searchTerms: [],
406 threadSearch: threadSearchSubject(
407 thread,
408 project?.title,
409 environments.length > 1 ? environment : null,
410 ),
411 // Last among threads: picking the thread already open does nothing.
412 ...(thread.environmentId === activeThread?.environmentId && thread.id === activeThread.id
413 ? { secondary: true }
414 : {}),
415 run: () => selectThread(thread),
416 };
417 });
418 // Recent means used recently: written in or opened, whichever is later.
419 threadItems.sort(
420 (left, right) =>
421 (right.threadSearch ? threadRecentUse(right.threadSearch) : 0) -
422 (left.threadSearch ? threadRecentUse(left.threadSearch) : 0),
423 );
424 return [...actions, ...projectItems, ...threadItems];
425 }, [
426 activeThread,
427 activeThreadRef,
428 environments.length,
429 navigation,
430 projects,
431 runCommand,
432 savedConnectionsById,
433 selectThread,
434 selectThreadRoute,
435 threads,
436 ]);
437 const rankedMessageKeys = useMemo(() => {
438 const subjectByKey = new Map(
439 items.flatMap((item) => (item.threadSearch ? [[item.key, item.threadSearch] as const] : [])),
440 );
441 const keyOf = (match: EnvironmentThreadSearchMatch) =>
442 scopedThreadKey(match.environmentId, match.threadId);
443 return rankMessageMatches(
444 search.matches,
445 (match) => subjectByKey.get(keyOf(match)),
446 foldSearchQuery(query),
447 now,
448 { withoutTitleMatches: true },
449 ).map(keyOf);
450 }, [items, now, query, search.matches]);
451 // Rows already shown keep their places when a slower environment answers.
452 const [shownOrder, setShownOrder] = useState<ShownOrder | null>(null);
453 const messageOrder = nextShownOrder(
454 shownOrder,
455 search.query,
456 rankedMessageKeys,
457 PALETTE_MESSAGE_LIMIT,
458 );
459 if (messageOrder !== shownOrder) setShownOrder(messageOrder);
460 const messageMatchKeys = useMemo(
461 () => messageOrder.keys.slice(0, messageOrder.shown),
462 [messageOrder.keys, messageOrder.shown],
463 );
464 const results = useMemo(() => {
465 const ranked = filterCommandPaletteItems(items, query, messageMatchKeys, now);
466 // Recent threads leave out the open one, which would always lead them.
467 const activeKey = activeThread
468 ? scopedThreadKey(activeThread.environmentId, activeThread.id)
469 : null;
470 return query.trim() ? ranked : ranked.filter((item) => item.key !== activeKey);
471 }, [activeThread, items, messageMatchKeys, now, query]);
472 const runResult = (item: CommandPaletteResult) => {
473 const thread =
474 item.kind === "thread" && query.trim() && !query.startsWith(">")
475 ? threads.find(
476 (candidate) => scopedThreadKey(candidate.environmentId, candidate.id) === item.key,
477 )
478 : undefined;
479 // A message result opens the thread at that message.
480 const messageId = item.fromMessages ? contentMatchByKey.get(item.key)?.messageId : undefined;
481 if (messageId) requestThreadMessageJump(item.key, messageId);
482 // A pick sends its open with the query, always, so the server records it;
483 // the thread screen then skips its own open. The open thread is no pick.
484 if (thread && !item.secondary) claimThreadOpen(thread.environmentId, thread.id, Date.now());
485 if (thread && thread.lastVisitedAt !== undefined && !item.secondary) {
486 void visitThread({
487 environmentId: thread.environmentId,
488 input: {
489 threadId: thread.id,
490 visitedAt: thread.updatedAt,
491 opened: true,
492 searchQuery: pickedQuery(query),
493 },
494 });
495 }
496 item.run();
497 };
498 const firstMessageIndex = results.findIndex((item) => item.fromMessages);
499 const selectedIndex = Math.max(
500 0,
501 results.findIndex((item) => item.key === selection),
502 );
503 const selectedKey = results[selectedIndex]?.key;
504 useEffect(() => {
505 if (selectedIndex === 0) {
506 // Centering before the list measures its height scrolls half the first row out of view.
507 listRef.current?.scrollToOffset({ offset: 0, animated: false });
508 } else if (selectedKey !== undefined) {
509 listRef.current?.scrollToIndex({ index: selectedIndex, animated: false, viewPosition: 0.5 });
510 }
511 }, [selectedIndex, selectedKey]);
512
513 const dismissed = useRef(false);
514 const handleDismissed = useCallback(() => {
515 if (dismissed.current) return;
516 dismissed.current = true;
517 // Present navigation sheets only after UIKit has dismissed this modal.
518 props.onClose();
519 pendingAction.current?.();
520 }, [props]);
521
522 // iOS drops Modal onDismiss when the VC is dismissed mid-presentation (e.g.
523 // ⌘K during the fade-in) or raced by another sheet — without a fallback the
524 // palette stays mounted-but-invisible and ⌘K dead-ends on a stale open state.
525 useEffect(() => {
526 if (visible) return;
527 const fallback = setTimeout(handleDismissed, 400);
528 return () => clearTimeout(fallback);
529 }, [visible, handleDismissed]);
530
531 function close(run?: () => void) {
532 if (closing.current) return;
533 closing.current = true;
534 pendingAction.current = run ?? null;
535 setVisible(false);
536 }
537
538 function onCommand(command: HardwareKeyboardCommand) {
539 if (command === "commandPalette" || command === "paletteDismiss") {
540 close();
541 } else if (command === "paletteNext" || command === "palettePrevious") {
542 setSelection(
543 results[nextPaletteIndex(selectedIndex, command === "paletteNext" ? 1 : -1, results.length)]
544 ?.key ?? null,
545 );
546 } else {
547 const item = results[threadJumpIndex(command)];
548 if (item) close(() => runResult(item));
549 }
550 }
551
552 return (
553 <Modal
554 visible={visible}
555 transparent
556 animationType="fade"
557 onShow={() => inputRef.current?.focus()}
558 onRequestClose={() => close()}
559 onDismiss={handleDismissed}
560 >
561 <GestureHandlerRootView className="flex-1">
562 <T3KeyboardCommands enabledCommands={PALETTE_COMMANDS} onCommand={onCommand}>
563 <KeyboardAvoidingView
564 behavior="padding"
565 className="flex-1 items-center justify-center py-4"
566 style={{ paddingLeft: 16 + bounds.left, paddingRight: 16 + bounds.right }}
567 >
568 <Pressable
569 className="absolute inset-0 bg-backdrop"
570 accessibilityLabel="Close command palette"
571 onPress={() => close()}
572 />
573 <GlassSurface
574 accessibilityViewIsModal
575 className="bg-sheet"
576 tintColorClassName="accent-sheet/20"
577 fallbackColor={themeVariables["--color-sheet"]}
578 style={{
579 width: Math.min(600, width - 32 - bounds.left - bounds.right),
580 height: Math.min(520, height - 80),
581 borderRadius: 20,
582 }}
583 >
584 <View className="px-3 pb-2.5 pt-3.5">
585 <View className="h-[38px] flex-row items-center gap-1.5 pr-2.5 pl-[11px]">
586 <SymbolView
587 name="magnifyingglass"
588 size={15}
589 tintColorClassName="accent-foreground-muted"
590 type="monochrome"
591 />
592 <TextInput
593 ref={inputRef}
594 accessibilityLabel="Search commands, projects, and threads"
595 placeholder="Search commands, projects, and threads…"
596 placeholderTextColorClassName="accent-placeholder"
597 autoCorrect={false}
598 autoCapitalize="none"
599 clearButtonMode="while-editing"
600 className="h-[34px] flex-1 px-0 py-0 font-sans text-base text-foreground"
601 value={query}
602 onChangeText={(value) => {
603 setQuery(value);
604 setSelection(null);
605 listRef.current?.scrollToOffset({ offset: 0, animated: false });
606 }}
607 returnKeyType="go"
608 submitBehavior="submit"
609 onSubmitEditing={() => {
610 const item = results[selectedIndex];
611 if (item) close(() => runResult(item));
612 }}
613 />
614 </View>
615 </View>
616 <FlatList
617 ref={listRef}
618 data={results}
619 extraData={selectedKey}
620 keyboardShouldPersistTaps="handled"
621 keyExtractor={(item) => item.key}
622 getItemLayout={(_, index) => ({
623 length: ROW_HEIGHT + (index === firstMessageIndex ? SECTION_LABEL_HEIGHT : 0),
624 offset:
625 ROW_HEIGHT * index +
626 (firstMessageIndex !== -1 && index > firstMessageIndex
627 ? SECTION_LABEL_HEIGHT
628 : 0),
629 index,
630 })}
631 contentContainerClassName="pb-2"
632 ListEmptyComponent={
633 <Text className="p-5 text-center text-foreground-muted">
634 {search.isPending ? "Searching…" : "No results"}
635 </Text>
636 }
637 // Message results from slower environments may still arrive below.
638 ListFooterComponent={
639 results.length > 0 && search.isPending && !query.startsWith(">") ? (
640 <Text className="px-5 pt-2 text-xs text-foreground-muted">
641 Searching messages…
642 </Text>
643 ) : undefined
644 }
645 renderItem={({ item, index }) => (
646 <>
647 {index === firstMessageIndex ? (
648 <Text
649 className="px-5 pt-2 text-xs text-foreground-muted"
650 style={{ height: SECTION_LABEL_HEIGHT }}
651 >
652 In messages
653 </Text>
654 ) : null}
655 <PaletteRow
656 item={item}
657 index={index}
658 selected={item.key === selectedKey}
659 searchMatch={item.fromMessages ? contentMatchByKey.get(item.key) : undefined}
660 searchQuery={search.query}
661 onSelect={() => close(() => runResult(item))}
662 />
663 </>
664 )}
665 />
666 </GlassSurface>
667 </KeyboardAvoidingView>
668 </T3KeyboardCommands>
669 </GestureHandlerRootView>
670 </Modal>
671 );
672}