GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@j15z

@j15z j15z commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix

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
All reactions
  • 👍 1 reaction
@j15z
fix(cmdk): keep the first result focused and the top fog stable acros…
a12d177
…s re-ranks
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 6:39pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Aug 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@j15z
j15z merged commit 7c2ba46 into staging Aug 12, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@j15z
j15z deleted the fix/cmdk-current-selection-bug branch August 12, 2026 18:50
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 12, 2026
v0.8.1: grok 4.6, v2 endpoints extension, workflow UI improvements, logrocket, perf improvements #6646
Merged

This branch was previously deployed

1 inactive deployment
Preview — a12d1776 Deployed Aug 12, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@j15z
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.