Uh oh!
There was an error while loading. Please reload this page.
fix(search): restore cmd+k autofocus on the search input - #6347
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The focus Reviewed by Cursor Bugbot for commit 0556297. Configure here. |
Greptile SummaryThis PR restores Cmd+K autofocus by delaying the search-input focus effect until the dialog is visibly open.
Confidence Score: 5/5The PR appears safe to merge, with the autofocus effect now aligned to the dialog’s visible lifecycle. The focus effect waits for
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx | Aligns input focus with the modal’s visible state, without introducing an actionable lifecycle or repository-rule issue. |
Reviews (1): Last reviewed commit: "fix(search): restore cmd+k autofocus on ..." | Re-trigger Greptile
Summary
5ab5f2c7e): the dialog's visibility gate moved tovisuallyOpen(open && nativeSurfaceReady), but the focus effect stayed on a separatefocusReadygate that is justopenoff the desktop appnativeSurfaceReadystartsfalseand only flips inside auseLayoutEffect, so the focus effect ran in the commit where the panel still carriedinvisible—.focus()on avisibility: hiddenelement is a silent no-op, and nothing re-focused it afterwardsvisuallyOpen, so it runs on the first commit where the panel is actually visible. Desktop (atomic browser panel occlusion) already waited for that same signal, so its behavior is unchangedType of Change
Testing
Typecheck and lint pass. Not yet verified in a running browser — needs a manual Cmd+K check before merge.
No unit test: the failure depends on
visibility: hiddenmaking an element unfocusable, which jsdom does not model (it applies no Tailwind CSS), so a test here would pass with or without the fix.Checklist