The best way to control Claude Code, Codex and more from any computer or phone
fix(web,mobile): queued messages get a simpler Send now row, no reordering (#25846)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 27, 2026 at 02:26 UTC
92e645032c35bf4b186809e6e04ac1c7c9c99755
11 files changed
+140
-591
apps/mobile/src/features/threads/ThreadQueueControl.tsx
+99
-333
@@ -8,15 +8,14 @@ import type { ChatAttachment, EnvironmentId, RunId, ThreadId } from "@t3tools/co
8
import { Atom } from "effect/reactivity";
9
import { Image } from "expo-image";
10
import * as Haptics from "expo-haptics";
11
-import { useEffect, useEffectEvent, useRef, useState } from "react";
12
-import { Animated, Platform, Pressable, ScrollView, View } from "react-native";
13
-import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
11
+import { useEffect, useRef, useState } from "react";
12
+import { Platform, Pressable, ScrollView, View } from "react-native";
13
+import { GestureHandlerRootView } from "react-native-gesture-handler";
14
import ReanimatedSwipeable, {
15
type SwipeableMethods,
16
} from "react-native-gesture-handler/ReanimatedSwipeable";
17
import { Screen, ScreenStack, ScreenStackHeaderConfig } from "react-native-screens";
18
import { useSafeAreaInsets } from "react-native-safe-area-context";
19
-import Reanimated, { ReduceMotion, useAnimatedStyle, withTiming } from "react-native-reanimated";
19
20
import { Button } from "../../components/ui/Button";
21
import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";
@@ -36,11 +35,8 @@ import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
35
import {
36
REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL,
37
buildCancelQueuedRunCommand,
39
- resolveQueueDragBeforeRunId,
40
- resolveQueueDropBeforeRunId,
38
resolveThreadQueueRowControls,
39
} from "./threadQueueControlPresentation";
43
-import { threadDragGapOffset } from "./threadDragGap";
40
41
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
42
const REMOVE_ACTION_WIDTH = 76;
@@ -50,14 +46,7 @@ const EMPTY_QUEUED_COUNT_ATOM = Atom.make(0).pipe(
46
);
47
48
type QueueTarget = { readonly environmentId: EnvironmentId; readonly threadId: ThreadId };
53
-type QueueAction = "steer" | "edit" | "up" | "down" | "remove";
54
-type QueueRowLayout = { readonly id: RunId; readonly y?: number; readonly height?: number };
55
-type QueueDrag = {
56
- readonly runId: RunId;
57
- readonly order: string;
58
- beforeRunId: RunId | null | undefined;
59
- readonly rows: ReadonlyArray<QueueRowLayout>;
60
-};
49
+type QueueAction = "steer" | "edit" | "remove";
50
51
export function useThreadQueueWorkflow(target: QueueTarget) {
52
return useAtomValue(environmentThreadDetails.queueWorkflowAtom(target));
@@ -82,25 +71,13 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
71
const editBlockedReason = queuedRunEditBlockedReason({
72
openQuestionCount: pendingRequests?.userInputs.length ?? 0,
73
});
85
- const reorder = useAtomCommand(threadEnvironment.reorderQueuedRun, "reorder queued message");
74
const promote = useAtomCommand(threadEnvironment.promoteQueuedRun, "promote queued message");
75
const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun, "remove queued message");
76
const resume = useAtomCommand(threadEnvironment.resumeThreadQueue, "resume queue");
77
const [resuming, setResuming] = useState(false);
78
const [busyRunId, setBusyRunId] = useState<RunId | null>(null);
79
const busyRef = useRef(false);
92
- const [dragState, setDragState] = useState<QueueDrag | null>(null);
93
- const rowLayouts = useRef(new Map<RunId, { y: number; height: number }>());
94
- const drag = useRef<QueueDrag | null>(null);
95
- const [translation] = useState(() => new Animated.Value(0));
80
const queuedRuns = workflow?.queuedRuns ?? [];
97
- const order = queuedRuns.map(({ run }) => run.id).join(",");
98
- // A queue that changed under the drag (delivery, another client) ends it:
99
- // the gesture handlers ignore it from then on and its preview disappears.
100
- const visibleDrag = dragState?.order === order ? dragState : null;
101
- const draggedRunId = visibleDrag?.runId ?? null;
102
- const previewBeforeRunId = visibleDrag?.beforeRunId;
103
- const dragRows = visibleDrag?.rows ?? null;
81
82
const hadQueuedRuns = useRef(queuedRuns.length > 0);
83
useEffect(() => {
@@ -111,28 +88,10 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
88
if (hadQueuedRuns.current) navigation.goBack();
89
}, [navigation, queuedRuns.length]);
90
114
- const move = async (runId: RunId, beforeRunId: RunId | null) => {
115
- if (busyRef.current || !workflow?.canReorder) return;
116
- busyRef.current = true;
117
- setBusyRunId(runId);
118
- void Haptics.selectionAsync();
119
- await reorder({ ...target, input: { threadId: target.threadId, runId, beforeRunId } });
120
- busyRef.current = false;
121
- setBusyRunId(null);
122
- };
123
-
91
const act = async (runId: RunId, action: QueueAction) => {
92
if (busyRef.current) return;
93
const index = queuedRuns.findIndex(({ run }) => run.id === runId);
94
if (index < 0) return;
128
- if (action === "up" && index > 0) {
129
- await move(runId, queuedRuns[index - 1]!.run.id);
130
- return;
131
- }
132
- if (action === "down" && index < queuedRuns.length - 1) {
133
- await move(runId, queuedRuns[index + 2]?.run.id ?? null);
134
- return;
135
- }
95
if (action === "edit") {
96
if (editBlockedReason !== null) return;
97
const entry = queuedRuns[index]!;
@@ -180,24 +139,10 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
139
setBusyRunId(null);
140
};
141
183
- const canReorder = workflow?.canReorder === true && queuedRuns.length > 1;
184
- const sourceLayout = dragRows?.find((row) => row.id === draggedRunId);
185
- const lastLayout = dragRows?.at(-1);
186
- const insertionOffset =
187
- previewBeforeRunId === undefined
188
- ? undefined
189
- : previewBeforeRunId === null
190
- ? lastLayout?.y === undefined || lastLayout.height === undefined
191
- ? undefined
192
- : lastLayout.y + lastLayout.height
193
- : dragRows?.find((row) => row.id === previewBeforeRunId)?.y;
194
- const queueRows = () =>
195
- queuedRuns.map(({ run }) => ({ id: run.id, ...rowLayouts.current.get(run.id) }));
142
const content = (
143
<ScrollView
144
nestedScrollEnabled
145
className="flex-1"
200
- scrollEnabled={draggedRunId === null}
146
// UIKit must inset content beneath the floating translucent iOS header.
147
contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
148
contentContainerClassName="px-5 pb-6"
@@ -229,222 +174,118 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
174
</Text>
175
) : null}
176
{queuedRuns.map(({ run, text, attachments, context }, index) => {
232
- const layout = dragRows?.find((row) => row.id === run.id);
233
- const offset =
234
- sourceLayout?.y !== undefined &&
235
- sourceLayout.height !== undefined &&
236
- layout?.y !== undefined &&
237
- insertionOffset !== undefined
238
- ? threadDragGapOffset(layout.y, sourceLayout.y, sourceLayout.height, insertionOffset)
239
- : 0;
177
const controls = resolveThreadQueueRowControls({
241
- busy: busyRunId !== null || draggedRunId !== null,
178
+ busy: busyRunId !== null,
179
canPromoteToSteer: workflow?.canPromoteToSteer ?? false,
180
canSendNow: workflow?.canSendNow ?? false,
244
- canReorder: workflow?.canReorder ?? false,
181
editBlocked: editBlockedReason !== null,
246
- index,
182
isEditing: editing?.runId === run.id,
183
isGuestMessage: context?.guest !== undefined,
249
- queuedCount: queuedRuns.length,
184
text,
185
});
186
const title =
187
controls.displayText || (attachments.length > 0 ? "Attachments" : "Queued message");
188
return (
255
- <QueueShiftedRow
256
- key={run.id}
257
- offset={offset}
258
- dragging={draggedRunId !== null}
259
- lifted={draggedRunId === run.id}
260
- onLayout={({ nativeEvent }) => rowLayouts.current.set(run.id, nativeEvent.layout)}
261
- >
262
- <Animated.View
263
- className="flex-row items-center border-b border-border bg-sheet"
264
- style={
265
- draggedRunId === run.id
266
- ? { transform: [{ translateY: translation }], zIndex: 1, opacity: 0.85 }
267
- : undefined
268
- }
189
+ <View key={run.id} className="flex-row items-center border-b border-border bg-sheet">
190
+ <QueueRowSwipeable
191
+ enabled={busyRunId === null && controls.canDismiss}
192
+ background={theme["--color-sheet"]}
193
+ onRemove={() => void act(run.id, "remove")}
194
>
270
- {canReorder ? (
271
- // Keep the vertical handle outside the sideways swipeable so their pans do not race.
272
- <QueueDragHandle
273
- disabled={busyRunId !== null}
274
- title={title}
275
- canMoveUp={controls.canMoveUp}
276
- canMoveDown={controls.canMoveDown}
277
- onStep={(action) => void act(run.id, action)}
278
- onStart={() => {
279
- const rows = queueRows();
280
- const beforeRunId = resolveQueueDragBeforeRunId(rows, run.id, 0);
281
- drag.current = { runId: run.id, order, beforeRunId, rows };
282
- translation.setValue(0);
283
- setDragState({ ...drag.current });
284
- void Haptics.selectionAsync();
285
- }}
286
- onMove={(y) => {
287
- const current = drag.current;
288
- if (current?.runId !== run.id || current.order !== order) return;
289
- translation.setValue(y);
290
- const before = resolveQueueDragBeforeRunId(current.rows, run.id, y);
291
- if (current.beforeRunId !== before) {
292
- current.beforeRunId = before;
293
- setDragState({ ...current });
294
- }
295
- }}
296
- onEnd={(y, success) => {
297
- const started = drag.current;
298
- const stop = () => {
299
- if (drag.current !== started) return;
300
- drag.current = null;
301
- setDragState(null);
302
- translation.setValue(0);
303
- };
304
- if (!success || started?.order !== order || started.runId !== run.id) {
305
- stop();
306
- return;
307
- }
308
- const before = resolveQueueDropBeforeRunId(started.rows, run.id, y);
309
- if (before === undefined) {
310
- stop();
311
- return;
312
- }
313
- const source = started.rows.find((row) => row.id === run.id);
314
- const tail = started.rows.at(-1);
315
- const insertion =
316
- before === null
317
- ? tail?.y !== undefined && tail.height !== undefined
318
- ? tail.y + tail.height
319
- : undefined
320
- : started.rows.find((row) => row.id === before)?.y;
321
- if (
322
- source?.y !== undefined &&
323
- source.height !== undefined &&
324
- insertion !== undefined
325
- ) {
326
- Animated.timing(translation, {
327
- toValue: insertion - source.y - (insertion > source.y ? source.height : 0),
328
- duration: 160,
329
- useNativeDriver: true,
330
- }).start();
331
- }
332
- started.beforeRunId = before;
333
- setDragState({ ...started });
334
- void move(run.id, before).finally(stop);
335
- }}
336
- />
337
- ) : null}
338
- <QueueRowSwipeable
339
- enabled={draggedRunId === null && busyRunId === null && controls.canDismiss}
340
- background={theme["--color-sheet"]}
341
- onRemove={() => void act(run.id, "remove")}
342
- >
343
- <View className="flex-row items-center">
344
- <Menu
345
- accessibilityLabel={`Actions for queued message ${index + 1}`}
346
- shouldOpenOnLongPress
347
- style={{ flex: 1 }}
348
- actions={[
349
- ...(workflow?.canPromoteToSteer || workflow?.canSendNow
350
- ? [
351
- {
352
- id: "steer",
353
- title: workflow?.canSendNow ? "Send now" : "Steer now",
354
- attributes: { disabled: !controls.canSend },
355
- image: Platform.OS === "ios" ? "arrow.turn.left.up" : "arrow_upward",
356
- },
357
- ]
358
- : []),
359
- {
360
- id: "edit",
361
- title: "Edit",
362
- attributes: { disabled: !controls.canEdit },
363
- image: Platform.OS === "ios" ? "pencil" : "edit",
364
- },
365
- { id: "up", title: "Move up", attributes: { disabled: !controls.canMoveUp } },
366
- {
367
- id: "down",
368
- title: "Move down",
369
- attributes: { disabled: !controls.canMoveDown },
370
- },
371
- {
372
- id: "remove",
373
- title: "Remove",
374
- attributes: { disabled: !controls.canDismiss, destructive: true },
375
- },
376
- ]}
377
- onPressAction={({ nativeEvent }) =>
378
- void act(run.id, nativeEvent.event as QueueAction)
195
+ <View className="flex-row items-center">
196
+ <Menu
197
+ accessibilityLabel={`Actions for queued message ${index + 1}`}
198
+ shouldOpenOnLongPress
199
+ style={{ flex: 1 }}
200
+ actions={[
201
+ ...(workflow?.canPromoteToSteer || workflow?.canSendNow
202
+ ? [
203
+ {
204
+ id: "steer",
205
+ title: "Send now",
206
+ attributes: { disabled: !controls.canSend },
207
+ image: Platform.OS === "ios" ? "arrow.up" : "arrow_upward",
208
+ },
209
+ ]
210
+ : []),
211
+ {
212
+ id: "edit",
213
+ title: "Edit",
214
+ attributes: { disabled: !controls.canEdit },
215
+ image: Platform.OS === "ios" ? "pencil" : "edit",
216
+ },
217
+ {
218
+ id: "remove",
219
+ title: "Remove",
220
+ attributes: { disabled: !controls.canDismiss, destructive: true },
221
+ },
222
+ ]}
223
+ onPressAction={({ nativeEvent }) =>
224
+ void act(run.id, nativeEvent.event as QueueAction)
225
+ }
226
+ >
227
+ <Pressable
228
+ accessibilityRole="button"
229
+ accessibilityLabel={title}
230
+ accessibilityHint={
231
+ controls.canEdit
232
+ ? "Opens this message in the composer for editing"
233
+ : (editBlockedReason ?? undefined)
234
}
235
+ disabled={!controls.canEdit}
236
+ onPress={() => void act(run.id, "edit")}
237
+ className="min-h-14 flex-row items-center gap-2.5 py-2.5 active:opacity-70"
238
>
381
- <Pressable
382
- accessibilityRole="button"
383
- accessibilityLabel={title}
384
- accessibilityHint={
385
- controls.canEdit
386
- ? "Opens this message in the composer for editing"
387
- : (editBlockedReason ?? undefined)
239
+ <QueueAttachmentThumbnails
240
+ environmentId={target.environmentId}
241
+ attachments={attachments}
242
+ />
243
+ <Text
244
+ className={
245
+ controls.isEditing
246
+ ? "min-w-0 flex-1 text-sm text-foreground-muted"
247
+ : "min-w-0 flex-1 text-sm text-foreground"
248
}
389
- disabled={!controls.canEdit}
390
- onPress={() => void act(run.id, "edit")}
391
- className="min-h-14 flex-row items-center gap-2.5 py-2.5 active:opacity-70"
249
+ numberOfLines={1}
250
>
393
- <QueueAttachmentThumbnails
394
- environmentId={target.environmentId}
395
- attachments={attachments}
251
+ {context?.guest === undefined ? null : (
252
+ <Text className="font-t3-medium text-adaptive-fuchsia-600-300">
253
+ {`${context.guest.name} `}
254
+ </Text>
255
+ )}
256
+ {title}
257
+ </Text>
258
+ {controls.isEditing ? (
259
+ <Text className="shrink-0 text-2xs uppercase tracking-wide text-primary">
260
+ Editing
261
+ </Text>
262
+ ) : null}
263
+ </Pressable>
264
+ </Menu>
265
+ {workflow?.canPromoteToSteer || workflow?.canSendNow ? (
266
+ // Outside the edit row and full row height, so a near miss never opens the editor.
267
+ <Pressable
268
+ accessibilityRole="button"
269
+ accessibilityLabel={`Send now, queued message ${index + 1}`}
270
+ disabled={!controls.canSend}
271
+ onPress={() => void act(run.id, "steer")}
272
+ className="shrink-0 justify-center self-stretch pl-4 active:opacity-70 disabled:opacity-40"
273
+ >
274
+ <View className="min-h-9 flex-row items-center gap-1.5 rounded-full bg-primary px-4">
275
+ <SymbolView
276
+ name="arrow.up"
277
+ size={13}
278
+ tintColorClassName="accent-primary-foreground"
279
/>
397
- <Text
398
- className={
399
- controls.isEditing
400
- ? "min-w-0 flex-1 text-sm text-foreground-muted"
401
- : "min-w-0 flex-1 text-sm text-foreground"
402
- }
403
- numberOfLines={1}
404
- >
405
- {context?.guest === undefined ? null : (
406
- <Text className="font-t3-medium text-adaptive-fuchsia-600-300">
407
- {`${context.guest.name} `}
408
- </Text>
409
- )}
410
- {title}
280
+ <Text className="font-t3-medium text-sm text-primary-foreground">
281
+ Send now
282
</Text>
412
- {controls.isEditing ? (
413
- <Text className="shrink-0 text-2xs uppercase tracking-wide text-primary">
414
- Editing
415
- </Text>
416
- ) : null}
417
- </Pressable>
418
- </Menu>
419
- {workflow?.canPromoteToSteer || workflow?.canSendNow ? (
420
- // Outside the edit row and full row height, so a near miss never opens the editor.
421
- <Pressable
422
- accessibilityRole="button"
423
- accessibilityLabel={
424
- workflow?.canSendNow
425
- ? `Send message ${index + 1} now`
426
- : `Steer with message ${index + 1} now`
427
- }
428
- disabled={!controls.canSend}
429
- onPress={() => void act(run.id, "steer")}
430
- className="shrink-0 justify-center self-stretch pl-4 active:opacity-70 disabled:opacity-40"
431
- >
432
- <View className="min-h-9 flex-row items-center gap-1.5 rounded-full bg-primary px-4">
433
- <SymbolView
434
- name={workflow?.canSendNow ? "arrow.up" : "arrow.turn.left.up"}
435
- size={13}
436
- tintColorClassName="accent-primary-foreground"
437
- />
438
- <Text className="font-t3-medium text-sm text-primary-foreground">
439
- {workflow?.canSendNow ? "Send now" : "Steer"}
440
- </Text>
441
- </View>
442
- </Pressable>
443
- ) : null}
444
- </View>
445
- </QueueRowSwipeable>
446
- </Animated.View>
447
- </QueueShiftedRow>
283
+ </View>
284
+ </Pressable>
285
+ ) : null}
286
+ </View>
287
+ </QueueRowSwipeable>
288
+ </View>
289
);
290
})}
291
</ScrollView>
@@ -494,30 +335,6 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
335
);
336
}
337
497
-function QueueShiftedRow(props: {
498
- readonly offset: number;
499
- readonly dragging: boolean;
500
- readonly lifted: boolean;
501
- readonly onLayout: React.ComponentProps<typeof View>["onLayout"];
502
- readonly children: React.ReactNode;
503
-}) {
504
- const { dragging, offset } = props;
505
- const style = useAnimatedStyle(() => ({
506
- transform: [
507
- {
508
- translateY: dragging
509
- ? withTiming(offset, { duration: 160, reduceMotion: ReduceMotion.System })
510
- : offset,
511
- },
512
- ],
513
- }));
514
- return (
515
- <Reanimated.View onLayout={props.onLayout} style={[style, { zIndex: props.lifted ? 1 : 0 }]}>
516
- {props.children}
517
- </Reanimated.View>
518
- );
519
-}
520
-
338
function QueueRowSwipeable(props: {
339
readonly enabled: boolean;
340
readonly background: string;
@@ -532,7 +349,7 @@ function QueueRowSwipeable(props: {
349
friction={2}
350
rightThreshold={40}
351
overshootRight={false}
535
- // Require a clearly sideways swipe to avoid competing with sheet scroll and drag handles.
352
+ // Require a clearly sideways swipe to avoid competing with sheet scroll.
353
failOffsetY={[-12, 12]}
354
containerStyle={{ backgroundColor: props.background, flex: 1 }}
355
childrenContainerStyle={{ backgroundColor: props.background }}
@@ -616,54 +433,3 @@ function QueueAttachmentThumbnail(props: {
433
/>
434
);
435
}
619
-
620
-function QueueDragHandle(props: {
621
- disabled: boolean;
622
- title: string;
623
- canMoveUp: boolean;
624
- canMoveDown: boolean;
625
- onStep: (action: "up" | "down") => void;
626
- onStart: () => void;
627
- onMove: (y: number) => void;
628
- onEnd: (y: number, success: boolean) => void;
629
-}) {
630
- const onStart = useEffectEvent(() => props.onStart());
631
- const onMove = useEffectEvent((y: number) => props.onMove(y));
632
- const onEnd = useEffectEvent((y: number, success: boolean) => props.onEnd(y, success));
633
- // oxlint-disable-next-line react/capitalized-calls -- Gesture.Pan is a gesture factory, not a React component.
634
- const gesture = Gesture.Pan()
635
- .enabled(!props.disabled)
636
- .minDistance(0)
637
- .shouldCancelWhenOutside(false)
638
- .runOnJS(true)
639
- .onStart(() => onStart())
640
- .onUpdate((event) => onMove(event.translationY))
641
- .onFinalize((event, success) => onEnd(event.translationY, success));
642
- return (
643
- <GestureDetector gesture={gesture}>
644
- <View
645
- collapsable={false}
646
- accessible
647
- accessibilityRole="adjustable"
648
- accessibilityLabel={`Reorder ${props.title}`}
649
- accessibilityState={{ disabled: props.disabled }}
650
- accessibilityActions={[
651
- ...(props.canMoveUp ? [{ name: "decrement", label: "Move up" }] : []),
652
- ...(props.canMoveDown ? [{ name: "increment", label: "Move down" }] : []),
653
- ]}
654
- onAccessibilityAction={({ nativeEvent }) => {
655
- if (props.disabled) return;
656
- if (nativeEvent.actionName === "decrement" && props.canMoveUp) props.onStep("up");
657
- if (nativeEvent.actionName === "increment" && props.canMoveDown) props.onStep("down");
658
- }}
659
- className="h-12 w-8 items-center justify-center"
660
- >
661
- <SymbolView
662
- name="line.3.horizontal"
663
- size={16}
664
- tintColorClassName="accent-foreground-muted"
665
- />
666
- </View>
667
- </GestureDetector>
668
- );
669
-}
apps/mobile/src/features/threads/floating-working-control.tsx
+1
-1
@@ -243,7 +243,7 @@ export function FloatingWorkingControl(props: {
243
<Pressable
244
accessibilityRole="button"
245
accessibilityLabel={`Open queue, ${props.queuedCount} messages`}
246
- accessibilityHint="Opens queued messages for reordering, steering, or removal"
246
+ accessibilityHint="Opens queued messages to send now, edit, or remove"
247
onPress={props.onOpenQueue}
248
onLayout={(event) => setQueueWidth(settleWidth(event.nativeEvent.layout.width))}
249
style={{ maxWidth: Math.min(overlayWidth, windowWidth) * 0.45 }}
apps/mobile/src/features/threads/threadQueueControlPresentation.test.ts
+1
-38
@@ -1,10 +1,7 @@
1
import { formatAssistantCitationHref } from "@t3tools/shared/assistantCitations";
2
import { describe, expect, it } from "vite-plus/test";
3
4
-import {
5
- resolveThreadQueueRowControls,
6
- resolveQueueDropBeforeRunId,
7
-} from "./threadQueueControlPresentation";
4
+import { resolveThreadQueueRowControls } from "./threadQueueControlPresentation";
5
6
describe("threadQueueControlPresentation", () => {
7
it.each([
@@ -19,9 +16,6 @@ describe("threadQueueControlPresentation", () => {
16
isEditing,
17
canPromoteToSteer: false,
18
canSendNow: true,
22
- canReorder: false,
23
- index: 0,
24
- queuedCount: 1,
19
text: "Queued message",
20
});
21
@@ -45,9 +39,6 @@ describe("threadQueueControlPresentation", () => {
39
busy: false,
40
canPromoteToSteer: true,
41
canSendNow: false,
48
- canReorder: true,
49
- index: 0,
50
- queuedCount: 1,
42
text: `[Assistant quote](${href}) Can we add a backoff here?`,
43
});
44
@@ -61,17 +52,13 @@ describe("threadQueueControlPresentation", () => {
52
busy: false,
53
canPromoteToSteer: true,
54
canSendNow: false,
64
- canReorder: true,
65
- index: 1,
55
isEditing: true,
67
- queuedCount: 3,
56
text: "Being edited",
57
});
58
59
expect(editing.isEditing).toBe(true);
60
expect(editing.canEdit).toBe(false);
61
expect(editing.canSend).toBe(false);
74
- expect(editing.canMoveUp).toBe(true);
62
expect(editing.canDismiss).toBe(true);
63
});
64
@@ -80,10 +67,7 @@ describe("threadQueueControlPresentation", () => {
67
busy: false,
68
canPromoteToSteer: true,
69
canSendNow: false,
83
- canReorder: true,
84
- index: 0,
70
isGuestMessage: true,
86
- queuedCount: 1,
71
text: "Why?",
72
});
73
@@ -91,24 +75,3 @@ describe("threadQueueControlPresentation", () => {
75
expect(guest.canDismiss).toBe(true);
76
});
77
});
94
-
95
-describe("queue drag insertion", () => {
96
- const rows = [
97
- { id: "first" as never, y: 0, height: 80 },
98
- { id: "second" as never, y: 80, height: 140 },
99
- { id: "third" as never, y: 220, height: 80 },
100
- ];
101
-
102
- it("moves between variable-height rows and to either end", () => {
103
- expect(resolveQueueDropBeforeRunId(rows, rows[0]!.id, 140)).toBe("third");
104
- expect(resolveQueueDropBeforeRunId(rows, rows[0]!.id, 300)).toBeNull();
105
- expect(resolveQueueDropBeforeRunId(rows, rows[2]!.id, -300)).toBe("first");
106
- });
107
-
108
- it("does not send a reorder for an unchanged or unmeasured drop", () => {
109
- expect(resolveQueueDropBeforeRunId(rows, rows[1]!.id, 0)).toBeUndefined();
110
- expect(resolveQueueDropBeforeRunId(rows, rows[2]!.id, 20)).toBeUndefined();
111
- expect(resolveQueueDropBeforeRunId([{ id: rows[0]!.id }], rows[0]!.id, 10)).toBeUndefined();
112
- expect(resolveQueueDropBeforeRunId(rows, "missing" as never, 100)).toBeUndefined();
113
- });
114
-});
apps/mobile/src/features/threads/threadQueueControlPresentation.ts
-31
@@ -6,8 +6,6 @@ export const REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL = "Remove queued message"
6
export interface ThreadQueueRowControls {
7
readonly canDismiss: boolean;
8
readonly canEdit: boolean;
9
- readonly canMoveDown: boolean;
10
- readonly canMoveUp: boolean;
9
readonly canSend: boolean;
10
readonly dismissAccessibilityLabel: string;
11
readonly displayText: string;
@@ -18,14 +16,11 @@ export function resolveThreadQueueRowControls(input: {
16
readonly busy: boolean;
17
readonly canPromoteToSteer: boolean;
18
readonly canSendNow: boolean;
21
- readonly canReorder: boolean;
19
/** Something else holds the composer, such as an open question. */
20
readonly editBlocked?: boolean;
24
- readonly index: number;
21
readonly isEditing?: boolean;
22
/** A guest's message keeps the guest's words; the owner can cancel it, not rewrite it. */
23
readonly isGuestMessage?: boolean;
28
- readonly queuedCount: number;
24
readonly text: string;
25
}): ThreadQueueRowControls {
26
const mutationEnabled = !input.busy;
@@ -37,8 +32,6 @@ export function resolveThreadQueueRowControls(input: {
32
// away whatever has been typed since.
33
canEdit:
34
mutationEnabled && !isEditing && input.isGuestMessage !== true && input.editBlocked !== true,
40
- canMoveDown: mutationEnabled && input.canReorder && input.index < input.queuedCount - 1,
41
- canMoveUp: mutationEnabled && input.canReorder && input.index > 0,
35
canSend: mutationEnabled && (input.canPromoteToSteer || input.canSendNow) && !isEditing,
36
dismissAccessibilityLabel: REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL,
37
// Editing and sending keep the original text so quoted citations stay linked.
@@ -66,27 +59,3 @@ export function buildCancelQueuedRunCommand(input: {
59
},
60
};
61
}
69
-
70
-export function resolveQueueDragBeforeRunId(
71
- rows: ReadonlyArray<{ id: RunId; y?: number; height?: number }>,
72
- runId: RunId,
73
- translationY: number,
74
-): RunId | null | undefined {
75
- const sourceIndex = rows.findIndex((row) => row.id === runId);
76
- const source = rows[sourceIndex];
77
- if (!source || rows.some((row) => row.y === undefined || row.height === undefined)) return;
78
- const center = source.y! + source.height! / 2 + translationY;
79
- const remaining = rows.filter((row) => row.id !== runId);
80
- return remaining.find((row) => center < row.y! + row.height! / 2)?.id ?? null;
81
-}
82
-
83
-export function resolveQueueDropBeforeRunId(
84
- rows: ReadonlyArray<{ id: RunId; y?: number; height?: number }>,
85
- runId: RunId,
86
- translationY: number,
87
-): RunId | null | undefined {
88
- const before = resolveQueueDragBeforeRunId(rows, runId, translationY);
89
- if (before === undefined) return;
90
- const sourceIndex = rows.findIndex((row) => row.id === runId);
91
- return before === (rows[sourceIndex + 1]?.id ?? null) ? undefined : before;
92
-}
apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx
-1
@@ -71,7 +71,6 @@ it("previews assistant quotes as readable text and preserves the citation when e
71
state.workflow = {
72
activeRun: { id: "run:active" },
73
canPromoteToSteer: true,
74
- canReorder: true,
74
queuedRuns: [
75
{
76
run: { id: "run:quote-only", userMessageId: "message:quote-only" },
apps/web/src/components/chat/QueuedRunsControl.tsx
+32
-151
@@ -9,15 +9,7 @@ import type {
9
RunId,
10
ThreadId,
11
} from "@t3tools/contracts";
12
-import {
13
- ChevronDownIcon,
14
- Clock3Icon,
15
- CornerUpRightIcon,
16
- GripVerticalIcon,
17
- ListOrderedIcon,
18
- PencilIcon,
19
- XIcon,
20
-} from "lucide-react";
12
+import { ChevronDownIcon, Clock3Icon, ArrowUpIcon, PencilIcon, XIcon } from "lucide-react";
13
import { useId, useImperativeHandle, useRef, useState, type Ref } from "react";
14
15
import { useAssetUrls } from "../../assets/assetUrls";
@@ -27,6 +19,7 @@ import { useAtomCommand } from "../../state/use-atom-command";
19
import { isImageAttachment, type ChatMessage } from "../../types";
20
import { cn } from "~/lib/utils";
21
import { Button, InlineButton } from "../ui/button";
22
+import { Separator } from "../ui/separator";
23
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
24
25
export interface EditQueuedRunRequest {
@@ -42,7 +35,6 @@ interface QueuedRowThumbnail {
35
readonly url: string | null;
36
}
37
45
-const QUEUED_RUN_DRAG_TYPE = "application/x-t3code-queued-run";
38
// A longer queue shows its first messages and a button that shows the rest.
39
const QUEUE_VISIBLE_ROWS = 3;
40
@@ -85,19 +77,12 @@ export function QueuedRunsControl({
77
const projection = useThreadProjection(
78
scopeThreadRef(props.environmentId, props.threadId),
79
)?.projection;
88
- const reorder = useAtomCommand(threadEnvironment.reorderQueuedRun);
80
const promote = useAtomCommand(threadEnvironment.promoteQueuedRun);
81
const resume = useAtomCommand(threadEnvironment.resumeThreadQueue);
82
const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun);
83
const [showAll, setShowAll] = useState(false);
84
const queueListId = useId();
85
const [busyRunId, setBusyRunId] = useState<RunId | null>(null);
95
- const [dragState, setDragState] = useState<{
96
- readonly runId: RunId;
97
- readonly insertIndex: number | null;
98
- } | null>(null);
99
- // Arm from the grip to prevent accidental text drags from reordering queued runs.
100
- const dragArmedRunIdRef = useRef<RunId | null>(null);
86
const steerInFlightRef = useRef(false);
87
// Run-only acknowledgements can resurrect pending rows after cancellation or startup.
88
const acknowledgedMessageIds = new Set((projection?.messages ?? []).map((message) => message.id));
@@ -109,7 +94,6 @@ export function QueuedRunsControl({
94
const workflow = projection ? deriveThreadQueueWorkflowState(projection) : null;
95
const queued = workflow?.queuedRuns ?? [];
96
const activeRun = workflow?.activeRun ?? null;
112
- const canReorder = workflow?.canReorder === true;
97
const canSend = workflow?.canSendNow === true || workflow?.canPromoteToSteer === true;
98
const queuedImageUrlById = new Map(
99
queuedImageAttachmentUrls.flatMap((url, index) => {
@@ -160,25 +144,6 @@ export function QueuedRunsControl({
144
})),
145
];
146
163
- const move = async (runId: RunId, beforeRunId: RunId | null) => {
164
- setBusyRunId(runId);
165
- await reorder({
166
- environmentId: props.environmentId,
167
- input: { threadId: props.threadId, runId, beforeRunId },
168
- });
169
- setBusyRunId(null);
170
- };
171
-
172
- const completeDrag = (runId: RunId, insertIndex: number | null) => {
173
- setDragState(null);
174
- dragArmedRunIdRef.current = null;
175
- if (insertIndex === null || busyRunId !== null) return;
176
- const draggedIndex = queued.findIndex(({ run }) => run.id === runId);
177
- if (draggedIndex === -1) return;
178
- if (insertIndex === draggedIndex || insertIndex === draggedIndex + 1) return;
179
- void move(runId, queued[insertIndex]?.run.id ?? null);
180
- };
181
-
147
const sendQueuedMessage = async (queuedRunId: RunId) => {
148
if (!canSend || steerInFlightRef.current) return;
149
steerInFlightRef.current = true;
@@ -246,17 +211,13 @@ export function QueuedRunsControl({
211
212
return (
213
<section
249
- aria-label={`Up next: ${items.length} queued message${items.length === 1 ? "" : "s"}`}
214
+ aria-label={`${items.length} queued message${items.length === 1 ? "" : "s"}`}
215
data-thread-queue="true"
216
className="mx-auto flex w-full max-w-(--chat-content-max-width) flex-col gap-2 pb-4"
217
>
253
- <h3 className="flex min-h-5 items-center gap-1.5 px-1 text-xs font-normal text-muted-foreground [&_svg]:size-3.5">
254
- <ListOrderedIcon aria-hidden />
255
- Up next
256
- <span className="tabular-nums" aria-live="polite">
257
- · {items.length} queued
258
- </span>
259
- </h3>
218
+ <span className="sr-only" aria-live="polite">
219
+ {items.length} queued
220
+ </span>
221
<ol className="flex flex-col items-end gap-3" id={queueListId}>
222
{visibleItems.map((item, position) => {
223
const previewText = assistantCitationsToPlainText(
@@ -264,11 +225,7 @@ export function QueuedRunsControl({
225
reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,
226
),
227
).trim();
267
- const rowRunId = item.runId;
268
- const rowServerIndex = item.serverIndex;
269
- const isEditing = rowRunId !== null && rowRunId === props.editingRunId;
270
- const rowDraggable =
271
- rowRunId !== null && rowServerIndex !== null && canReorder && busyRunId === null;
228
+ const isEditing = item.runId !== null && item.runId === props.editingRunId;
229
return (
230
<li
231
key={item.key}
@@ -276,56 +233,8 @@ export function QueuedRunsControl({
233
aria-posinset={position + 1}
234
aria-setsize={items.length}
235
aria-current={isEditing ? "true" : undefined}
279
- className={cn(
280
- "group/queued relative flex w-full flex-col items-end gap-1 transition-opacity duration-150 ease-out starting:opacity-0 motion-reduce:transition-none",
281
- dragState !== null && dragState.runId === item.runId && "opacity-50",
282
- )}
283
- draggable={rowDraggable}
284
- onDragStart={(event) => {
285
- if (item.runId === null || dragArmedRunIdRef.current !== item.runId) {
286
- event.preventDefault();
287
- return;
288
- }
289
- event.dataTransfer.setData(QUEUED_RUN_DRAG_TYPE, item.runId);
290
- event.dataTransfer.effectAllowed = "move";
291
- setDragState({ runId: item.runId, insertIndex: null });
292
- }}
293
- onDragEnd={() => {
294
- dragArmedRunIdRef.current = null;
295
- setDragState(null);
296
- }}
297
- onDragOver={(event) => {
298
- if (dragState === null || item.serverIndex === null) return;
299
- event.preventDefault();
300
- event.dataTransfer.dropEffect = "move";
301
- const rect = event.currentTarget.getBoundingClientRect();
302
- const insertIndex =
303
- event.clientY < rect.top + rect.height / 2
304
- ? item.serverIndex
305
- : item.serverIndex + 1;
306
- if (dragState.insertIndex !== insertIndex) {
307
- setDragState({ runId: dragState.runId, insertIndex });
308
- }
309
- }}
310
- onDrop={(event) => {
311
- if (dragState === null) return;
312
- event.preventDefault();
313
- completeDrag(dragState.runId, dragState.insertIndex);
314
- }}
236
+ className="flex w-full flex-col items-end gap-1 transition-opacity duration-150 ease-out starting:opacity-0 motion-reduce:transition-none"
237
>
316
- {item.serverIndex !== null && dragState?.insertIndex === item.serverIndex ? (
317
- <span
318
- aria-hidden
319
- className="pointer-events-none absolute inset-x-0 -top-1.5 h-0.5 rounded bg-primary/70"
320
- />
321
- ) : null}
322
- {item.serverIndex === queued.length - 1 &&
323
- dragState?.insertIndex === queued.length ? (
324
- <span
325
- aria-hidden
326
- className="pointer-events-none absolute inset-x-0 -bottom-1.5 h-0.5 rounded bg-primary/70"
327
- />
328
- ) : null}
238
{/* Dashed and unfilled: a turn that has not been sent yet. */}
239
<div
240
className={cn(
@@ -369,38 +278,30 @@ export function QueuedRunsControl({
278
) : null}
279
</div>
280
<div className="flex items-center gap-0.5 pe-1 text-xs text-muted-foreground">
372
- {items.length > 1 && canReorder && rowRunId !== null && rowServerIndex !== null ? (
373
- <Button
374
- size="icon-xs"
375
- variant="ghost-muted"
376
- aria-label={`Reorder queued message ${position + 1} of ${items.length} (drag, or press the arrow keys)`}
377
- className="group/grip cursor-grab active:cursor-grabbing"
378
- // Not `disabled`: that drops keyboard focus mid-move and breaks repeated arrow presses.
379
- aria-disabled={busyRunId !== null || undefined}
380
- onPointerDown={() => {
381
- if (busyRunId === null) dragArmedRunIdRef.current = rowRunId;
382
- }}
383
- onKeyDown={(event) => {
384
- if (busyRunId !== null) return;
385
- if (event.key === "ArrowUp" && rowServerIndex > 0) {
386
- event.preventDefault();
387
- void move(rowRunId, queued[rowServerIndex - 1]?.run.id ?? null);
388
- }
389
- if (event.key === "ArrowDown" && rowServerIndex < queued.length - 1) {
390
- event.preventDefault();
391
- // Moving into the collapsed rows would unmount the focused grip.
392
- if (rowServerIndex + 1 >= visibleItems.length) setShowAll(true);
393
- void move(rowRunId, queued[rowServerIndex + 2]?.run.id ?? null);
394
- }
395
- }}
396
- >
397
- <span className="text-xs font-medium tabular-nums group-hover/queued:hidden group-focus-visible/grip:hidden">
398
- {position + 1}
399
- </span>
400
- <GripVerticalIcon className="hidden group-hover/queued:block group-focus-visible/grip:block" />
401
- </Button>
402
- ) : items.length > 1 ? (
403
- <span className="px-1.5 font-medium tabular-nums">{position + 1}</span>
281
+ {canSend && !isEditing ? (
282
+ <>
283
+ <Tooltip>
284
+ <TooltipTrigger render={<span className="flex shrink-0" />}>
285
+ <Button
286
+ size="xs"
287
+ variant="ghost-muted"
288
+ disabled={item.runId === null || busyRunId !== null}
289
+ onClick={() => {
290
+ if (item.runId !== null) {
291
+ void sendQueuedMessage(item.runId);
292
+ }
293
+ }}
294
+ >
295
+ <ArrowUpIcon />
296
+ Send now
297
+ </Button>
298
+ </TooltipTrigger>
299
+ <TooltipPopup>
300
+ {`${workflow?.canSendNow ? "Start a turn with this message" : "Send into the current turn"}${item.serverIndex === 0 && props.steerShortcutLabel ? ` (${props.steerShortcutLabel})` : ""}`}
301
+ </TooltipPopup>
302
+ </Tooltip>
303
+ <Separator orientation="vertical" className="mx-2 h-4" />
304
+ </>
305
) : null}
306
{item.pending ? (
307
<span className="flex items-center gap-1 px-1">
@@ -454,26 +355,6 @@ export function QueuedRunsControl({
355
`Edit in the composer${item.serverIndex === queued.length - 1 && props.editShortcutLabel ? ` (${props.editShortcutLabel})` : ""}`}
356
</TooltipPopup>
357
</Tooltip>
457
- <Tooltip>
458
- <TooltipTrigger render={<span className="flex shrink-0" />}>
459
- <Button
460
- size="xs"
461
- variant="ghost-muted"
462
- disabled={item.runId === null || busyRunId !== null || !canSend}
463
- onClick={() => {
464
- if (item.runId !== null) {
465
- void sendQueuedMessage(item.runId);
466
- }
467
- }}
468
- >
469
- <CornerUpRightIcon />
470
- {workflow?.canSendNow ? "Send now" : "Steer"}
471
- </Button>
472
- </TooltipTrigger>
473
- <TooltipPopup>
474
- {`${workflow?.canSendNow ? "Start a turn with this message" : "Send as a steer instead"}${item.serverIndex === 0 && props.steerShortcutLabel ? ` (${props.steerShortcutLabel})` : ""}`}
475
- </TooltipPopup>
476
- </Tooltip>
358
<Tooltip>
359
<TooltipTrigger
360
render={
docs/user/composer.md
+6
-6
@@ -54,7 +54,7 @@ See [images and videos](#images-and-videos-in-messages) for previewing and savin
54
On web and desktop, choose **Settings → Chat → Follow-up behavior** to queue
55
new messages for a later turn or steer the running turn immediately. The setting
56
applies to this client; already queued messages keep their place. Queued messages
57
-are saved on the server and can be edited, reordered, or removed before they send.
57
+are saved on the server and can be edited or removed before they send.
58
When Enter sends, `Cmd+Enter` on macOS or `Ctrl+Enter` on Windows and Linux uses
59
the opposite action: it steers when your default is Queue and queues when your
60
default is Steer.
@@ -204,15 +204,15 @@ Steer. Click it or press your send shortcut to use that action. Hold `Cmd` on ma
204
Windows and Linux to switch the button to the opposite action, then click, or use the opposite-action
205
shortcut described above.
206
207
-On web and desktop, queued messages appear at the end of the thread under **Up next**, as dashed
208
-messages that have not been sent yet. On mobile they appear above the composer. Each shows its text
209
-and any attached images. Drag a message by its handle to reorder it, use the handle's arrow keys,
210
-promote the message to a steer, or remove it.
207
+On web and desktop, queued messages appear at the end of the thread as dashed messages that have
208
+not been sent yet. On mobile they appear above the composer. Each shows its text and any attached
209
+images. **Send now** sends a message right away, into the running turn if there is one. You can
210
+also edit or remove it.
211
212
If you stop the agent or the server restarts, queued messages keep their order and are held.
213
Press **Resume** in an empty composer on web and desktop, or **Resume queue** on mobile, to
214
continue. Sending a new message also resumes the queue, unless it steers a turn that is already
215
-running. You can edit, reorder, or remove held messages without starting them.
215
+running. You can edit or remove held messages without starting them.
216
217
The pencil on a queued message opens it in the composer for editing. The original message
218
stays in the queue until you save, and it is highlighted while you edit. The message's
packages/client-runtime/src/operations/commands.ts
-17
@@ -229,11 +229,6 @@ export interface ResumeThreadQueueInput extends ThreadCommandInput {
229
readonly runId?: RunId;
230
}
231
232
-export interface ReorderQueuedRunInput extends ThreadCommandInput {
233
- readonly runId: RunId;
234
- readonly beforeRunId: RunId | null;
235
-}
236
-
232
export interface PromoteQueuedRunInput extends ThreadCommandInput {
233
readonly queuedRunId: RunId;
234
readonly targetRunId: RunId;
@@ -1064,18 +1059,6 @@ export const resumeThreadQueue = Effect.fn("EnvironmentCommands.resumeThreadQueu
1059
});
1060
});
1061
1067
-export const reorderQueuedRun = Effect.fn("EnvironmentCommands.reorderQueuedRun")(function* (
1068
- input: ReorderQueuedRunInput,
1069
-) {
1070
- return yield* dispatch({
1071
- type: "queued-run.reorder",
1072
- commandId: yield* allocateCommandId(input),
1073
- threadId: input.threadId,
1074
- runId: input.runId,
1075
- beforeRunId: input.beforeRunId,
1076
- });
1077
-});
1078
-
1062
export const promoteQueuedRun = Effect.fn("EnvironmentCommands.promoteQueuedRun")(function* (
1063
input: PromoteQueuedRunInput,
1064
) {
packages/client-runtime/src/state/threadCommands.ts
-9
@@ -29,7 +29,6 @@ import {
29
type ForkThreadFromRunInput,
30
type MergeThreadBackInput,
31
type PromoteQueuedRunInput,
32
- type ReorderQueuedRunInput,
32
type ResumeThreadQueueInput,
33
type LinkThreadPullRequestInput,
34
type RespondToThreadApprovalInput,
@@ -68,7 +67,6 @@ import {
67
markThreadUnread,
68
mergeThreadBack,
69
promoteQueuedRun,
71
- reorderQueuedRun,
70
resumeThreadQueue,
71
retryWorkspacePreparation,
72
linkThreadPullRequest,
@@ -115,7 +113,6 @@ export type {
113
ForkThreadFromRunInput,
114
MergeThreadBackInput,
115
PromoteQueuedRunInput,
118
- ReorderQueuedRunInput,
116
LinkThreadPullRequestInput,
117
RespondToThreadApprovalInput,
118
RespondToThreadUserInputInput,
@@ -398,12 +395,6 @@ export function createThreadEnvironmentAtoms<R, E>(
395
scheduler,
396
concurrency,
397
}),
401
- reorderQueuedRun: createEnvironmentCommand(runtime, {
402
- label: "environment-data:commands:thread:reorder-queued-run",
403
- execute: (input: ReorderQueuedRunInput) => reorderQueuedRun(input),
404
- scheduler,
405
- concurrency,
406
- }),
398
promoteQueuedRun: createEnvironmentCommand(runtime, {
399
label: "environment-data:commands:thread:promote-queued-run",
400
execute: (input: PromoteQueuedRunInput) => promoteQueuedRun(input),
packages/client-runtime/src/state/threadWorkflows.test.ts
+1
-2
@@ -65,7 +65,7 @@ describe("thread workflows", () => {
65
).toBe(false);
66
});
67
68
- it("sorts queued messages and gates reorder and promotion from capabilities", () => {
68
+ it("sorts queued messages and gates promotion from capabilities", () => {
69
const state = deriveThreadQueueWorkflowState({
70
thread: { id: "thread", activeProviderThreadId: "provider-thread" },
71
runs: [
@@ -133,7 +133,6 @@ describe("thread workflows", () => {
133
[],
134
]);
135
expect(state.activeRun?.id).toBe("active");
136
- expect(state.canReorder).toBe(true);
136
expect(state.canPromoteToSteer).toBe(true);
137
expect(state.canSendNow).toBe(false);
138
});
packages/client-runtime/src/state/threadWorkflows.ts
-2
@@ -32,7 +32,6 @@ export interface ThreadQueueWorkflowState {
32
readonly activeRun: Run | null;
33
readonly queuedRuns: ReadonlyArray<QueuedThreadRun>;
34
readonly isHeld: boolean;
35
- readonly canReorder: boolean;
35
readonly canPromoteToSteer: boolean;
36
readonly canSendNow: boolean;
37
}
@@ -155,7 +154,6 @@ export function deriveThreadQueueWorkflowState(projection: Projection): ThreadQu
154
activeRun,
155
queuedRuns,
156
isHeld: projection.runs.some((run) => run.status === "queued" && run.queueHeld === true),
158
- canReorder: capabilities?.supportsQueuedMessages === true,
157
canSendNow:
158
activeRun === null &&
159
projection.thread.archivedAt == null &&