Skip to content

fix(search): stop cmd+k boosts from lifting weaker matches over stronger ones - #6668

Open
j15z wants to merge 1 commit into
stagingfrom
fix/cmdk-trigger-ranking
Open

fix(search): stop cmd+k boosts from lifting weaker matches over stronger ones#6668
j15z wants to merge 1 commit into
stagingfrom
fix/cmdk-trigger-ranking

Conversation

@j15z

@j15z j15z commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • typing a trigger's full name ("gmail", "slack") vaulted the trigger row above the block itself: the exact-base-name lift to PAGE_MATCH_TIER now applies only when no canvas block/tool shares the trigger's base name — for shared names the trigger ranks organically and the block's exact-name match wins, matching what partial queries already did
  • single-letter queries surfaced actions that merely contain the letter ("Create folder" for "a", "New chat" for "h") above rows that start with it: ACTION_MATCH_BIAS now applies only when the action's name match begins at a word start — a mid-word hit keeps its honest score, so word-start matches outrank it
  • core triggers with unique names ("Start", "Schedule") and word-start action matches ("Deploy workflow" for "d") keep their boosts unchanged

Type of Change

  • Bug fix

Testing

  • 4 new tests: block above same-name trigger for the exact-name query, prefix rows above mid-word actions, and utils-level score assertions for the bias gate; all 71 search-modal suite tests pass
  • type-check, lint, and check:audits clean

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)

@vercel

vercel Bot commented Aug 13, 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 13, 2026 6:47pm

Request Review

@cursor

cursor Bot commented Aug 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Search ranking only in the command palette; no auth, data, or API changes. Regression risk is limited to cmd+k result order.

Overview
Fixes cmd+k ranking where score boosts pushed weaker matches above stronger ones.

Triggers vs blocks/tools: The exact-name lift to PAGE_MATCH_TIER for triggers now applies only when no block or tool shares the trigger’s base name (e.g. Gmail, Slack). Shared names keep natural scores so the block/tool’s exact match stays first.

Actions: ACTION_MATCH_BIAS is applied only when the action name match starts at a word boundary (via isWordStartMatch). Mid-word hits like h in “New chat” or a in “Create folder” keep their raw scores so prefix entity rows (e.g. Hex, Airtable) rank above them. Word-start action matches and exactQueries behavior are unchanged.

Four tests cover modal ordering and utils-level score comparisons.

Reviewed by Cursor Bugbot for commit 3f496a9. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refines command-palette scoring so same-name blocks outrank their triggers and mid-word action matches no longer leapfrog word-start results.

  • Disables the exact-trigger lift when an available block or tool has the same display name.
  • Applies the action bias only to word-start name matches, while preserving exact-query and section-level lifts.
  • Adds component and utility tests for both ranking corrections.

Confidence Score: 5/5

The PR appears safe to merge, with the changed ranking behavior covered by focused component and utility tests.

The collision check operates only on available block and tool rows, and the action-bias gate preserves exact-query, section-level, keyword-only, and word-start behavior while correcting the targeted weaker matches.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx Builds an available block/tool name set and uses it to prevent same-name triggers from receiving an inappropriate exact-query lift.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/utils.ts Adds word-boundary detection so action bias is withheld for mid-word visible-name matches while existing exact and section lifts remain intact.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.test.tsx Adds integration coverage for same-name trigger ordering and single-letter mid-word action ranking.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/utils.test.ts Adds score-level assertions covering both withheld and retained action bias.

Reviews (1): Last reviewed commit: "fix(search): stop cmd+k boosts from lift..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant