Skip to content

The agent that grows with you

fix(desktop): a waiting card keeps Stop on an empty draft; typed text still sends as its answer

alt-glitch6fc6664a2d8e
diff --git a/apps/desktop/src/app/chat/composer/controls.test.tsx b/apps/desktop/src/app/chat/composer/controls.test.tsx
index e2575bd66b6..49724a29dab 100644
--- a/apps/desktop/src/app/chat/composer/controls.test.tsx
+++ b/apps/desktop/src/app/chat/composer/controls.test.tsx
@@ -153,6 +153,20 @@ describe('ComposerControls shortcut tooltips', () => {
await expectShortcutTooltip('Stop', '↵')
})
+ it('answers a waiting card with Send when the draft has text, and offers no Queue', () => {
+ renderControls({ busy: true, busyAction: 'queue', cardWaiting: true, hasComposerPayload: true })
+
+ expect(screen.getByLabelText('Send')).toBeTruthy()
+ expect(screen.queryByLabelText('Stop')).toBeNull()
+ expect(screen.queryByLabelText('Queue message')).toBeNull()
+ })
+
+ it('keeps Stop enabled while a card waits and the draft is empty', () => {
+ renderControls({ busy: true, busyAction: 'stop', canSubmit: true, cardWaiting: true, hasComposerPayload: false })
+
+ expect(screen.getByLabelText('Stop').hasAttribute('disabled')).toBe(false)
+ })
+
it('shows Ctrl+Enter for Queue as the secondary mid-turn action', async () => {
renderControls({ busy: true, busyAction: 'queue' })
diff --git a/apps/desktop/src/app/chat/composer/controls.tsx b/apps/desktop/src/app/chat/composer/controls.tsx
index 5f7a124361a..851eb2ee35b 100644
--- a/apps/desktop/src/app/chat/composer/controls.tsx
+++ b/apps/desktop/src/app/chat/composer/controls.tsx
@@ -58,7 +58,7 @@ export function ComposerControls({
busy: boolean
busyAction: 'steer' | 'queue' | 'stop'
canSubmit: boolean
- /** A card parked on the session takes typed text as its answer, so the button sends rather than stops. */
+ /** A card parked on the session takes typed text as its answer, so queueing that text would leave the card waiting. */
cardWaiting?: boolean
compactModelPill?: boolean
conversation: ConversationProps
@@ -82,10 +82,10 @@ export function ComposerControls({
}
const showVoicePrimary = !busy && !hasComposerPayload
- // Steer is just send: a payload keeps the Send affordance mid-turn. Stop
- // only when the composer is empty and a turn is running.
- const showStop = busy && !hasComposerPayload && !cardWaiting
- const showQueueButton = busy && busyAction !== 'stop' && hasComposerPayload
+ // Steer is just send: a payload keeps the Send affordance mid-turn (it answers
+ // a waiting card). Stop only when the composer is empty and a turn is running.
+ const showStop = busy && !hasComposerPayload
+ const showQueueButton = busy && busyAction !== 'stop' && hasComposerPayload && !cardWaiting
// The HUD is a Spotlight bar a few hundred pixels wide, so the four separate
// voice toggles fold into one menu there and leave the row to the input. A
// narrow tile hits the same wall from the other direction and folds for the
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-card-waiting-submit.ts b/apps/desktop/src/app/chat/composer/hooks/use-card-waiting-submit.ts
index a096786bb08..22a8513ff81 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-card-waiting-submit.ts
+++ b/apps/desktop/src/app/chat/composer/hooks/use-card-waiting-submit.ts
@@ -3,9 +3,9 @@ import { useMemo } from 'react'
import { sessionParkedCardWaiting } from '@/store/parked-card-answers'
-/** A waiting card turns the stop button into send, which has nothing to send while the draft is empty. */
+/** Typed text answers a waiting card through Send; an empty draft still offers Stop, card or not. */
export function useCardWaitingSubmit(sessionId: null | string, busy: boolean, hasPayload: boolean) {
const cardWaiting = useStore(useMemo(() => sessionParkedCardWaiting(sessionId), [sessionId]))
- return { canSubmit: (busy && !cardWaiting) || hasPayload, cardWaiting }
+ return { canSubmit: busy || hasPayload, cardWaiting }
}