Skip to content

fix(search): prioritize actions and prevent palette clipping - #6816

Merged
waleedlatif1 merged 6 commits into
stagingfrom
fix/show-new-chat-first
Aug 18, 2026
Merged

fix(search): prioritize actions and prevent palette clipping#6816
waleedlatif1 merged 6 commits into
stagingfrom
fix/show-new-chat-first

Conversation

@j15z

@j15z j15z commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Show New chat first for the exact chats query
  • On the workflow editor, rank an exact block match (for example, Logs) ahead of the matching page and individual results
  • Keep the command palette inside constrained viewports and preserve leading glyphs at low browser zoom without shifting input alignment

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Manually verified the leading-glyph fix in the affected real-browser zoom condition
  • 27 focused command-palette Vitest tests
  • bun run type-check in apps/sim
  • bun run lint:check
  • bun run check:audits (29 audits)

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)

Screenshots/Videos

Not included; the rendering regression depended on low browser zoom and was verified in the affected browser environment.

@vercel

vercel Bot commented Aug 18, 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 18, 2026 10:29pm

Request Review

@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only search modal ranking, layout, and styling with added tests; no auth, data, or API changes.

Overview
Improves command palette ranking so primary actions and exact block matches surface first: New chat ranks at the top when the query is chats (via exactQueries and keyword updates), and on the workflow editor an exact block name (e.g. Logs) appears before its page row and child log entries by boosting block scores to PAGE_MATCH_TIER.

Layout and polish on narrow viewports: the search dialog width uses min(500px, calc(100% - 32px)) and left is clamped with PALETTE_HALF_WIDTH so a 16px gutter remains and adornments/empty state are not clipped off-screen. The result list max-height caps at min(448px, calc(85dvh - 26px)) so keyboard navigation keeps the selection visible. Command search input adds matching -ml-1 / indent-1 for Chrome’s input clip edge.

Vitest coverage extends to input classes, workflow Logs ordering, and New chat first for the chats query.

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

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adjusts command-palette ranking to prioritize primary actions for exact module and block searches.

  • Promotes “New chat” above chat records for the exact “chats” query.
  • Promotes exact block-name matches to the page-match tier so blocks precede matching pages and their contents.
  • Adds focused tests covering both ordering behaviors.

Confidence Score: 5/5

The PR appears safe to merge, with the intended command-palette ordering covered by focused tests.

Exact chat and block queries are promoted through the existing ranking tiers, and the resulting stable ordering puts the intended primary actions ahead of related records and pages without changing unrelated search paths.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx Adds the “chats” exact query and promotes exact block-name matches using the established ranking tiers without exposing a concrete regression.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.test.tsx Adds focused coverage confirming that New chat and exact block actions precede their associated entity results.

Reviews (1): Last reviewed commit: "fix(search): prioritize exact blocks on ..." | Re-trigger Greptile

The palette dialog was a fixed 500px box centered over the content area
(offset right by the sidebar, and the panel on the canvas), so narrow
windows pushed it past the right edge — clipping the Ask Sim adornment
and the empty state. Its 448px list could also extend below the fold on
short windows, where cmdk aligns the selected row against the off-screen
bottom edge: the selection parked below the viewport and held arrow keys
juddered rows against an edge the user could not see.

Clamp the centered left position to a 16px gutter, shrink the width once
the viewport is narrower than the dialog plus gutters, and cap the list
height so the whole dialog stays on-screen.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inputs clip glyph ink at their padding box, and the palette input had no
left padding, so a leading glyph whose ink reaches its pen origin (the
brand font's j) lost its left edge — worst at low browser zoom, where
the clip boundary snaps to whole device pixels and eats up to 2 CSS px
of the first letter. Give the input 3px of left ink clearance with a
compensating negative margin so the text keeps its exact alignment with
the result-row titles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Chrome clips input text at the content box, not the padding box, so the
previous padding-based clearance was dead space — glyph ink still
started exactly at the clip edge, and the first letter kept losing its
left edge under low browser zoom. text-indent starts the text 3px
inside the clip region, which is clearance the renderer can actually
paint into; the compensating negative margin keeps the text aligned
with the result-row titles as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@j15z j15z changed the title fix(search): prioritize primary command palette actions fix(search): prioritize actions and prevent palette clipping Aug 18, 2026
@waleedlatif1
waleedlatif1 merged commit cb3b93e into staging Aug 18, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/show-new-chat-first branch August 18, 2026 23:24
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.

2 participants