Add trending and hot climbs feed tabs and search sort options#924
Add trending and hot climbs feed tabs and search sort options#924marcodejongh wants to merge 4 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Claude ReviewIssues
|
Claude ReviewReady to merge - Minor issues noted below, but nothing blocking. Issues
Test Coverage The PR includes good validation schema tests and frontend component tests, which cover loading, empty, and error states. No test coverage for the backend resolver logic itself, but that may be acceptable given the reliance on raw SQL. |
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
Test Coverage Good test coverage with loading, empty, success, error states, and time period selection tested for both trending and hot modes. |
Query board_climb_stats_history to derive two new metrics: - Trending: biggest % increase in ascents over a configurable time period - Hot: largest absolute increase in ascents over a time period Changes: - Add database index on (board_type, created_at) for efficient time-range queries - Add GraphQL types, queries, and backend resolvers for trendingClimbs/hotClimbs - Add trending/hot sort options to climb search (correlated subqueries) - Add Trending and Hot tabs to home page activity feed with time period selector (7d/14d/30d) - Add TrendingClimbCard component with ascent metrics and board navigation - Switch home page tabs to scrollable variant for mobile compatibility https://claude.ai/code/session_0182yMWJM3vhoBrupcV71VZX
- Fix trending feed count query to join board_climbs and apply layoutFilterSql, matching the main query's behavior - Add TrendingClimbFeed frontend tests (8 tests): loading, trending/hot modes, board UUID filtering, time period selector, error handling - Add TrendingClimbFeedInputSchema validation tests (13 tests): defaults, limits, offsets, time period bounds, boardUuid validation https://claude.ai/code/session_0182yMWJM3vhoBrupcV71VZX
- Replace correlated subqueries in search sort with single MIN/MAX aggregation per climb, reducing from 4 subqueries to 1 per row. The existing (board_type, climb_uuid, angle) index covers this well. - Remove unused boardClimbStatsHistory import from search-climbs.ts - Add extractRows<T> helper to trending-feed.ts that replaces unsafe `as unknown as` casts with a runtime-safe extraction that returns empty array if result shape is unexpected - Move TrendingRow type to module scope as an interface https://claude.ai/code/session_0182yMWJM3vhoBrupcV71VZX
Use COUNT(*) OVER() window function in the main query to get total count without a separate CTE execution. Add comprehensive unit tests for trending-feed resolver covering row mapping, null handling, pagination, board filter resolution, and extractRows safety. https://claude.ai/code/session_0182yMWJM3vhoBrupcV71VZX
b0ea956 to
4dff1d1
Compare
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Minor Issues
Observations
|
Query board_climb_stats_history to derive two new metrics:
Changes:
https://claude.ai/code/session_0182yMWJM3vhoBrupcV71VZX