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

ThreadQueueControl.tsx

641 lines25.4 KB

1import { type StaticScreenProps, useNavigation } from "@react-navigation/native";
2import { useAtomValue } from "@effect/atom-react";
3import type { ChatAttachment, EnvironmentId, RunId, ThreadId } from "@t3tools/contracts";
4import { Atom } from "effect/reactivity";
5import { Image } from "expo-image";
6import * as Haptics from "expo-haptics";
7import { useEffect, useEffectEvent, useRef, useState } from "react";
8import { Animated, Platform, Pressable, ScrollView, View } from "react-native";
9import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
10import ReanimatedSwipeable, {
11 type SwipeableMethods,
12} from "react-native-gesture-handler/ReanimatedSwipeable";
13import { Screen, ScreenStack, ScreenStackHeaderConfig } from "react-native-screens";
14import { useSafeAreaInsets } from "react-native-safe-area-context";
15import Reanimated, { ReduceMotion, useAnimatedStyle, withTiming } from "react-native-reanimated";
16​
17import { Button } from "../../components/ui/Button";
18import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";
19import { AppText as Text } from "../../components/ui/AppText";
20import { SymbolView } from "../../components/ui/AppSymbol";
21import { Menu } from "../../components/ui/Menu";
22import { ScreenContent } from "../../components/ui/ScreenContent";
23import { scopedThreadKey } from "../../lib/scopedEntities";
24import { useUniwindTheme } from "../../lib/useUniwindTheme";
25import { NativeStackScreenOptions, nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
26import { useAssetUrl } from "../../state/assets";
27import { assetImageSource } from "../../lib/assetImageSource";
28import { beginQueuedRunEdit, useQueuedRunEdit } from "../../state/queued-run-edit";
29import { environmentThreadDetails, threadEnvironment } from "../../state/threads";
30import { useAtomCommand } from "../../state/use-atom-command";
31import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
32import {
33 REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL,
34 buildCancelQueuedRunCommand,
35 resolveQueueDragBeforeRunId,
36 resolveQueueDropBeforeRunId,
37 resolveThreadQueueRowControls,
38} from "./threadQueueControlPresentation";
39import { threadDragGapOffset } from "./threadDragGap";
40​
41const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
42const REMOVE_ACTION_WIDTH = 76;
43const THUMBNAIL_LIMIT = 3;
44const EMPTY_QUEUED_COUNT_ATOM = Atom.make(0).pipe(
45 Atom.withLabel("mobile-thread-queue-count:empty"),
46);
47​
48type QueueTarget = { readonly environmentId: EnvironmentId; readonly threadId: ThreadId };
49type QueueAction = "steer" | "edit" | "up" | "down" | "remove";
50type QueueRowLayout = { readonly id: RunId; readonly y?: number; readonly height?: number };
51​
52export function useThreadQueueWorkflow(target: QueueTarget) {
53 return useAtomValue(environmentThreadDetails.queueWorkflowAtom(target));
55​
56export function useThreadQueuedCount(target: QueueTarget | null) {
57 return useAtomValue(
58 target === null ? EMPTY_QUEUED_COUNT_ATOM : environmentThreadDetails.queuedCountAtom(target),
59 );
61​
62export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
63 const { layout } = useAdaptiveWorkspaceLayout();
64 const target = route.params;
65 const navigation = useNavigation();
66 const insets = useSafeAreaInsets();
67 const theme = useUniwindTheme();
68 const workflow = useThreadQueueWorkflow(target);
69 const threadKey = scopedThreadKey(target.environmentId, target.threadId);
70 const editing = useQueuedRunEdit(threadKey);
71 const reorder = useAtomCommand(threadEnvironment.reorderQueuedRun, "reorder queued message");
72 const promote = useAtomCommand(threadEnvironment.promoteQueuedRun, "promote queued message");
73 const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun, "remove queued message");
74 const resume = useAtomCommand(threadEnvironment.resumeThreadQueue, "resume queue");
75 const [resuming, setResuming] = useState(false);
76 const [busyRunId, setBusyRunId] = useState<RunId | null>(null);
77 const busyRef = useRef(false);
78 const [draggedRunId, setDraggedRunId] = useState<RunId | null>(null);
79 const [previewBeforeRunId, setPreviewBeforeRunId] = useState<RunId | null | undefined>();
80 const [dragRows, setDragRows] = useState<ReadonlyArray<QueueRowLayout> | null>(null);
81 const rowLayouts = useRef(new Map<RunId, { y: number; height: number }>());
82 const drag = useRef<{
83 runId: RunId;
84 order: string;
85 beforeRunId: RunId | null | undefined;
86 rows: ReadonlyArray<QueueRowLayout>;
87 } | null>(null);
88 const [translation] = useState(() => new Animated.Value(0));
89 const queuedRuns = workflow?.queuedRuns ?? [];
90 const order = queuedRuns.map(({ run }) => run.id).join(",");
91​
92 useEffect(() => {
93 if (drag.current && drag.current.order !== order) {
94 drag.current = null;
95 setDraggedRunId(null);
96 setPreviewBeforeRunId(undefined);
97 setDragRows(null);
98 translation.setValue(0);
99 }
100 }, [order, translation]);
101​
102 const hadQueuedRuns = useRef(queuedRuns.length > 0);
103 useEffect(() => {
104 if (queuedRuns.length > 0) {
105 hadQueuedRuns.current = true;
106 return;
107 }
108 if (hadQueuedRuns.current) navigation.goBack();
109 }, [navigation, queuedRuns.length]);
110​
111 const move = async (runId: RunId, beforeRunId: RunId | null) => {
112 if (busyRef.current || !workflow?.canReorder) return;
113 busyRef.current = true;
114 setBusyRunId(runId);
115 void Haptics.selectionAsync();
116 await reorder({ ...target, input: { threadId: target.threadId, runId, beforeRunId } });
117 busyRef.current = false;
118 setBusyRunId(null);
119 };
120​
121 const act = async (runId: RunId, action: QueueAction) => {
122 if (busyRef.current) return;
123 const index = queuedRuns.findIndex(({ run }) => run.id === runId);
124 if (index < 0) return;
125 if (action === "up" && index > 0) {
126 await move(runId, queuedRuns[index - 1]!.run.id);
127 return;
128 }
129 if (action === "down" && index < queuedRuns.length - 1) {
130 await move(runId, queuedRuns[index + 2]?.run.id ?? null);
131 return;
132 }
133 if (action === "edit") {
134 const entry = queuedRuns[index]!;
135 void Haptics.selectionAsync();
136 beginQueuedRunEdit(threadKey, {
137 runId,
138 messageId: entry.messageId,
139 originalText: entry.text,
140 existingAttachments: entry.attachments,
141 ...(entry.context ? { context: entry.context } : {}),
142 });
143 navigation.goBack();
144 return;
145 }
146 if (action !== "steer" && action !== "remove") return;
147 busyRef.current = true;
148 setBusyRunId(runId);
149 void Haptics.selectionAsync();
150 if (action === "remove") {
151 await cancel(buildCancelQueuedRunCommand({ ...target, runId }));
152 } else if (workflow?.canSendNow) {
153 await resume({ ...target, input: { threadId: target.threadId, runId } });
154 } else if (workflow?.activeRun && workflow.canPromoteToSteer) {
155 await promote({
156 ...target,
157 input: {
158 threadId: target.threadId,
159 queuedRunId: runId,
160 targetRunId: workflow.activeRun.id,
161 },
162 });
163 }
164 busyRef.current = false;
165 setBusyRunId(null);
166 };
167​
168 const canReorder = workflow?.canReorder === true && queuedRuns.length > 1;
169 const sourceLayout = dragRows?.find((row) => row.id === draggedRunId);
170 const lastLayout = dragRows?.at(-1);
171 const insertionOffset =
172 previewBeforeRunId === undefined
173 ? undefined
174 : previewBeforeRunId === null
175 ? lastLayout?.y === undefined || lastLayout.height === undefined
176 ? undefined
177 : lastLayout.y + lastLayout.height
178 : dragRows?.find((row) => row.id === previewBeforeRunId)?.y;
179 const queueRows = () =>
180 queuedRuns.map(({ run }) => ({ id: run.id, ...rowLayouts.current.get(run.id) }));
181 const content = (
182 <ScrollView
183 nestedScrollEnabled
184 className="flex-1"
185 scrollEnabled={draggedRunId === null}
186 // UIKit must inset content beneath the floating translucent iOS header.
187 contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
188 contentContainerClassName="px-5 pb-6"
189 contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 16) + 8 }}
190 >
191 {workflow?.isHeld && queuedRuns.length > 0 ? (
192 <View className="gap-2 py-3">
193 <Text className="text-sm text-foreground-muted">Queue paused</Text>
194 <Button
195 label="Resume queue"
196 disabled={resuming || busyRunId !== null}
197 onPress={async () => {
198 if (busyRef.current) return;
199 busyRef.current = true;
200 setResuming(true);
201 await resume({ ...target, input: { threadId: target.threadId } });
202 busyRef.current = false;
203 setResuming(false);
204 }}
205 />
206 </View>
207 ) : null}
208 {queuedRuns.length === 0 ? (
209 <Text className="pt-6 text-center text-sm text-foreground-muted">
210 No messages waiting in this queue.
211 </Text>
212 ) : null}
213 {queuedRuns.map(({ run, text, attachments, context }, index) => {
214 const layout = dragRows?.find((row) => row.id === run.id);
215 const offset =
216 sourceLayout?.y !== undefined &&
217 sourceLayout.height !== undefined &&
218 layout?.y !== undefined &&
219 insertionOffset !== undefined
220 ? threadDragGapOffset(layout.y, sourceLayout.y, sourceLayout.height, insertionOffset)
221 : 0;
222 const controls = resolveThreadQueueRowControls({
223 busy: busyRunId !== null || draggedRunId !== null,
224 canPromoteToSteer: workflow?.canPromoteToSteer ?? false,
225 canSendNow: workflow?.canSendNow ?? false,
226 canReorder: workflow?.canReorder ?? false,
227 index,
228 isEditing: editing?.runId === run.id,
229 isGuestMessage: context?.guest !== undefined,
230 queuedCount: queuedRuns.length,
231 text,
232 });
233 const title =
234 controls.displayText || (attachments.length > 0 ? "Attachments" : "Queued message");
235 return (
236 <QueueShiftedRow
237 key={run.id}
238 offset={offset}
239 dragging={draggedRunId !== null}
240 lifted={draggedRunId === run.id}
241 onLayout={({ nativeEvent }) => rowLayouts.current.set(run.id, nativeEvent.layout)}
242 >
243 <Animated.View
244 className="flex-row items-center border-b border-border bg-sheet"
245 style={
246 draggedRunId === run.id
247 ? { transform: [{ translateY: translation }], zIndex: 1, opacity: 0.85 }
248 : undefined
249 }
250 >
251 {canReorder ? (
252 // Keep the vertical handle outside the sideways swipeable so their pans do not race.
253 <QueueDragHandle
254 disabled={busyRunId !== null}
255 title={title}
256 canMoveUp={controls.canMoveUp}
257 canMoveDown={controls.canMoveDown}
258 onStep={(action) => void act(run.id, action)}
259 onStart={() => {
260 const rows = queueRows();
261 const beforeRunId = resolveQueueDragBeforeRunId(rows, run.id, 0);
262 drag.current = { runId: run.id, order, beforeRunId, rows };
263 translation.setValue(0);
264 setDragRows(rows);
265 setPreviewBeforeRunId(beforeRunId);
266 setDraggedRunId(run.id);
267 void Haptics.selectionAsync();
268 }}
269 onMove={(y) => {
270 const current = drag.current;
271 if (current?.runId !== run.id || current.order !== order) return;
272 translation.setValue(y);
273 const before = resolveQueueDragBeforeRunId(current.rows, run.id, y);
274 if (current.beforeRunId !== before) {
275 current.beforeRunId = before;
276 setPreviewBeforeRunId(before);
277 }
278 }}
279 onEnd={(y, success) => {
280 const started = drag.current;
281 const stop = () => {
282 if (drag.current !== started) return;
283 drag.current = null;
284 setDraggedRunId(null);
285 setPreviewBeforeRunId(undefined);
286 setDragRows(null);
287 translation.setValue(0);
288 };
289 if (!success || started?.order !== order || started.runId !== run.id) {
290 stop();
291 return;
292 }
293 const before = resolveQueueDropBeforeRunId(started.rows, run.id, y);
294 if (before === undefined) {
295 stop();
296 return;
297 }
298 const source = started.rows.find((row) => row.id === run.id);
299 const tail = started.rows.at(-1);
300 const insertion =
301 before === null
302 ? tail?.y !== undefined && tail.height !== undefined
303 ? tail.y + tail.height
304 : undefined
305 : started.rows.find((row) => row.id === before)?.y;
306 if (
307 source?.y !== undefined &&
308 source.height !== undefined &&
309 insertion !== undefined
310 ) {
311 Animated.timing(translation, {
312 toValue: insertion - source.y - (insertion > source.y ? source.height : 0),
313 duration: 160,
314 useNativeDriver: true,
315 }).start();
316 }
317 setPreviewBeforeRunId(before);
318 void move(run.id, before).finally(stop);
319 }}
320 />
321 ) : null}
322 <QueueRowSwipeable
323 enabled={draggedRunId === null && busyRunId === null && controls.canDismiss}
324 background={theme["--color-sheet"]}
325 onRemove={() => void act(run.id, "remove")}
326 >
327 <Menu
328 accessibilityLabel={`Actions for queued message ${index + 1}`}
329 shouldOpenOnLongPress
330 actions={[
331 ...(workflow?.canPromoteToSteer || workflow?.canSendNow
332 ? [
333 {
334 id: "steer",
335 title: workflow?.canSendNow ? "Send now" : "Steer now",
336 attributes: { disabled: !controls.canSend },
337 image: Platform.OS === "ios" ? "arrow.turn.left.up" : "arrow_upward",
338 },
339 ]
340 : []),
341 {
342 id: "edit",
343 title: "Edit",
344 attributes: { disabled: !controls.canEdit },
345 image: Platform.OS === "ios" ? "pencil" : "edit",
346 },
347 { id: "up", title: "Move up", attributes: { disabled: !controls.canMoveUp } },
348 {
349 id: "down",
350 title: "Move down",
351 attributes: { disabled: !controls.canMoveDown },
352 },
353 {
354 id: "remove",
355 title: "Remove",
356 attributes: { disabled: !controls.canDismiss, destructive: true },
357 },
358 ]}
359 onPressAction={({ nativeEvent }) =>
360 void act(run.id, nativeEvent.event as QueueAction)
361 }
362 >
363 <Pressable
364 accessibilityRole="button"
365 accessibilityLabel={title}
366 accessibilityHint={
367 controls.canEdit
368 ? "Opens this message in the composer for editing"
369 : undefined
370 }
371 disabled={!controls.canEdit}
372 onPress={() => void act(run.id, "edit")}
373 className="min-h-14 flex-row items-center gap-2.5 py-2.5 active:opacity-70"
374 >
375 <QueueAttachmentThumbnails
376 environmentId={target.environmentId}
377 attachments={attachments}
378 />
379 <Text
380 className={
381 controls.isEditing
382 ? "min-w-0 flex-1 text-sm text-foreground-muted"
383 : "min-w-0 flex-1 text-sm text-foreground"
384 }
385 numberOfLines={1}
386 >
387 {context?.guest === undefined ? null : (
388 <Text className="font-t3-medium text-adaptive-fuchsia-600-300">
389 {`${context.guest.name} `}
390 </Text>
391 )}
392 {title}
393 </Text>
394 {controls.isEditing ? (
395 <Text className="shrink-0 text-2xs uppercase tracking-wide text-primary">
396 Editing
397 </Text>
398 ) : null}
399 {workflow?.canPromoteToSteer || workflow?.canSendNow ? (
400 <Pressable
401 accessibilityRole="button"
402 accessibilityLabel={
403 workflow?.canSendNow
404 ? `Send message ${index + 1} now`
405 : `Steer with message ${index + 1} now`
406 }
407 disabled={!controls.canSend}
408 onPress={() => void act(run.id, "steer")}
409 className="h-8 shrink-0 justify-center rounded-full bg-primary px-3 active:opacity-70 disabled:opacity-40"
410 >
411 <Text className="font-t3-medium text-xs text-primary-foreground">
412 {workflow?.canSendNow ? "Send now" : "Steer"}
413 </Text>
414 </Pressable>
415 ) : null}
416 </Pressable>
417 </Menu>
418 </QueueRowSwipeable>
419 </Animated.View>
420 </QueueShiftedRow>
421 );
422 })}
423 </ScrollView>
424 );
425​
426 if (Platform.OS === "ios") {
427 // Plain formSheets lack stack headers; host one in a nested native stack.
428 return (
429 <GestureHandlerRootView style={{ flex: 1 }}>
430 <View collapsable={false} className="flex-1 bg-sheet">
431 <ScreenStack style={{ flex: 1 }}>
432 <Screen
433 activityState={2}
434 enabled
435 isNativeStack
436 screenId="thread-queue-sheet-native"
437 scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
438 style={{ backgroundColor: theme["--color-sheet"], flex: 1 }}
439 >
440 {content}
441 <ScreenStackHeaderConfig
442 backgroundColor="rgba(0,0,0,0)"
443 color={theme["--color-foreground"]}
444 hideBackButton
445 hideShadow={false}
446 title="Queued"
447 titleColor={theme["--color-foreground"]}
448 titleFontSize={18}
449 titleFontWeight="800"
450 translucent
451 />
452 </Screen>
453 </ScreenStack>
454 </View>
455 </GestureHandlerRootView>
456 );
457 }
458​
459 return (
460 <GestureHandlerRootView style={{ flex: 1 }}>
461 <View collapsable={false} className="flex-1 bg-sheet">
462 <NativeStackScreenOptions options={{ sheetCornerRadius: 28 }} />
463 <AndroidSheetHeader title="Queued" onBack={() => navigation.goBack()} />
464 <ScreenContent insetHorizontal={layout.usesSplitView}>{content}</ScreenContent>
465 </View>
466 </GestureHandlerRootView>
467 );
469​
470function QueueShiftedRow(props: {
471 readonly offset: number;
472 readonly dragging: boolean;
473 readonly lifted: boolean;
474 readonly onLayout: React.ComponentProps<typeof View>["onLayout"];
475 readonly children: React.ReactNode;
476}) {
477 const { dragging, offset } = props;
478 const style = useAnimatedStyle(() => ({
479 transform: [
480 {
481 translateY: dragging
482 ? withTiming(offset, { duration: 160, reduceMotion: ReduceMotion.System })
483 : offset,
484 },
485 ],
486 }));
487 return (
488 <Reanimated.View onLayout={props.onLayout} style={[style, { zIndex: props.lifted ? 1 : 0 }]}>
489 {props.children}
490 </Reanimated.View>
491 );
493​
494function QueueRowSwipeable(props: {
495 readonly enabled: boolean;
496 readonly background: string;
497 readonly onRemove: () => void;
498 readonly children: React.ReactNode;
499}) {
500 const swipeableRef = useRef<SwipeableMethods | null>(null);
501 return (
502 <ReanimatedSwipeable
503 ref={swipeableRef}
504 enabled={props.enabled}
505 friction={2}
506 rightThreshold={40}
507 overshootRight={false}
508 // Require a clearly sideways swipe to avoid competing with sheet scroll and drag handles.
509 failOffsetY={[-12, 12]}
510 containerStyle={{ backgroundColor: props.background, flex: 1 }}
511 childrenContainerStyle={{ backgroundColor: props.background }}
512 onSwipeableOpen={(direction) => {
513 if (direction !== "right") return;
514 swipeableRef.current?.close();
515 props.onRemove();
516 }}
517 renderRightActions={() => (
518 <Pressable
519 accessibilityRole="button"
520 accessibilityLabel={REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL}
521 disabled={!props.enabled}
522 onPress={() => {
523 swipeableRef.current?.close();
524 props.onRemove();
525 }}
526 className="items-center justify-center bg-danger active:opacity-70 disabled:opacity-40"
527 style={{ width: REMOVE_ACTION_WIDTH }}
528 >
529 <SymbolView name="trash" size={16} tintColorClassName="accent-danger-foreground" />
530 <Text className="pt-1 text-2xs font-t3-medium text-danger-foreground">Remove</Text>
531 </Pressable>
532 )}
533 >
534 {props.children}
535 </ReanimatedSwipeable>
536 );
538​
539function QueueAttachmentThumbnails(props: {
540 readonly environmentId: EnvironmentId;
541 readonly attachments: ReadonlyArray<ChatAttachment>;
542}) {
543 const images = props.attachments.filter((attachment) => attachment.mimeType.startsWith("image/"));
544 const shown = images.slice(0, THUMBNAIL_LIMIT);
545 const overflow = props.attachments.length - shown.length;
546 if (props.attachments.length === 0) return null;
547 return (
548 <View className="shrink-0 flex-row items-center gap-1">
549 {shown.map((attachment) => (
550 <QueueAttachmentThumbnail
551 key={attachment.id}
552 environmentId={props.environmentId}
553 attachment={attachment}
554 />
555 ))}
556 {overflow > 0 ? (
557 <View className="h-6 min-w-6 items-center justify-center rounded bg-subtle px-1">
558 <Text className="text-2xs tabular-nums text-foreground-muted">
559 {shown.length === 0 ? `${overflow}` : `+${overflow}`}
560 </Text>
561 </View>
562 ) : null}
563 </View>
564 );
566​
567function QueueAttachmentThumbnail(props: {
568 readonly environmentId: EnvironmentId;
569 readonly attachment: ChatAttachment;
570}) {
571 const resource = {
572 _tag: "attachment",
573 attachmentId: props.attachment.id,
574 fileName: props.attachment.name,
575 mimeType: props.attachment.mimeType,
576 disposition: "inline",
577 } as const;
578 const url = useAssetUrl(props.environmentId, resource);
579 if (url === null) {
580 return <View className="h-6 w-6 rounded bg-subtle" />;
581 }
582 return (
583 <Image
584 source={assetImageSource(props.environmentId, resource, url)}
585 cachePolicy="memory-disk"
586 contentFit="cover"
587 style={{ width: 24, height: 24, borderRadius: 4 }}
588 accessibilityIgnoresInvertColors
589 />
590 );
592​
593function QueueDragHandle(props: {
594 disabled: boolean;
595 title: string;
596 canMoveUp: boolean;
597 canMoveDown: boolean;
598 onStep: (action: "up" | "down") => void;
599 onStart: () => void;
600 onMove: (y: number) => void;
601 onEnd: (y: number, success: boolean) => void;
602}) {
603 const onStart = useEffectEvent(() => props.onStart());
604 const onMove = useEffectEvent((y: number) => props.onMove(y));
605 const onEnd = useEffectEvent((y: number, success: boolean) => props.onEnd(y, success));
606 const gesture = Gesture.Pan()
607 .enabled(!props.disabled)
608 .minDistance(0)
609 .shouldCancelWhenOutside(false)
610 .runOnJS(true)
611 .onStart(() => onStart())
612 .onUpdate((event) => onMove(event.translationY))
613 .onFinalize((event, success) => onEnd(event.translationY, success));
614 return (
615 <GestureDetector gesture={gesture}>
616 <View
617 collapsable={false}
618 accessible
619 accessibilityRole="adjustable"
620 accessibilityLabel={`Reorder ${props.title}`}
621 accessibilityState={{ disabled: props.disabled }}
622 accessibilityActions={[
623 ...(props.canMoveUp ? [{ name: "decrement", label: "Move up" }] : []),
624 ...(props.canMoveDown ? [{ name: "increment", label: "Move down" }] : []),
625 ]}
626 onAccessibilityAction={({ nativeEvent }) => {
627 if (props.disabled) return;
628 if (nativeEvent.actionName === "decrement" && props.canMoveUp) props.onStep("up");
629 if (nativeEvent.actionName === "increment" && props.canMoveDown) props.onStep("down");
630 }}
631 className="h-12 w-8 items-center justify-center"
632 >
633 <SymbolView
634 name="line.3.horizontal"
635 size={16}
636 tintColorClassName="accent-foreground-muted"
637 />
638 </View>
639 </GestureDetector>
640 );