Skip to content

feat(search): synonyms for Sheet, Accordion, Textarea, Slider, Calendar and Command - #260

Merged
dgesteves merged 1 commit into
dgesteves:mainfrom
kasettadoo-sys:feat/search-synonyms-missing-components
Oct 30, 2026
Merged

dgesteves merged 1 commit into
dgesteves:mainfrom
kasettadoo-sys:feat/search-synonyms-missing-components

Conversation

@kasettadoo-sys

Copy link
Copy Markdown
Contributor

Closes #223.

What

search_components expands 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:

Component Words added
Sheet offcanvas, slideover
Accordion expandable, faq
Textarea multiline
Slider range
Calendar date, schedule
Command palette, cmdk
Avatar profile, initials, headshot, gravatar

Two fixes alongside them:

  • avatar: ['avatar'] mapped the word to itself, which expandQuery already covers at weight 1, so the entry did nothing. The four words above replace it.
  • picker reached Select only, so "date picker" pointed away from Calendar. It now reaches both.

drawer, collapsible and sidebar are 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 tokenize splits 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.ts gets two table-driven cases next to the existing synonym test:

  • each new word reaches its component at the 0.5 synonym weight, through a query an agent would write ("a date field" → calendar)
  • avatar, drawer, collapsible and sidebar expand to themselves only, which pins the constraint above

The end-to-end ranking tests are unchanged: examples/shadcn-demo has Badge, Button, Card, Dialog and Input, so none of the new targets exists there to rank.

Checks

pnpm lint, pnpm format:check, pnpm typecheck and pnpm test (1437 passed, 3 skipped) all pass locally. Patch changeset included. No docs change: docs/how-it-works.md describes the map without listing it.

Out of scope, per the issue: ranking in src/search/index.ts.

…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
@dgesteves
dgesteves merged commit be144d6 into dgesteves:main Oct 30, 2026
15 checks passed
@dgesteves-release dgesteves-release Bot mentioned this pull request Oct 30, 2026
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.

search_components has no synonyms for Sheet, Slider, Command and more

2 participants