When the user clicks the Stop generating (cancel) button, focus stays on that button. The button then transitions to a spinner and back into the send button — and if there's no text in the input, the send button is disabled, so focus falls back to <body>.
After cancelling a stream the user typically wants to type a follow-up, so focus should move into the textarea instead.
Suggested fix: focus the textarea when cancelStream runs (js/src/chat/ChatContainer.tsx, around line 134).
Noticed while working on a file-upload branch, but this is pre-existing behavior unrelated to uploads, so filing separately.
When the user clicks the Stop generating (cancel) button, focus stays on that button. The button then transitions to a spinner and back into the send button — and if there's no text in the input, the send button is
disabled, so focus falls back to<body>.After cancelling a stream the user typically wants to type a follow-up, so focus should move into the textarea instead.
Suggested fix: focus the textarea when
cancelStreamruns (js/src/chat/ChatContainer.tsx, around line 134).Noticed while working on a file-upload branch, but this is pre-existing behavior unrelated to uploads, so filing separately.