Repository navigation
feat(search): synonyms for Sheet, Accordion, Textarea, Slider, Calendar and Command - #260
Merged
dgesteves merged 1 commit intoOct 30, 2026
Conversation
…ar and Command Six common shadcn/ui components had no entry in SYNONYMS, so "a range input", "a date field" and "a command palette" searched on the query's own words alone. `picker` pointed at Select only; it now reaches Calendar too. `avatar: ['avatar']` mapped the word to itself and did nothing, and is replaced by words that mean an avatar. `drawer`, `collapsible` and `sidebar` stay out: each is a component of its own, and a design system that has one should rank it on its name. Closes dgesteves#223
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #223.
What
search_componentsexpands everyday UI words into the names design systems use. Six common shadcn/ui components had no entry, so an agent searching for "a range input", "a date field" or "a command palette" got no help from synonyms:offcanvas,slideoverexpandable,faqmultilinerangedate,schedulepalette,cmdkprofile,initials,headshot,gravatarTwo fixes alongside them:
avatar: ['avatar']mapped the word to itself, whichexpandQueryalready covers at weight 1, so the entry did nothing. The four words above replace it.pickerreached Select only, so "date picker" pointed away from Calendar. It now reaches both.drawer,collapsibleandsidebarare shadcn/ui components of their own, so they stay out, as the issue asks: a design system that has one should rank it on its own name.Why these words
Keys are single words in their plain form, since
tokenizesplits a query into words, drops stop words and stems each one before the lookup. Every new key stems to something distinct, so none shadows an existing entry (expandable→expand,initials→initi,range→rang).Tests
test/search.test.tsgets two table-driven cases next to the existing synonym test:calendar)avatar,drawer,collapsibleandsidebarexpand to themselves only, which pins the constraint aboveThe end-to-end ranking tests are unchanged:
examples/shadcn-demohas Badge, Button, Card, Dialog and Input, so none of the new targets exists there to rank.Checks
pnpm lint,pnpm format:check,pnpm typecheckandpnpm test(1437 passed, 3 skipped) all pass locally. Patch changeset included. No docs change:docs/how-it-works.mddescribes the map without listing it.Out of scope, per the issue: ranking in
src/search/index.ts.