@devries-cameron20 / t3code Mirror · read-only / commits / 719a76ca1d
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 01:30 UTC

feat(web): choose queue or steer for follow-up messages (#11964)

Bilal Bakr committed Sep 16, 2026 at 00:29 UTC 719a76ca1dbf5490f1aa33ffb9966301e02be9a9
10 files changed +117 -7
apps/web/src/components/ChatView.tsx
+24 -5
@@ -6781,6 +6781,17 @@ export default function ChatView(props: ChatViewProps) {
6781 return;
6782 }
6783
6784 + if (command === "thread.steerQueuedMessage") {
6785 + const message = activeThreadKey
6786 + ? useQueuedMessageStore.getState().queuesByThreadKey[activeThreadKey]?.[0]
6787 + : undefined;
6788 + if (!message) return;
6789 + event.preventDefault();
6790 + event.stopPropagation();
6791 + if (!event.repeat) queuedMessageActionsRef.current.steer(message.id);
6792 + return;
6793 + }
6794 +
6795 if (command === "thread.stop") {
6796 // An unavailable command should not shadow contextual shortcuts such as Escape to close a dialog.
6797 if (!canInterruptRunningThread) return;
@@ -6810,6 +6821,7 @@ export default function ChatView(props: ChatViewProps) {
6821 activeThreadPinned,
6822 activeThreadSettled,
6823 canInterruptRunningThread,
6824 + activeThreadKey,
6825 terminalUiState.terminalOpen,
6826 terminalUiState.activeTerminalId,
6827 activeThreadId,
@@ -7497,11 +7509,13 @@ export default function ChatView(props: ChatViewProps) {
7509 );
7510 return;
7511 }
7500 - // A send during a running turn waits in the queue. It leaves on the next
7501 - // tool boundary, when the turn ends, or when the user clicks Steer. The
7502 - // provider treats a mid-turn send as a steer of the active turn, so the
7503 - // dispatch below is the same either way.
7504 - if (!queuedMessage && !directAnnotation && phase === "running" && activeThreadKey) {
7512 + if (
7513 + !queuedMessage &&
7514 + !directAnnotation &&
7515 + phase === "running" &&
7516 + activeThreadKey &&
7517 + settings.followUpBehavior === "queue"
7518 + ) {
7519 if (composerRef.current?.validateProviderInput(promptForSend) === false) {
7520 return;
7521 }
@@ -9501,6 +9515,11 @@ export default function ChatView(props: ChatViewProps) {
9515 loadEarlier={paintOnlyDisplayedTimeline ? null : loadEarlierTurns}
9516 queuedMessages={paintOnlyDisplayedTimeline ? EMPTY_QUEUED_MESSAGES : queuedMessages}
9517 onSteerQueuedMessage={onSteerQueuedMessage}
9518 + steerQueuedMessageShortcutLabel={shortcutLabelForCommand(
9519 + keybindings,
9520 + "thread.steerQueuedMessage",
9521 + { context: { terminalFocus: false } },
9522 + )}
9523 onRemoveQueuedMessage={onRemoveQueuedMessage}
9524 />
9525
apps/web/src/components/chat/MessagesTimeline.tsx
+11 -1
@@ -285,6 +285,7 @@ interface TimelineRowSharedState {
285 onWorktreeSetupWorkLocally: (() => void) | null;
286 onOpenWorktreeSetupTerminal: ((terminalId: string) => void) | null;
287 onSteerQueuedMessage: (id: string) => void;
288 + steerQueuedMessageShortcutLabel: string | null;
289 onRemoveQueuedMessage: (id: string) => void;
290 }
291
@@ -441,6 +442,7 @@ interface MessagesTimelineProps {
442 /** Messages sent during the running turn. They render as ghost bubbles after the live rows. */
443 queuedMessages?: ReadonlyArray<QueuedComposerMessage>;
444 onSteerQueuedMessage?: (id: string) => void;
445 + steerQueuedMessageShortcutLabel?: string | null;
446 onRemoveQueuedMessage?: (id: string) => void;
447 }
448
@@ -496,6 +498,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
498 loadEarlier = null,
499 queuedMessages = EMPTY_QUEUED_MESSAGES,
500 onSteerQueuedMessage = NOOP_QUEUED_MESSAGE_ACTION,
501 + steerQueuedMessageShortcutLabel = null,
502 onRemoveQueuedMessage = NOOP_QUEUED_MESSAGE_ACTION,
503 }: MessagesTimelineProps) {
504 const [expandedTurnIds, setExpandedTurnIds] = useState<ReadonlySet<TurnId>>(new Set());
@@ -940,6 +943,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
943 onWorktreeSetupWorkLocally: onWorktreeSetupWorkLocally ?? null,
944 onOpenWorktreeSetupTerminal: onOpenWorktreeSetupTerminal ?? null,
945 onSteerQueuedMessage,
946 + steerQueuedMessageShortcutLabel,
947 onRemoveQueuedMessage,
948 }),
949 [
@@ -972,6 +976,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
976 onWorktreeSetupWorkLocally,
977 onOpenWorktreeSetupTerminal,
978 onSteerQueuedMessage,
979 + steerQueuedMessageShortcutLabel,
980 onRemoveQueuedMessage,
981 ],
982 );
@@ -1564,7 +1569,12 @@ function QueuedMessageTimelineRow({
1569 >
1570 <ArrowUpIcon className="size-3.5" aria-hidden />
1571 </TooltipTrigger>
1567 - <TooltipPopup side="bottom">Send now</TooltipPopup>
1572 + <TooltipPopup side="bottom">
1573 + Send now
1574 + {row.isNext && ctx.steerQueuedMessageShortcutLabel
1575 + ? ` (${ctx.steerQueuedMessageShortcutLabel})`
1576 + : null}
1577 + </TooltipPopup>
1578 </Tooltip>
1579 <Tooltip>
1580 <TooltipTrigger
apps/web/src/components/settings/SettingsPanels.tsx
+46
@@ -578,6 +578,9 @@ export function useSettingsRestore(onRestored?: () => void) {
578 ...(settings.composerCollapseOnScroll !== DEFAULT_UNIFIED_SETTINGS.composerCollapseOnScroll
579 ? ["Collapse composer on scroll"]
580 : []),
581 + ...(settings.followUpBehavior !== DEFAULT_UNIFIED_SETTINGS.followUpBehavior
582 + ? ["Follow-up behavior"]
583 + : []),
584 ...(settings.contextWindowMeterEnabled !== DEFAULT_UNIFIED_SETTINGS.contextWindowMeterEnabled
585 ? ["Context window indicator"]
586 : []),
@@ -636,6 +639,7 @@ export function useSettingsRestore(onRestored?: () => void) {
639 settings.confirmThreadDelete,
640 settings.confirmThreadUnpin,
641 settings.composerCollapseOnScroll,
642 + settings.followUpBehavior,
643 settings.addProjectBaseDirectory,
644 settings.defaultThreadEnvMode,
645 settings.newWorktreesStartFromOrigin,
@@ -748,6 +752,7 @@ export function useSettingsRestore(onRestored?: () => void) {
752 proactivePanelsEnabled: DEFAULT_UNIFIED_SETTINGS.proactivePanelsEnabled,
753 showSkillsInSlashMenu: DEFAULT_UNIFIED_SETTINGS.showSkillsInSlashMenu,
754 composerCollapseOnScroll: DEFAULT_UNIFIED_SETTINGS.composerCollapseOnScroll,
755 + followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior,
756 contextWindowMeterEnabled: DEFAULT_UNIFIED_SETTINGS.contextWindowMeterEnabled,
757 environmentIdentificationMode: DEFAULT_UNIFIED_SETTINGS.environmentIdentificationMode,
758 glassOpacity: DEFAULT_UNIFIED_SETTINGS.glassOpacity,
@@ -2589,6 +2594,47 @@ export function GeneralSettingsPanel() {
2594 }
2595 />
2596
2597 + <SettingsRow
2598 + {...searchableSetting("follow-up-behavior")}
2599 + description="Queue follow-ups while the agent runs or steer the current turn."
2600 + resetAction={
2601 + settings.followUpBehavior !== DEFAULT_UNIFIED_SETTINGS.followUpBehavior ? (
2602 + <SettingResetButton
2603 + label="follow-up behavior"
2604 + onClick={() =>
2605 + updateSettings({
2606 + followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior,
2607 + })
2608 + }
2609 + />
2610 + ) : null
2611 + }
2612 + control={
2613 + <Select
2614 + value={settings.followUpBehavior}
2615 + onValueChange={(value) => {
2616 + if (value === "queue" || value === "steer") {
2617 + updateSettings({ followUpBehavior: value });
2618 + }
2619 + }}
2620 + >
2621 + <SelectTrigger size="sm" className="w-full sm:w-40" aria-label="Follow-up behavior">
2622 + <SelectValue>
2623 + {settings.followUpBehavior === "queue" ? "Queue" : "Steer"}
2624 + </SelectValue>
2625 + </SelectTrigger>
2626 + <SelectPopup align="end" alignItemWithTrigger={false}>
2627 + <SelectItem hideIndicator value="queue">
2628 + Queue
2629 + </SelectItem>
2630 + <SelectItem hideIndicator value="steer">
2631 + Steer
2632 + </SelectItem>
2633 + </SelectPopup>
2634 + </Select>
2635 + }
2636 + />
2637 +
2638 <SettingsRow
2639 serverScoped
2640 settingKeys={["enableProviderUpdateChecks"]}
apps/web/src/components/settings/settingsSearch.ts
+6
@@ -298,6 +298,12 @@ export const SETTINGS_SEARCH_ITEMS = [
298 to: "/settings/general",
299 searchTerms: ["composer rest resting scroll wheel conversation timeline shrink minimize"],
300 },
301 + {
302 + id: "follow-up-behavior",
303 + title: "Follow-up behavior",
304 + to: "/settings/general",
305 + searchTerms: ["queue steer running turn send default behavior composer"],
306 + },
307 {
308 id: "provider-update-checks",
309 title: "Provider update checks",
apps/web/src/keybindings.test.ts
+1
@@ -1119,6 +1119,7 @@ describe("composer and pull request shortcuts", () => {
1119 ["l", "composer.previousWorktree"],
1120 ["c", "thread.copyReference"],
1121 ["k", "pullRequest.copyNumber"],
1122 + ["Enter", "thread.steerQueuedMessage"],
1123 ] as const;
1124
1125 for (const platform of ["MacIntel", "Win32", "Linux"]) {
docs/user/composer.md
+10 -1
@@ -31,12 +31,21 @@ See [images and videos](#images-and-videos-in-messages) for previewing and savin
31
32 ## Send while the agent is working
33
34 -A message sent during a running turn waits at the end of the conversation as a
34 +On web and desktop, a message sent during a running turn waits at the end of the conversation as a
35 dashed bubble. It goes out on its own when the agent finishes its next tool
36 call, or when the turn ends. Use the arrow under the bubble to send it right
37 away, or the X to move it back into the composer. Stop returns every queued
38 message to the composer.
39
40 +In **Settings → General → Follow-up behavior**, choose **Queue** to keep this
41 +behavior or **Steer** to send new messages immediately. This setting applies to
42 +the current client. Messages already queued keep their place.
43 +
44 +Use `Cmd+Shift+Enter` on macOS or `Ctrl+Shift+Enter` on Windows and Linux to send
45 +the oldest queued message now. Change `thread.steerQueuedMessage` in
46 +**Settings → Keybindings** to use another shortcut. It leaves the current draft
47 +in the composer and waits if the agent needs an approval or an answer.
48 +
49 ## Queue messages offline on mobile
50
51 Mobile keeps local copies of draft attachments, so you can preview them and queue
packages/contracts/src/keybindings.ts
+1
@@ -36,6 +36,7 @@ export type ModelPickerJumpKeybindingCommand =
36
37 const THREAD_KEYBINDING_COMMANDS = [
38 "thread.stop",
39 + "thread.steerQueuedMessage",
40 "thread.previous",
41 "thread.next",
42 "thread.copyReference",
packages/contracts/src/settings.test.ts
+13
@@ -529,6 +529,19 @@ describe("ClientSettings context window meter", () => {
529 });
530 });
531
532 +describe("ClientSettings follow-up behavior", () => {
533 + it("defaults to queue and accepts either behavior", () => {
534 + expect(decodeClientSettings({}).followUpBehavior).toBe("queue");
535 + for (const followUpBehavior of ["queue", "steer"]) {
536 + expect(decodeClientSettings({ followUpBehavior }).followUpBehavior).toBe(followUpBehavior);
537 + expect(decodeClientSettingsPatch({ followUpBehavior }).followUpBehavior).toBe(
538 + followUpBehavior,
539 + );
540 + }
541 + expect(() => decodeClientSettingsPatch({ followUpBehavior: "invalid" })).toThrow();
542 + });
543 +});
544 +
545 describe("ClientSettings composer collapse", () => {
546 it("collapses on scroll by default and accepts opting out", () => {
547 expect(decodeClientSettings({}).composerCollapseOnScroll).toBe(true);
packages/contracts/src/settings.ts
+4
@@ -430,6 +430,9 @@ export const ClientSettingsSchema = Schema.Struct({
430 // Desktop resting composer: scrolling an existing thread's conversation
431 // settles the composer into its single-line layout. Losing focus never does.
432 composerCollapseOnScroll: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
433 + followUpBehavior: Schema.Literals(["queue", "steer"]).pipe(
434 + Schema.withDecodingDefault(Effect.succeed("queue")),
435 + ),
436 proactivePanelsEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
437 showSkillsInSlashMenu: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
438 // Legacy sidebar (the original per-project tree). Deliberately a fresh key
@@ -1499,6 +1502,7 @@ export const ClientSettingsPatch = Schema.Struct({
1502 planModeEnabled: Schema.optionalKey(Schema.Boolean),
1503 contextWindowMeterEnabled: Schema.optionalKey(Schema.Boolean),
1504 composerCollapseOnScroll: Schema.optionalKey(Schema.Boolean),
1505 + followUpBehavior: Schema.optionalKey(Schema.Literals(["queue", "steer"])),
1506 proactivePanelsEnabled: Schema.optionalKey(Schema.Boolean),
1507 showSkillsInSlashMenu: Schema.optionalKey(Schema.Boolean),
1508 legacySidebarEnabled: Schema.optionalKey(Schema.Boolean),
packages/shared/src/keybindings.ts
+1
@@ -40,6 +40,7 @@ export const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule> = [
40 { key: "mod+shift+f", command: "projectSearch.toggle", when: "!terminalFocus" },
41 { key: "mod+alt+shift+t", command: "themeEditor.toggle" },
42 { key: "mod+s", command: "composer.stash", when: "!terminalFocus" },
43 + { key: "mod+shift+enter", command: "thread.steerQueuedMessage", when: "!terminalFocus" },
44 { key: "mod+n", command: "chat.new", when: "!terminalFocus" },
45 { key: "mod+shift+o", command: "chat.new", when: "!terminalFocus" },
46 { key: "mod+shift+n", command: "chat.newLocal", when: "!terminalFocus" },