Skip to content

feat(registry): let components declare a description - #71

Open
oliver-mee wants to merge 1 commit into
danielpetho:mainfrom
oliver-mee:feat/component-descriptions
Open

feat(registry): let components declare a description#71
oliver-mee wants to merge 1 commit into
danielpetho:mainfrom
oliver-mee:feat/component-descriptions

Conversation

@oliver-mee

Copy link
Copy Markdown

Summary

Every registry item was published with a placeholder description. public/r/registry.json had 158 items sharing four distinct strings, because generateRegistryItem had nowhere to read a description from and the build falls back to A ${type} component.

Since the shadcn CLI ranks search across descriptions as well as titles, that made the registry reachable only by exact component name, which is the hardest thing to guess for visual effects.

This reads description from the sidecar .json next to each component, the file that already carries cssVars and additionalDependencies, following the existing pattern in generateRegistryItem. Two lines of wiring:

  • description: z.string().optional() on registrySchema
  • ...(additionalConfig?.description && { description: additionalConfig.description })

The existing fallback is untouched, so anything without a description behaves exactly as before.

Also adds a description for all 45 components under src/fancy/components. Each was written by reading that component's source and its demo, not its filename, and each names the distinguishing behaviour so search can separate neighbours (the four letter-swap variants, for example).

The 99 demo entries keep the placeholder. They could inherit from their parent component, but that felt like a separate change and I did not want to bundle it.

Linked issue

Fixes #70

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • Refactor or cleanup (no behaviour change)
  • Documentation
  • CI, tooling, or config

How to test

  1. npm run build:registry
  2. Check the output: cat public/r/registry.json | jq '[.items[].description] | unique | length' goes from 4 to 47.
  3. Serve public/ and point the CLI at it, then search by behaviour rather than by name:
$ shadcn search @fancy -q "text that follows the cursor"
- @fancy/text-along-path (ui) - Renders text following a custom SVG path, animating its position along the...
- @fancy/variable-font-cursor-proximity (ui) - Interpolates each letter's variable font axes individually based on...

$ shadcn search @fancy -q "physics simulation with draggable elements"
- @fancy/cursor-attractor-and-gravity (ui) - Runs a Matter.js physics simulation where draggable DOM elements are...

$ shadcn search @fancy -q "letters scatter on hover"
- @fancy/letter-3d-swap (ui) - On hover, flips each letter as a 3D cube face to reveal a second character...
- @fancy/random-letter-swap-pingpong-anim (ui) - On hover, slides letters in a randomized order to reveal duplicates...

Before this change all three queries return nothing useful.

Checklist

  • One concern only, scope limited to the summary above
  • I ran it and verified end to end (or explained below why that does not apply)

CONTRIBUTING asks for a recording. I have not attached one, since nothing here is visual: no component or demo changes, only registry metadata. The CLI output above is the equivalent evidence. Happy to record something if you would still like it.

Two notes on scope. I deliberately did not run prettier --write across the two source files: the committed versions do not currently pass format:check, so formatting them would have buried a four line change in a few hundred lines of reflow. The only formatting that moved is in two physics sidecars, which gained a trailing newline and 2 space indentation to match the other sidecars.

Model used

Claude Opus 5 via Claude Code for the wiring and review. The component descriptions were drafted by Claude Sonnet 5 reading each component's source, then reviewed against the source before committing.


🤖 Generated with Claude Code (Claude Opus 5)
🧑‍💻 Ideated, directed and reviewed by a human, @oliver-mee

Every published registry item carried a placeholder description, because
build-registry-index.ts falls back to `A ${type} component.` and there was
nowhere to declare anything else. 158 items shared four description strings.

The shadcn CLI ranks search across descriptions as well as titles, so this made
the registry reachable only by exact component name, which is the hardest thing
to guess for visual effects.

Read `description` from the sidecar .json next to each component, the same file
that already carries cssVars and additionalDependencies, following the existing
pattern in generateRegistryItem. The fallback is untouched, so anything without
a description behaves as before.

Adds a description for all 45 components under src/fancy/components, written
from each component's source and its demo. The 99 demo entries keep the
placeholder.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@oliver-mee is attempting to deploy a commit to the Fancy Components Team on Vercel.

A member of the Team first needs to authorize it.

@oliver-mee

Copy link
Copy Markdown
Author

One thing worth flagging that came out of writing these.

blocks/simple-carousel.tsx and blocks/simple-marquee.tsx are the same component. Both define const SimpleMarquee, both end with export default SimpleMarquee, and they differ by 9 lines, all in how the scroll container ref is resolved. simple-carousel.tsx is not a carousel.

So those two items get identical descriptions in this PR, which otherwise looks like a copy-paste slip on my side. I described what the code does rather than what the filename suggests, since a "carousel" description would send people to a marquee.

I left it there rather than fixing it here, since deduplicating a registry item is a separate change and would break anyone who has already installed @fancy/simple-carousel. Happy to open a separate issue if it is useful, or to drop one of the two descriptions if you would rather retire that name.

For what it is worth, carousel/box-carousel.tsx is the actual carousel in the library.

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.

Registry items are all published with placeholder descriptions, so search cannot find them

1 participant