-
Notifications
You must be signed in to change notification settings - Fork 4
Fix setter name filter bug and add multiselect autocomplete with route counts #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix setter name filter bug and add multiselect autocomplete with route counts #297
Conversation
…e counts **Bug Fix:** - Fixed setter name filter not actually filtering climbs - The parameter was flowing through UI → URL → API but never used in SQL WHERE clause - Added setterNameCondition to create-climb-filters.ts using inArray() **Enhancements:** - Changed setter filter from single text input to multiselect autocomplete - Added route count display next to each setter name (e.g., "John Doe (42)") - Created new API endpoint: /api/v1/[board]/[layout]/[size]/[sets]/[angle]/setters - Uses AntD Select component with mode="multiple" for better UX **Type Changes:** - Updated SearchRequest.settername from string to string[] - Updated URL parameter handling to support comma-separated values - Fixed analytics tracking to check array length **Technical Details:** - New query: app/lib/db/queries/climbs/setter-stats.ts - New component: app/components/search-drawer/setter-name-select.tsx - Uses SWR for data fetching with client-side search filtering - Maintains AntD design system best practices
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…d of non-existent board-details-context
…oss tests and fix setter-stats query
…->array conversion from URL query params
…lient-side navigation
…teSearchParamsToSearchParams
| const pathname = usePathname(); | ||
| const [searchValue, setSearchValue] = useState(''); | ||
|
|
||
| // Extract board URL from pathname (e.g., /kilter/123/456/789/40/list -> /api/v1/kilter/123/456/789/40) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already utility methods for performing the URL parsing, we should invent a seperate method of doing that here
| }, [pathname]); | ||
|
|
||
| // Fetch setter stats from the API | ||
| const { data: setterStats, isLoading } = useSWR<SetterStat[]>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean it uses progressive loading? We probably dont want to load all the setters by default. We need progressive load, and if the user types in text, we should filter on that text
…tter search - Replace manual pathname regex parsing with constructSetterStatsUrl utility - Add parsedParams to QueueContext for better component access - Implement progressive loading: only fetch when user types 2+ characters - Add search query parameter support to setter-stats API - Use server-side filtering with ILIKE for better performance - Add 50-result limit to setter stats query - Improve UX with helpful placeholder and notFoundContent messages
- Track dropdown open state with onDropdownVisibleChange - Fetch top setters when dropdown opens (before user types) - Switch to search mode when user types 2+ characters - Improves UX by showing popular setters immediately
Bug Fix:
Enhancements:
Type Changes:
Technical Details: