fix(ui): auto-focus chat input on Hub mount#8007
Merged
DOsinga merged 2 commits intoaaif-goose:mainfrom Mar 20, 2026
Merged
Conversation
The textarea has autoFocus but it's unreliable across the async render chain (lazy App → Suspense → OnboardingGuard). Users had to press Tab ~12 times through nav buttons and session cards to reach the input. Add a useEffect with requestAnimationFrame that imperatively focuses the textarea after the Hub component mounts, so typing works immediately on launch.
DOsinga
approved these changes
Mar 20, 2026
Collaborator
DOsinga
left a comment
There was a problem hiding this comment.
Clean fix — mirrors the existing pattern in BaseChat. Collapsed the comment to one line.
Signed-off-by: Douwe Osinga <douwe@squareup.com>
elijahsgh
pushed a commit
to elijahsgh/goose
that referenced
this pull request
Mar 21, 2026
Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com> Signed-off-by: esnyder <elijah.snyder1@gmail.com>
elijahsgh
pushed a commit
to elijahsgh/goose
that referenced
this pull request
Mar 21, 2026
Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com> Signed-off-by: esnyder <elijah.snyder1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a new Goose window requires ~12 Tab presses to reach the chat input. The textarea has
autoFocusbut it's unreliable across the async render chain:By the time the textarea mounts and
autoFocusfires, focus can be lost to re-renders or stolen by earlier elements in the tab order (7 nav buttons + session insight cards).Related: #5039 — the original input-disabled bug was fixed, but the render chain change that fixed it introduced this focus regression. Different root cause (focus timing vs disabled state), same UX priority: the input must be ready to type on window open.
Fix
Pass an
inputReffrom Hub to ChatInput and imperatively focus it viauseEffect+requestAnimationFrameafter mount. This fires after the DOM has fully painted, making it reliable regardless of the async render chain.1 file changed, +15 −1 lines.
Testing
tsc --noEmit✅eslint src/components/Hub.tsx✅