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

ThreadSettingsSheet.tsx

678 lines24.8 KB

1import type {
2 ModelSelection,
3 ProviderInteractionMode,
4 ProviderOptionDescriptor,
5 ProviderOptionSelection,
6 RuntimeMode,
7} from "@t3tools/contracts";
8import {
9 getProviderOptionCurrentLabel,
10 getProviderOptionCurrentValue,
11 getProviderOptionDescriptors,
12} from "@t3tools/shared/model";
13import * as Haptics from "expo-haptics";
14import { useCallback, useEffect, useRef, useState } from "react";
15import {
16 Modal,
17 Platform,
18 Pressable,
19 ScrollView,
20 Switch,
21 useWindowDimensions,
22 View,
23} from "react-native";
24import { useSafeAreaInsets } from "react-native-safe-area-context";
25​
26import { SymbolView } from "../../components/AppSymbol";
27import { AppText as Text } from "../../components/AppText";
28import { ProviderIcon } from "../../components/ProviderIcon";
29import { cn } from "../../lib/cn";
30import type { ModelOption, ProviderGroup } from "../../lib/modelOptions";
31import { applyProviderOptionSelection, providerOptionValueLabels } from "../../lib/providerOptions";
32import { useThemeColor } from "../../lib/useThemeColor";
33import { pendingModelAfterPress } from "./thread-settings-sheet-state";
34import type { ThreadSettingsSheetCloseReason } from "./use-thread-settings-sheet-presentation";
35​
36/**
37 * The everyday harnesses stay expanded; every other provider (OpenRouter
38 * catalogs and friends) folds behind its header so a 300-model catalog can't
39 * bury the list.
40 */
41const PRIMARY_PROVIDER_DRIVERS: ReadonlySet<string> = new Set(["claudeAgent", "codex"]);
42​
43/**
44 * Desktop-oriented effort keywords that don't belong in the phone picker.
45 * Prompt-injected values (ultrathink and friends) are filtered from the
46 * descriptor metadata; ultracode is a real option but a workflow trigger, not
47 * a reasoning level. A value set elsewhere still displays, it just isn't
48 * offered.
49 */
50const HIDDEN_EFFORT_OPTION_IDS: ReadonlySet<string> = new Set(["ultracode"]);
51​
52const RUNTIME_MODE_CHOICES: ReadonlyArray<{
53 readonly mode: RuntimeMode;
54 readonly label: string;
55 readonly shortLabel: string;
56}> = [
57 { mode: "approval-required", label: "Approve actions", shortLabel: "Approve" },
58 { mode: "auto-accept-edits", label: "Auto-accept edits", shortLabel: "Edits" },
59 { mode: "auto", label: "Auto", shortLabel: "Auto" },
60 { mode: "full-access", label: "Full access", shortLabel: "Full" },
61];
62​
63/**
64 * Compact "Fable 5 · Max · Auto" style summary for the composer trigger pill,
65 * covering model, provider options, runtime mode, and plan mode in one label.
66 */
67export function threadSettingsSummaryLabel(input: {
68 readonly modelLabel: string;
69 readonly optionDescriptors: ReadonlyArray<ProviderOptionDescriptor>;
70 readonly runtimeMode: RuntimeMode;
71 readonly interactionMode: ProviderInteractionMode;
72}): string {
73 const runtime = RUNTIME_MODE_CHOICES.find((choice) => choice.mode === input.runtimeMode);
74 return [
75 input.modelLabel,
76 ...providerOptionValueLabels(input.optionDescriptors),
77 ...(runtime ? [runtime.shortLabel] : []),
78 ...(input.interactionMode === "plan" ? ["Plan"] : []),
79 ].join(" · ");
81​
82function selectableChoices(descriptor: Extract<ProviderOptionDescriptor, { type: "select" }>) {
83 const injected = new Set(descriptor.promptInjectedValues ?? []);
84 return descriptor.options.filter(
85 (option) => !injected.has(option.id) && !HIDDEN_EFFORT_OPTION_IDS.has(option.id),
86 );
88​
89function ModelRow(props: {
90 readonly option: ModelOption;
91 readonly selected: boolean;
92 readonly onPress: () => void;
93}) {
94 const primaryFg = useThemeColor("--color-primary-foreground");
95 return (
96 <Pressable
97 accessibilityRole="button"
98 accessibilityState={{ selected: props.selected }}
99 onPress={props.onPress}
100 // Selected rows get the same primary treatment as the submenu rows.
101 // Subtle backgrounds (bg-subtle-strong) get overridden by the OS
102 // selection chrome on iOS 26, so use the explicit high-contrast style
103 // everywhere instead.
104 className={cn(
105 "mx-2.5 flex-row items-center gap-2 rounded-xl px-3 py-3.5 active:opacity-70",
106 props.selected ? "bg-primary" : "bg-transparent",
107 )}
108 >
109 <Text
110 className={cn(
111 "shrink text-sm font-t3-medium",
112 props.selected ? "text-primary-foreground" : "text-foreground",
113 )}
114 numberOfLines={1}
115 >
116 {props.option.label}
117 </Text>
118 {props.option.isDefault ? (
119 <View className="rounded-md bg-subtle-strong px-1.5 py-0.5">
120 <Text className="text-3xs font-t3-bold text-foreground-muted">Default</Text>
121 </View>
122 ) : null}
123 {props.option.isLegacy ? (
124 <View className="rounded-md bg-subtle px-1.5 py-0.5">
125 <Text className="text-3xs font-t3-bold text-foreground-muted">Legacy</Text>
126 </View>
127 ) : null}
128 <View className="flex-1" />
129 {props.selected ? (
130 <SymbolView name="checkmark" size={14} tintColor={primaryFg} type="monochrome" />
131 ) : null}
132 </Pressable>
133 );
135​
136/**
137 * Provider section header with the harness logo. Secondary providers render
138 * as a tappable fold (count + chevron while collapsed); primary providers
139 * and the group holding the current selection are static headers.
140 */
141function ProviderHeader(props: {
142 readonly driver: string | undefined;
143 readonly label: string;
144 readonly collapsible: boolean;
145 readonly collapsed: boolean;
146 readonly modelCount: number;
147 readonly onToggle: () => void;
148}) {
149 const iconSubtle = useThemeColor("--color-icon-subtle");
150 return (
151 <Pressable
152 accessibilityRole={props.collapsible ? "button" : "header"}
153 accessibilityState={props.collapsible ? { expanded: !props.collapsed } : undefined}
154 accessibilityLabel={
155 props.collapsible ? `${props.label}, ${props.modelCount} models` : props.label
156 }
157 disabled={!props.collapsible}
158 onPress={props.onToggle}
159 className={cn(
160 "mx-2.5 flex-row items-center gap-2 rounded-xl px-3",
161 props.collapsible ? "py-3.5 active:opacity-70" : "pb-2 pt-4",
162 )}
163 >
164 <ProviderIcon provider={props.driver} size={15} />
165 <Text className="text-2xs font-t3-bold uppercase tracking-widest text-foreground-muted">
166 {props.label}
167 </Text>
168 {props.collapsible ? (
169 <>
170 <View className="flex-1" />
171 {props.collapsed ? (
172 <Text className="text-2xs font-t3-medium text-foreground-muted">
173 {props.modelCount}
174 </Text>
175 ) : null}
176 <SymbolView
177 name={props.collapsed ? "chevron.down" : "chevron.up"}
178 size={11}
179 tintColor={iconSubtle}
180 type="monochrome"
181 />
182 </>
183 ) : null}
184 </Pressable>
185 );
187​
188/** Compact row that opens a single-choice submenu panel. */
189function DisclosureRow(props: {
190 readonly label: string;
191 readonly value: string | undefined;
192 readonly disabled?: boolean;
193 readonly onPress: () => void;
194}) {
195 const iconSubtle = useThemeColor("--color-icon-subtle");
196 return (
197 <Pressable
198 accessibilityRole="button"
199 disabled={props.disabled}
200 onPress={props.onPress}
201 className={cn(
202 "flex-row items-center gap-2 px-5 py-3 active:opacity-70",
203 props.disabled && "opacity-40",
204 )}
205 >
206 <Text className="text-sm font-t3-medium text-foreground">{props.label}</Text>
207 <View className="flex-1" />
208 {props.value ? (
209 <Text className="text-sm text-foreground-muted" numberOfLines={1}>
210 {props.value}
211 </Text>
212 ) : null}
213 <SymbolView name="chevron.right" size={12} tintColor={iconSubtle} type="monochrome" />
214 </Pressable>
215 );
217​
218/** Single option inside a submenu panel. */
219function ChoiceRow(props: {
220 readonly label: string;
221 readonly selected: boolean;
222 readonly onPress: () => void;
223}) {
224 const primaryFg = useThemeColor("--color-primary-foreground");
225 return (
226 <Pressable
227 accessibilityRole="button"
228 accessibilityState={{ selected: props.selected }}
229 onPress={props.onPress}
230 className={cn(
231 "mx-2.5 flex-row items-center rounded-xl px-3 py-3.5 active:opacity-70",
232 props.selected ? "bg-primary" : "bg-transparent",
233 )}
234 >
235 <Text
236 className={cn(
237 "shrink text-sm font-t3-medium",
238 props.selected ? "text-primary-foreground" : "text-foreground",
239 )}
240 >
241 {props.label}
242 </Text>
243 <View className="flex-1" />
244 {props.selected ? (
245 <SymbolView name="checkmark" size={14} tintColor={primaryFg} type="monochrome" />
246 ) : null}
247 </Pressable>
248 );
250​
251function SwitchRow(props: {
252 readonly label: string;
253 readonly value: boolean;
254 readonly disabled?: boolean;
255 readonly onValueChange: (value: boolean) => void;
256}) {
257 const activeTrack = String(useThemeColor("--color-switch-active"));
258 const track = String(useThemeColor("--color-secondary-border"));
259 return (
260 <View
261 className={cn(
262 "flex-row items-center justify-between px-5 py-2.5",
263 props.disabled && "opacity-40",
264 )}
265 >
266 <Text className="text-sm font-t3-medium text-foreground">{props.label}</Text>
267 <Switch
268 disabled={props.disabled}
269 ios_backgroundColor={track}
270 onValueChange={props.onValueChange}
271 trackColor={{ false: track, true: activeTrack }}
272 value={props.value}
273 />
274 </View>
275 );
277​
278type SubmenuPage =
279 | { readonly kind: "descriptor"; readonly id: string }
280 | { readonly kind: "runtime" };
281​
282/**
283 * Unified thread settings: the sheet is the provider-grouped model list
284 * (primary harnesses expanded, other providers folded, legacy behind the
285 * top-right pill) with a Save button, plus compact disclosure rows whose
286 * single-choice submenus stack in a small panel over the sheet so it never
287 * changes size. Model changes stage until Save — while staged, the settings
288 * rows edit the staged model's options and Save applies everything together.
289 *
290 * Callers control which harnesses are offered via providerGroups: an
291 * existing thread must pass only its own provider's group, since a session
292 * can't switch harness mid-thread.
293 *
294 * Rendered through an RN Modal (not the root OverlayPortal) so it also
295 * presents above natively-presented form sheets like the new-task draft.
296 * Callers must dismiss the keyboard when opening — the iOS keyboard window
297 * would otherwise cover the lower half of the sheet.
298 */
299export function ThreadSettingsSheet(props: {
300 readonly visible: boolean;
301 /**
302 * "save" = the Save/Done button (the user is finished configuring);
303 * "dismiss" = backdrop, grabber, or system back. Hosts only restore the
304 * keyboard for "save" so a stray tap outside a control never pops it.
305 */
306 readonly onClose: (reason: ThreadSettingsSheetCloseReason) => void;
307 readonly onDismissed: () => void;
308 readonly providerGroups: ReadonlyArray<ProviderGroup>;
309 readonly selectedModel: ModelSelection | null;
310 readonly onSelectModel: (option: ModelOption) => void;
311 readonly optionDescriptors: ReadonlyArray<ProviderOptionDescriptor>;
312 readonly onUpdateOptionSelections: (selections: ReadonlyArray<ProviderOptionSelection>) => void;
313 readonly runtimeMode: RuntimeMode;
314 readonly onUpdateRuntimeMode: (mode: RuntimeMode) => void;
315}) {
316 const insets = useSafeAreaInsets();
317 const { height: windowHeight } = useWindowDimensions();
318 const [showLegacyToggle, setShowLegacyToggle] = useState(false);
319 const [expandedProviders, setExpandedProviders] = useState<ReadonlySet<string>>(() => new Set());
320 const [pendingModel, setPendingModel] = useState<ModelOption | null>(null);
321 const [submenu, setSubmenu] = useState<SubmenuPage | null>(null);
322 const wasPresentedRef = useRef(false);
323 const notifyDismissed = useCallback(() => {
324 if (!wasPresentedRef.current) {
325 return;
326 }
327 wasPresentedRef.current = false;
328 props.onDismissed();
329 }, [props.onDismissed]);
330​
331 // Every open starts fresh: no staged model, no submenu, legacy hidden,
332 // secondary providers folded. The sheet stays mounted between opens, so
333 // state would otherwise stick around.
334 useEffect(() => {
335 if (props.visible) {
336 wasPresentedRef.current = true;
337 setShowLegacyToggle(false);
338 setExpandedProviders(new Set());
339 setPendingModel(null);
340 setSubmenu(null);
341 } else if (Platform.OS === "android" && wasPresentedRef.current) {
342 // React Native only emits Modal.onDismiss on iOS. Android uses no exit
343 // animation below, so the post-commit effect is its dismissal boundary.
344 notifyDismissed();
345 }
346 }, [notifyDismissed, props.visible]);
347​
348 const isApplied = (option: ModelOption) =>
349 option.selection.instanceId === props.selectedModel?.instanceId &&
350 option.selection.model === props.selectedModel.model;
351 // The list highlights the staged pick; Save turns it into the applied one.
352 const isDisplayed = (option: ModelOption) =>
353 pendingModel ? option.key === pendingModel.key : isApplied(option);
354​
355 // While a model is staged, the settings rows describe and edit the staged
356 // model's options (kept on its pending selection); Save applies model and
357 // options together. Otherwise they edit the applied selection directly.
358 const displayedDescriptors = pendingModel
359 ? pendingModel.capabilities
360 ? getProviderOptionDescriptors({
361 caps: pendingModel.capabilities,
362 selections: pendingModel.selection.options,
363 })
364 : []
365 : props.optionDescriptors;
366​
367 const hasLegacyModels = props.providerGroups.some((group) =>
368 group.models.some((model) => model.isLegacy),
369 );
370 // Legacy stays hidden unless the pill is toggled this open; a highlighted
371 // legacy model is exempted from the filter instead of forcing the whole
372 // legacy list visible.
373 const showLegacy = showLegacyToggle;
374​
375 // Stable settings rows: the union of descriptors across the primary
376 // harnesses' current models (plus whatever the displayed model advertises)
377 // always renders, with unsupported rows disabled instead of vanishing when
378 // the selection changes. Keyed by label, not id — Claude and Codex use
379 // different ids for the same "Reasoning" concept.
380 const descriptorTemplate = (() => {
381 const seen = new Map<string, { type: "select" | "boolean" }>();
382 for (const group of props.providerGroups) {
383 const driver = group.models[0]?.providerDriver;
384 if (driver === undefined || !PRIMARY_PROVIDER_DRIVERS.has(driver)) {
385 continue;
386 }
387 for (const model of group.models) {
388 if (model.isLegacy) {
389 continue;
390 }
391 for (const descriptor of model.capabilities?.optionDescriptors ?? []) {
392 if (!seen.has(descriptor.label)) {
393 seen.set(descriptor.label, { type: descriptor.type });
394 }
395 }
396 }
397 }
398 for (const descriptor of displayedDescriptors) {
399 if (!seen.has(descriptor.label)) {
400 seen.set(descriptor.label, { type: descriptor.type });
401 }
402 }
403 return [...seen.entries()].map(([label, entry]) => ({ label, ...entry }));
404 })();
405​
406 const handleSave = () => {
407 if (pendingModel) {
408 void Haptics.selectionAsync();
409 props.onSelectModel(pendingModel);
410 }
411 props.onClose("save");
412 };
413​
414 const handleOptionChange = (id: string, value: string | boolean) => {
415 const next = applyProviderOptionSelection(displayedDescriptors, { id, value });
416 if (!next) {
417 return;
418 }
419 if (pendingModel) {
420 setPendingModel({
421 ...pendingModel,
422 selection: { ...pendingModel.selection, options: next },
423 });
424 } else {
425 props.onUpdateOptionSelections(next);
426 }
427 };
428​
429 const toggleProvider = (providerKey: string) => {
430 setExpandedProviders((current) => {
431 const next = new Set(current);
432 if (!next.delete(providerKey)) {
433 next.add(providerKey);
434 }
435 return next;
436 });
437 };
438​
439 const activeDescriptor =
440 submenu?.kind === "descriptor"
441 ? displayedDescriptors.find(
442 (descriptor) => descriptor.type === "select" && descriptor.id === submenu.id,
443 )
444 : undefined;
445​
446 const submenuContent =
447 submenu?.kind === "runtime"
448 ? {
449 title: "Runtime",
450 rows: RUNTIME_MODE_CHOICES.map((choice) => ({
451 id: choice.mode,
452 label: choice.label,
453 selected: choice.mode === props.runtimeMode,
454 onPress: () => {
455 void Haptics.selectionAsync();
456 props.onUpdateRuntimeMode(choice.mode);
457 setSubmenu(null);
458 },
459 })),
460 }
461 : activeDescriptor?.type === "select"
462 ? {
463 title: activeDescriptor.label,
464 rows: selectableChoices(activeDescriptor).map((choice) => ({
465 id: choice.id,
466 label: choice.label,
467 selected: choice.id === getProviderOptionCurrentValue(activeDescriptor),
468 onPress: () => {
469 void Haptics.selectionAsync();
470 handleOptionChange(activeDescriptor.id, choice.id);
471 setSubmenu(null);
472 },
473 })),
474 }
475 : null;
476​
477 return (
478 <Modal
479 transparent
480 statusBarTranslucent
481 navigationBarTranslucent
482 animationType={Platform.OS === "ios" ? "fade" : "none"}
483 visible={props.visible}
484 onDismiss={notifyDismissed}
485 onRequestClose={submenuContent ? () => setSubmenu(null) : () => props.onClose("dismiss")}
486 >
487 <View className="flex-1 justify-end">
488 <Pressable
489 accessibilityLabel="Close thread settings"
490 className="absolute inset-0 bg-backdrop"
491 onPress={() => props.onClose("dismiss")}
492 />
493 <View
494 className="overflow-hidden rounded-t-[24px] border border-b-0 border-border bg-sheet"
495 style={{ maxHeight: windowHeight * 0.85 }}
496 >
497 {/* The grabber doubles as the accessible close control: the dim
498 backdrop above a tall sheet is a sliver, and VoiceOver can't
499 reach it at all. */}
500 <Pressable
501 accessibilityLabel="Close thread settings"
502 accessibilityRole="button"
503 onPress={() => props.onClose("dismiss")}
504 className="items-center pb-1 pt-2.5"
505 >
506 <View className="h-1 w-9 rounded-full bg-subtle-strong" />
507 </Pressable>
508 {hasLegacyModels ? (
509 <View className="flex-row justify-end px-4 pb-1.5">
510 <Pressable
511 accessibilityRole="button"
512 accessibilityState={{ selected: showLegacy }}
513 hitSlop={8}
514 onPress={() => {
515 void Haptics.selectionAsync();
516 setShowLegacyToggle(!showLegacy);
517 }}
518 className="rounded-full border border-border bg-subtle px-3 py-1.5 active:opacity-70"
519 >
520 <Text className="text-2xs font-t3-medium text-foreground-muted">
521 {showLegacy ? "Hide legacy models" : "Show legacy models"}
522 </Text>
523 </Pressable>
524 </View>
525 ) : null}
526 {/* Only the model list scrolls. Provider catalogs can run to
527 hundreds of models (OpenRouter), so the rows below stay pinned
528 and reachable instead of living at the end of that scroll. */}
529 <ScrollView
530 style={{ flexShrink: 1 }}
531 contentContainerStyle={{ paddingBottom: 8 }}
532 showsVerticalScrollIndicator={false}
533 >
534 {props.providerGroups.map((group) => {
535 const driver = group.models[0]?.providerDriver;
536 const isPrimary = driver !== undefined && PRIMARY_PROVIDER_DRIVERS.has(driver);
537 const visibleModels = showLegacy
538 ? group.models
539 : group.models.filter((model) => !model.isLegacy || isDisplayed(model));
540 if (visibleModels.length === 0) {
541 return null;
542 }
543 const containsSelection = group.models.some(isDisplayed);
544 const collapsible = !isPrimary && !containsSelection;
545 const collapsed = collapsible && !expandedProviders.has(group.providerKey);
546 return (
547 <View key={group.providerKey}>
548 <ProviderHeader
549 driver={driver}
550 label={group.providerLabel}
551 collapsible={collapsible}
552 collapsed={collapsed}
553 modelCount={visibleModels.length}
554 onToggle={() => toggleProvider(group.providerKey)}
555 />
556 {collapsed
557 ? null
558 : visibleModels.map((option) => (
559 <ModelRow
560 key={option.key}
561 option={option}
562 selected={isDisplayed(option)}
563 onPress={() => {
564 void Haptics.selectionAsync();
565 // Re-tapping the applied model cancels staging.
566 setPendingModel((current) =>
567 pendingModelAfterPress({
568 current,
569 pressed: option,
570 pressedIsApplied: isApplied(option),
571 }),
572 );
573 }}
574 />
575 ))}
576 </View>
577 );
578 })}
579 </ScrollView>
580​
581 <View className="mx-5 h-px bg-border" />
582​
583 <View style={{ paddingBottom: insets.bottom + 12 }}>
584 {descriptorTemplate.map((entry) => {
585 const live = displayedDescriptors.find(
586 (descriptor) => descriptor.label === entry.label,
587 );
588 if ((live?.type ?? entry.type) === "select") {
589 return (
590 <DisclosureRow
591 key={entry.label}
592 label={entry.label}
593 value={live ? getProviderOptionCurrentLabel(live) : undefined}
594 disabled={!live}
595 onPress={() => {
596 if (live) {
597 setSubmenu({ kind: "descriptor", id: live.id });
598 }
599 }}
600 />
601 );
602 }
603 return (
604 <SwitchRow
605 key={entry.label}
606 label={entry.label}
607 value={live?.type === "boolean" ? (live.currentValue ?? false) : false}
608 disabled={!live}
609 onValueChange={(value) => {
610 if (live) {
611 handleOptionChange(live.id, value);
612 }
613 }}
614 />
615 );
616 })}
617 <DisclosureRow
618 label="Runtime"
619 value={
620 RUNTIME_MODE_CHOICES.find((choice) => choice.mode === props.runtimeMode)?.label
621 }
622 onPress={() => setSubmenu({ kind: "runtime" })}
623 />
624 <Pressable
625 accessibilityRole="button"
626 onPress={handleSave}
627 className="mx-4 mt-2 h-12 items-center justify-center rounded-full bg-primary active:opacity-80"
628 >
629 <Text className="text-sm font-t3-bold text-primary-foreground">
630 {pendingModel ? "Save" : "Done"}
631 </Text>
632 </Pressable>
633 </View>
634 </View>
635​
636 {/* Submenus stack over the sheet instead of replacing its content,
637 so the main sheet keeps its size while drilling in and out. */}
638 {submenuContent ? (
639 <View className="absolute inset-0 justify-end">
640 <Pressable
641 accessibilityLabel={`Close ${submenuContent.title}`}
642 className="absolute inset-0 bg-backdrop"
643 onPress={() => setSubmenu(null)}
644 />
645 <View className="overflow-hidden rounded-t-[24px] border border-b-0 border-border bg-sheet">
646 <Pressable
647 accessibilityLabel={`Close ${submenuContent.title}`}
648 accessibilityRole="button"
649 onPress={() => setSubmenu(null)}
650 className="items-center pb-1 pt-2.5"
651 >
652 <View className="h-1 w-9 rounded-full bg-subtle-strong" />
653 </Pressable>
654 <Text className="px-5 pb-1.5 text-2xs font-t3-bold uppercase tracking-widest text-foreground-muted">
655 {submenuContent.title}
656 </Text>
657 <ScrollView
658 style={{ maxHeight: windowHeight * 0.5 }}
659 contentContainerStyle={{ paddingBottom: insets.bottom + 12 }}
660 showsVerticalScrollIndicator={false}
661 bounces={false}
662 >
663 {submenuContent.rows.map((row) => (
664 <ChoiceRow
665 key={row.id}
666 label={row.label}
667 selected={row.selected}
668 onPress={row.onPress}
669 />
670 ))}
671 </ScrollView>
672 </View>
673 </View>
674 ) : null}
675 </View>
676 </Modal>
677 );