feat(desktop): show "esc" keyboard shortcut on stop button

This commit is contained in:
ethernet 2026-07-23 01:52:49 -04:00
parent 742ecb527a
commit 34a72c3683
3 changed files with 13 additions and 4 deletions

View file

@ -65,6 +65,12 @@ describe('ComposerControls shortcut tooltips', () => {
await expectShortcutTooltip('Send', '↵')
})
it('shows Esc for Stop', async () => {
renderControls({ busy: true, busyAction: 'stop' })
await expectShortcutTooltip('Stop', 'Esc')
})
it('shows Enter for Steer', async () => {
renderControls({ busy: true, busyAction: 'steer' })

View file

@ -121,8 +121,8 @@ export function ComposerControls({
? 'composer.steer'
: busyAction === 'queue'
? 'composer.queue'
: 'composer.send'}
combo="enter"
: 'composer.stop'}
combo={busyAction === 'stop' ? 'escape' : 'enter'}
text={busyLabel}
/>
) : (

View file

@ -107,8 +107,11 @@ export function ChatBar({
// focus-bus key, and awaiting-input edge. Main scope = the legacy globals.
const scope = useComposerScope()
const { data: configRecord } = useHermesConfigRecord()
const config = configRecord?.config as { display?: { busy_input_mode?: unknown } } | undefined
const busyInputMode = normalizeBusyInputMode(config?.display?.busy_input_mode)
// /api/config returns the config record itself (not wrapped in { config: … }),
// so read display.busy_input_mode directly off the record.
const busyInputMode = normalizeBusyInputMode(
(configRecord as { display?: { busy_input_mode?: unknown } } | undefined)?.display?.busy_input_mode
)
const attachments = useStore(scope.attachments.$attachments)
const compacting = useStore($compactionActive)
const scrolledUp = useStore($threadScrolledUp)