GeezerVison is showing github.com — fix(chat): focus the composer when opening a new or existing chat by waleedlatif1 · Pull Request #6683 · simstudioai/sim
Conversation
Summary
- Clicking "New chat" or opening a chat from the sidebar left focus on the link, so the composer's mount-time focus was skipped and you had to click into the textarea before typing
- The mount effect only focused when
document.activeElement was body/documentElement; it now focuses unless the active element is a real text-entry field (input/textarea/select/contenteditable), so it takes focus from a link or button but never steals it from another field
Type of Change
Testing
Tested manually
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
docs |
Skipped |
|
Aug 13, 2026 11:15pm |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Aug 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Low Risk
Localized UX/focus behavior in the chat composer with no auth, data, or API changes.
Overview
Opening a chat from the sidebar or New chat often left focus on the clicked link, so the composer mount logic did not move focus and users had to click the textarea before typing.
The mount-time focus effect in user-input.tsx no longer only runs when activeElement is body/documentElement. It now focuses the composer whenever the page has focus unless the active element is a real text-entry target (input, textarea, select, or contenteditable), via a new isTextEntry helper. Sidebar links and buttons are overridden; other fields are not.
Reviewed by Cursor Bugbot for commit f45c396. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
The PR updates the chat composer’s mount-time focus behavior so opening a new or existing chat transfers focus from sidebar links or buttons while preserving focus in active text-entry fields.
- Adds a helper recognizing inputs, textareas, selects, and contenteditable elements.
- Retains the document-focus guard and focuses the composer on the next animation frame when no text-entry field owns focus.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified.
The changed focus effect preserves focus for active native and contenteditable fields while correctly transferring focus from the sidebar control during the reachable composer remount flow.
Important Files Changed
| Filename |
Overview |
| apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx |
Broadens composer autofocus from neutral document focus to non-text-entry controls without revealing a concrete regression in current mounting paths. |
Reviews (1): Last reviewed commit: "fix(chat): focus the composer when openi..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|