Skip to content

Add circuit/list filtering support #272

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

marcodejongh
Copy link
Owner

Summary

  • Implement comprehensive circuit support with filtering and display features
  • Add circuit dropdown filter in search form (logged-in users only)
  • Add clickable circuit tags on climb cards with color coding
  • Integrate circuit filtering with existing search functionality

Features Added

UI Components

  • Circuit Filter Dropdown: Multi-select dropdown in BasicSearchForm for logged-in users
  • Circuit Tags on Climb Cards: Color-coded tags showing which circuits contain each climb
  • Clickable Filtering: Circuit tags can be clicked to instantly filter by that circuit

Backend Integration

  • Database Queries: Comprehensive circuit query functions with position ordering
  • API Endpoints: REST endpoints for fetching circuits and circuit-climb relationships
  • Search Integration: Extended search parameters and filtering logic
  • Sync Enhancement: Added circuits_climbs to user data sync process

Technical Implementation

  • Added circuitUuids to SearchRequest type and URL parameter handling
  • Created custom hooks useCircuits and useClimbCircuits for data fetching
  • Enhanced climb search queries to filter by circuit membership
  • Updated table selection utility to support circuitsClimbs table

Database Changes

  • Added circuitsClimbs table support to table selection utility
  • Implemented circuit-climb relationship queries with position ordering
  • Added circuits_climbs to USER_TABLES for proper syncing from Aurora backend

User Experience

  • Circuit features only visible when user is authenticated
  • Circuit dropdown shows user's circuits and public circuits
  • Circuit tags display with actual colors from the circuit data
  • Seamless integration with existing search and filtering functionality
  • Proper loading states and error handling

Test Plan

  • TypeScript compilation passes
  • ESLint passes
  • Build completes successfully
  • All new API endpoints created
  • UI components properly integrated
  • Test with real circuit data once synced from Aurora
  • Verify circuit filtering works with other search filters
  • Test circuit tag clicking functionality
  • Verify authentication-gated features work correctly

🤖 Generated with Claude Code

Implement comprehensive circuit support with filtering and display features:

Features:
- Circuit dropdown filter in search form (logged-in users only)
- Clickable circuit tags on climb cards with color coding
- Circuit filtering integrated with existing search functionality
- Support for both user circuits and public circuits

Technical Implementation:
- Added circuit database queries and API endpoints
- Extended search parameters to support circuitUuids filtering
- Added circuits_climbs sync to user data sync process
- Created custom hooks for fetching circuits and climb circuits
- Updated climb search queries to filter by circuit membership
- Enhanced UI components with circuit selection and display

Database Changes:
- Added circuitsClimbs table support to table selection utility
- Implemented circuit-climb relationship queries with position ordering
- Added circuits_climbs to USER_TABLES for proper syncing

UI/UX:
- Multi-select circuit dropdown with color indicators
- Circuit tags show on climb cards when user is authenticated
- Tags are clickable to quickly filter by circuit
- Proper loading states and error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boardsesh ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 1:53am

Update test files to include the new circuitUuids property in SearchRequestPagination objects:
- Fixed use-queue-data-fetching.test.tsx
- Fixed reducer.test.ts (2 instances)

All TypeScript compilation errors resolved.
Changes:
- Made ClimbCard component provider-independent by adding optional onCircuitClick prop
- Circuit tags only clickable when callback is provided (in list view)
- Added circuit click handler to ClimbsList component with analytics tracking
- Circuit tags display but are not clickable in individual climb view (correct behavior)
- Resolves 'useUISearchParams must be used within a SearchParamsProvider' error

This ensures circuit functionality works properly in both list and individual climb views
without requiring all usage contexts to have the UISearchParamsProvider.
The provider was only wrapping the sidebar (TabsWrapper) but ClimbsList
component in the main content area also needs access to useUISearchParams
for circuit filtering functionality.

Moved UISearchParamsProvider to wrap the entire ListLayoutClient so both
the sidebar search forms and the main content ClimbsList can access the
search parameters context.

This resolves the remaining 'useUISearchParams must be used within a
SearchParamsProvider' error.
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