Skip to content

feat: add search filter to Introduction page#787

Open
nastyastavitskaya wants to merge 3 commits into
mainfrom
feat/intro-search-filter
Open

feat: add search filter to Introduction page#787
nastyastavitskaya wants to merge 3 commits into
mainfrom
feat/intro-search-filter

Conversation

@nastyastavitskaya
Copy link
Copy Markdown
Collaborator

Summary

  • Add a search input to the Storybook Introduction/homepage to quickly filter components by name
  • Input uses search icon prefix and aligns to 2 card columns via the same CSS grid
  • Shows Aquarium Empty component when no results match

Test plan

  • Open Introduction page in Storybook
  • Type a component name (e.g. "radio") — verify grid filters to matching components
  • Type gibberish — verify Empty state renders with proper spacing
  • Clear input — verify all components reappear

🤖 Generated with Claude Code

Allows filtering components by name on the homepage. Uses Input with
search icon prefix, grid-aligned to span 2 card columns. Shows Empty
component when no results match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 8, 2026

PR Summary

Low Risk
Low risk: changes are isolated to Storybook docs UI and simple client-side filtering, with no backend, auth, or data persistence impact.

Overview
Adds a search box to the docs Introduction page to filter displayed components by name, including a dynamic placeholder showing the total component count.

Refactors category computation into memoized allCategories and derives a filtered categories list from the search query; shows an Empty state when no matches are found.

Updates CLAUDE.md contributor guidance to require updating relevant documentation whenever adding/promoting icons or components.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://mParticle.github.io/aquarium/pr-preview/pr-787/

Built to branch gh-pages at 2026-04-20 22:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

astavitskaya and others added 2 commits April 8, 2026 17:22
Reminds contributors to always update documentation when adding icons,
components, or promoting component status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c6b903c. Configure here.


const categories = useMemo(() => {
if (!searchQuery.trim()) return allCategories
const query = searchQuery.toLowerCase()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search query not trimmed before filtering components

Low Severity

The empty-guard on line 214 uses searchQuery.trim() to decide whether to filter, but the actual filtering query on line 215 uses searchQuery.toLowerCase() without trimming. A search like " radio " (with accidental leading/trailing whitespace) passes the guard but fails to match any component name because the spaces are included in the .includes() check. The query variable needs to also be trimmed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c6b903c. Configure here.

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