feat: Add hold state filters (Starting, Hand, Foot, Finish) to climb …#492
feat: Add hold state filters (Starting, Hand, Foot, Finish) to climb …#492marcodejongh wants to merge 4 commits intomainfrom
Conversation
…search Extend the hold filter dropdown to include specific hold states beyond Include/Exclude. Users can now filter climbs that have specific holds marked as Starting, Hand, Foot, or Finish holds. - Add STARTING, HAND, FOOT, FINISH options to filter dropdown - Add color configuration for each hold state filter - Update tag display to show counts for all selected hold states - Add holdStateFilters support to backend package to match web package
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Claude Reviewpackages/web/app/components/search-drawer/climb-hold-search-form.tsx
packages/backend/src/db/queries/climbs/create-climb-filters.ts
|
- Use themeTokens for UI colors (ANY/NOT) and HOLD_STATE_MAP for board-specific hold state colors - Replace emoji icons with consistent Ant Design icons - Import HoldState from @boardsesh/shared-schema instead of duplicating - Update ClimbSearchInput in shared-schema to support all hold states
Claude Reviewpackages/backend/src/db/queries/climbs/create-climb-filters.ts:141-147
packages/backend/src/db/queries/climbs/create-climb-filters.ts:23
packages/web/app/components/search-drawer/climb-hold-search-form.tsx:15-22
packages/shared-schema/src/types.ts:7
|
- Add type guard validation for hold states before SQL query to prevent injection (VALID_HOLD_STATE_FILTERS const with isValidHoldStateFilter) - Simplify ClimbSearchParams.holdsFilter type to Record<string, HoldState> - Use board-specific colors via getHoldStateColors(boardName) instead of hardcoded kilter colors - Document that OFF state is intentionally excluded from filter options
Claude ReviewType Safety Issue - Color Inconsistency - Missing Tests - |
- Explicitly filter out 'OFF' state in backend (it means "hold not used") - Skip 'OFF' state when counting holds for tag display in UI - Add comments explaining SQL parameterization safety via type guard - Add defensive null check with comment for unknown states in tag render
…search
Extend the hold filter dropdown to include specific hold states beyond Include/Exclude. Users can now filter climbs that have specific holds marked as Starting, Hand, Foot, or Finish holds.