feat: add category filter chips to search page#908
Open
muffti123 wants to merge 1 commit into
Open
Conversation
Implements a horizontal scrollable row of category filter chips (Gaming, Electronics, Art, Music, Sports, Collectibles, Other) on the Search page. Clicking a chip filters search results to that category via the backend's GET /search?category= endpoint. Supports multi-select with parallel requests and client-side deduplication. Active categories are reflected in the URL query string (?category=gaming,art) and survive page refresh. Closes crackedstudio#832
|
@muffti123 is attempting to deploy a commit to the otaiki1's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Adds a horizontal scrollable row of category filter chips to the Search page, allowing users to narrow raffle results by category without a full page reload.
Changes
client/src/services/raffleService.tssearchRafflesnow accepts an optionalcategories?: string[]parameterGET /search?q=...&category=...requests (one per selected category) and deduplicates results by raffle ID via aSet<number>client/src/hooks/useSearch.tscategories: string[]argument (defaults to[])categories.sort().join(',')as a stable dependency key so the search re-fires when categories changesearchRafflesclient/src/pages/Search.tsx?category=from the URL and parses it intoselectedCategoriesviauseMemo#FE3796), inactive chips use an outlined border styletoggleCategorytoggles a category in/out and updates the URL viasetSearchParamswithreplace: trueuseSearchreceives bothqueryandselectedCategoriesAcceptance Criteria
?category=gaming,art)Categories
Gaming,Electronics,Art,Music,Sports,Collectibles,OtherCloses #832