Commit c84508b
Fix heatmap personal progress filtering (#266)
* Add personal progress filters to climb search
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 <noreply@anthropic.com>
* Improve personal progress filters UI layout
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 <noreply@anthropic.com>
* Fix heatmap personal progress filtering
Updates heatmap to properly respect personal progress filters by
adding header-based authentication support.
## Changes
- Updated heatmap API route to check for x-auth-token and x-user-id headers
- Added fallback to session-based auth for backward compatibility
- Modified use-heatmap.tsx hook to include auth headers when user is logged in
- Added token and user_id to useEffect dependencies for proper re-fetching
## Behavior
- When personal progress filters are active, heatmap API checks headers first
- Falls back to session auth if no headers provided
- Heatmap now properly filters holds based on user's climb history
- Maintains existing functionality for non-authenticated users
The heatmap will now correctly hide/show holds from climbs the user has
attempted or completed when using the personal progress filters.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5163860 commit c84508b
File tree
2 files changed
+42
-4
lines changed- app
- api/v1/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/heatmap
- components/search-drawer
2 files changed
+42
-4
lines changedLines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
38 | 63 | | |
39 | | - | |
| 64 | + | |
40 | 65 | | |
41 | 66 | | |
42 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
24 | 36 | | |
25 | 37 | | |
| 38 | + | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
| |||
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
44 | | - | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
0 commit comments