GeezerVison is showing github.com — fix(cmdk): keep the first result focused and the top fog stable across re-ranks by j15z · Pull Request #6635 · simstudioai/sim
Conversation
Summary
- CMD+K ranks against the deferred query, but cmdk re-anchors selection against the stale rows still in the DOM. When the re-ranked list lands, the old pick either stays selected mid-list or dangles on an unmounted row (cmdk only self-heals when the selected row is the last one removed), so the first visible result wasn't focused and Enter did nothing ("fun" → "func"). Now a re-anchor effect selects the first row once the re-ranked list commits.
- The palette's top/bottom fog stops were percentages of the list's height, and the list shrinks to its content — so the fog band physically moved whenever the result count changed, flashing over the dark selected first row ("run" → "run wo"). Stops are now pixel-anchored, frozen at the tuned 448px max-height look, so the fog is identical at every list height. The canvas selector keeps percentage stops on purpose (fixed-height card).
Type of Change
Testing
- New regression test reproduces the dangling-selection race deterministically (fails without the fix)
- All 66 search-modal tests pass; command-chrome test pins the pixel-anchored mask
- lint, check:audits (25/25), and type-check pass
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 12, 2026 6:39pm |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Aug 12, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Low Risk
UI-only search modal and command chrome styling/selection behavior with targeted regression tests; no auth, data, or API changes.
Overview
Fixes CMD+K keyboard and visual glitches tied to deferred search ranking and a content-sized result list.
When results re-rank after the deferred query commits, cmdk can keep a stale selection (mid-list or on a removed row), so Enter may do nothing. A useEffect on deferredSearch dispatches Home on the search input to re-select the first visible row once the ranked list matches the query.
The palette list fade mask switches from percentage stops to pixel stops (36px / 58px / bottom exit), so the top fog no longer shifts when result count changes. Canvas search keeps percentage masks on the fixed-height card. Tests cover the new mask classes and the fun → func selection race.
Reviewed by Cursor Bugbot for commit a12d177. Bugbot is set up for automated code reviews on this repo. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
The PR fixes command-palette selection after deferred search re-ranking and stabilizes the palette fade as result counts change.
- Re-anchors selection to the first result after each deferred query commits.
- Replaces percentage-based palette mask stops with pixel-anchored stops.
- Adds regression coverage for re-ranked selection and the updated mask classes.
Confidence Score: 5/5
The PR appears safe to merge with no concrete blocking or non-blocking issues identified.
The deferred-query effect restores first-row selection after re-ranking, and the revised mask geometry remains valid for the palette’s minimum list sizes.
Important Files Changed
| Filename |
Overview |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx |
Adds a post-commit effect that sends Home to cmdk after deferred search results re-rank; no actionable defect was established. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.test.tsx |
Adds regression coverage confirming that a narrowed, re-ranked result list selects its first row. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-chrome/command-chrome.tsx |
Anchors the palette fade to fixed pixel offsets while retaining percentage stops for the fixed-height canvas variant. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-chrome/command-chrome.test.tsx |
Updates the command-chrome assertion to pin the new pixel-based mask configuration. |
Reviews (1): Last reviewed commit: "fix(cmdk): keep the first result focused..." | 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.
|