Skip to content

Conversation

@marcodejongh
Copy link
Owner

Summary

Implements filtering by climbs already attempted or completed by the logged-in user.

Addresses issue #110 - "Filtering by climbs already climbed/attempted/etc"

New Features

  • Hide Attempted: Filter out climbs the user has attempted
  • Hide Completed: Filter out climbs the user has completed
  • Only Attempted: Show only climbs the user has attempted
  • Only Completed: Show only climbs the user has completed

Implementation Details

Frontend Changes

  • Added new "Personal Progress" section to search form with toggle switches
  • Section only appears when user is logged in
  • Uses Ant Design Switch components with helpful tooltips
  • Added proper TypeScript types for new filter properties

Backend Changes

  • Enhanced search API to accept user authentication headers
  • Modified database queries to join ascents/bids tables when filters are active
  • Uses SQL EXISTS subqueries for optimal performance
  • Supports both Kilter and Tension board types

Data Flow

  • Frontend sends auth headers (x-auth-token, x-user-id) when personal progress filters are enabled
  • Backend validates authentication and passes user ID to search function
  • Database filters are applied using EXISTS/NOT EXISTS subqueries against ascents/bids tables
  • Results exclude/include climbs based on user's attempt/completion history

Database Integration

  • Joins with {board}_ascents table for completed climbs
  • Joins with {board}_bids table for attempted climbs
  • Only applies when user authentication is provided
  • Maintains performance with indexed subqueries

URL & State Management

  • Filter states are preserved in URL parameters
  • Added analytics tracking for new filter usage
  • Updated default search parameters and URL parsing

Testing

  • Updated test files to include new required properties
  • All TypeScript compilation and ESLint checks pass
  • Maintains backward compatibility

Test plan

  • Verify filters only appear when logged in
  • Test each filter individually (hide/show attempted/completed)
  • Verify filters work with other search parameters
  • Test URL parameter persistence
  • Verify performance with large datasets
  • Test on both Kilter and Tension boards

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Aug 10, 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 10, 2025 0:10am

Implements filtering by climbs already attempted or completed by the logged-in user.

## New Features
- Hide Attempted: Filter out climbs the user has attempted
- Hide Completed: Filter out climbs the user has completed
- Only Attempted: Show only climbs the user has attempted
- Only Completed: Show only climbs the user has completed

## Implementation Details
- Added new boolean properties to SearchRequest type
- Enhanced search form UI with toggle switches (only visible when logged in)
- Updated backend queries to join ascents/bids tables when filters are active
- Modified API route to handle user authentication headers
- Updated data fetching to include auth headers when available
- Added URL parameter persistence and analytics tracking
- Fixed test files to include new required properties

## Database Integration
- Uses EXISTS subqueries for optimal performance
- Supports both Kilter and Tension board types
- Only applies filters when user is authenticated

Addresses issue #110 - good first issue for filtering climbs by user progress.

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

Co-Authored-By: Claude <[email protected]>
Updates the search form to use the improved UI pattern from PR #137:

- Changed form layout to horizontal with left-aligned labels (14/10 span)
- Replaced "Classics Only" dropdown with Switch component
- Added Typography.Title for "Personal Progress" section heading
- Updated Alert message for better clarity when not logged in
- Aligned all switches to the right with consistent styling
- Used valuePropName="checked" for proper Switch integration

The UI now matches the cleaner, more organized design pattern
established in the search toggles PR.

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

Co-Authored-By: Claude <[email protected]>
@marcodejongh marcodejongh merged commit 5163860 into main Aug 10, 2025
4 checks passed
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.

2 participants