feat(web): add keyword search to docs hub and FAQ pages#4364
Merged
Conversation
Add client-side keyword search to two of the most content-heavy pages on codewhale.net: Docs hub (/docs): - New DocsSearch client component with real-time filtering across all doc topics (label, description, source files, category — in both EN and ZH) - Search input with / keyboard shortcut to focus, clear button, result count, and no-results state - Matched text is highlighted inline - The topic grid and category sections update live as you type FAQ page (/faq): - New FaqSearch client component wrapping the existing FAQ item list - Full-text matching across question text, answer content (extracted from React nodes), and source citations - Same UX patterns: / shortcut, highlight, result count Shared logic: - web/lib/search-utils.ts extracts the pure filtering functions for unit testability - web/lib/search-utils.test.ts: 19 tests covering haystack building, locale-cross-matching, case-insensitivity, and edge cases Styling: - .search-input and mark.search-highlight classes in globals.css, using existing CSS variables for consistency with the site theme
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.
Add client-side keyword search to two of the most content-heavy pages on codewhale.net:
Docs hub (/docs):
FAQ page (/faq):
Shared logic:
Styling:
Summary
Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-featurescargo test --workspace --all-featuresChecklist