-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Enable Moonboard climb saving to PostgreSQL database #608
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
Conversation
- Add frames encoding utility (`encodeMoonBoardHoldsToFrames`) to convert
holds to the `p{holdId}r{roleCode}` format used by the database
- Update saveClimb API to accept Moonboard requests with holds format
and convert to frames before saving
- Update MoonBoardCreateClimbForm to require authentication and save
climbs via the API instead of IndexedDB
- Update MoonBoardBulkImport similarly for batch saves
- Add direct database query for Moonboard climbs in list page since
GraphQL backend doesn't support Moonboard yet
- Skip GraphQL search and playlist operations for Moonboard to prevent
errors
- Add getMoonBoardDetails helper throughout codebase to handle Moonboard
board details separately from Aurora boards
- Enable MOONBOARD_ENABLED feature flag by default
- Remove IndexedDB saving functions (no longer needed)
- Restructure create form UI with header containing save button
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Claude ReviewIssues
|
Integrate MoonBoardRenderer into BoardRenderer to fix Moonboard climb previews. BoardRenderer now delegates to MoonBoardRenderer when board_name is 'moonboard', using the new layoutFolder and holdSetImages fields in BoardDetails. Standardize on LitUpHoldsMap type across all Moonboard components, replacing the separate MoonBoardLitUpHoldsMap type. This ensures consistent hold state representation using 'STARTING', 'HAND', 'FINISH' instead of 'start', 'hand', 'finish'. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
Notes
|
All unified tables (board_climbs, board_climb_stats, board_difficulty_grades) require board_type filtering since they store data for all board types. Changes: - create-climb-filters.ts: Add board_type to baseConditions and climbStats join - search-climbs.ts: Add board_type to difficultyGrades join, remove unused imports - get-climb.ts: Add board_type to climbs, climbStats, and difficultyGrades queries - playlists/queries.ts: Add board_type to all unified table joins - ticks/queries.ts: Fix TypeScript errors for nullable boolean fields This fixes climb searches returning incorrect or missing difficulty grades. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
TestsNo tests included for the new functionality (grade conversion, frames encoding, bulk import, direct database queries). DocumentationNo documentation changes required - Moonboard is a new feature and |
- Unified Aurora and MoonBoard create climb forms into single component - Added unified header with back button, title input, settings, and save - Added grade selector for MoonBoard with proper difficulty IDs - Added angle selector for MoonBoard (25° and 40° only) - Added climb stats creation for MoonBoard climbs with grades - Consolidated BOULDER_GRADES constant for all boards - Added draft toggle support for MoonBoard - Auth alert now shows for both board types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Join with boardClimbStats and boardDifficultyGrades tables to show the actual grade for MoonBoard climbs in the list view instead of displaying 'V?' for all climbs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use getGradeByDifficultyId to get full grade info with V-grade - Format difficulty as "6a/V3" style so ClimbTitle can extract V-grade - Set quality_average to "3" when grade exists (required by hasGrade check) - Removed redundant join with boardDifficultyGrades table Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The displayDifficulty column is stored as doublePrecision in the database which may return values like 16.0 instead of 16. Round to nearest integer for the lookup. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues Found
|
Temporary logging to debug why grades aren't showing in list view: - Log user_grade and difficultyId in save API - Log saveClimbStats call - Log displayDifficulty and gradeInfo in list query Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues Found
Documentation Check
|
Grade saving and display is now working correctly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add setter_username field to SaveClimbOptions interface - Update API schema to accept setter field from client - Save setterUsername to database in saveClimb function - Send setter, user_grade, and is_benchmark from bulk import client - Fix fontGradeToDifficultyId to handle OCR grade formats like "6A/V3" The OCR returns grades in combined format (e.g., "7B+/V8") which wasn't being parsed correctly. Now extracts just the Font grade portion before looking up the difficulty ID. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
Add ability to upload OCR screenshots and parsed results to S3 for
improving the OCR library. Includes:
- Backend handler at /api/ocr-test-data for multipart upload
- Frontend service for fire-and-forget uploads
- Opt-in checkbox in bulk import UI (default enabled)
- S3 storage in moonboard-ocr-test-data/{timestamp}-{uuid}/
Upload is fire-and-forget - errors don't affect main save flow.
When S3 is not configured, upload is silently skipped.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
- Add moonboard to BoardNameSchema validation in backend - Create SUPPORTED_BOARDS constant in shared-schema as single source of truth - Update backend resolvers to use SUPPORTED_BOARDS (ticks, climbs, playlists) - Update isValidBoardName to include moonboard - Add moonboard to HOLD_STATE_MAP in playlists resolver - Update web validation to use centralized SUPPORTED_BOARDS - Update profile page to show moonboard ascents - Hide unsupported features (playlists, classify holds, fork) for moonboard - Update tests to expect moonboard as valid board type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - No critical issues found. This is a substantial feature addition with good architectural decisions. Minor observations (non-blocking):
|
MoonBoard uses grid-based rendering with its own configuration in moonboard-config.ts, not the Aurora board product-sizes-data.ts. Updated route pages to call getMoonBoardDetails() for MoonBoard instead of getBoardDetails() which only supports Aurora boards. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
MoonBoard uses green for starting holds and red for finish holds, which is the opposite of what was previously configured. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
…feed MoonBoard ticks now show proper layout names (e.g., "MoonBoard 2024") instead of generic fallback names like "Moonboard (Layout 3)". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove duplicate color definitions by deriving HOLD_STATE_MAP.moonboard and parseMoonboardFrames() colors from MOONBOARD_HOLD_STATES in moonboard-config.ts, ensuring consistency across the codebase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
- Extract getBoardDetailsForBoard to shared utility (board-utils.ts) removing duplicate implementations from 6 page files - Add warning log for unexpected MoonBoard role codes in parseMoonboardFrames - Add clarifying comment for grade difficulty float-to-int conversion - Improve OCR upload warning logs to include climb name for traceability - Document MoonBoard hold state codes (42, 43, 44) and Aurora compatibility - Add type guard and validation for OCR test data metadata in backend Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add default configurations for all MoonBoard layouts (1-5) in default-board-configs.ts to enable thumbnail rendering - Use getBoardDetailsForBoard in ascent-thumbnail.tsx which correctly routes MoonBoard requests to getMoonBoardDetails - Inline MoonBoard hold state values (42, 43, 44) in HOLD_STATE_MAP to avoid computed property issues with bundlers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude ReviewIssues
Minor
|
- Extract userId before guard checks in create-climb-form and bulk-import for proper TypeScript type narrowing - Use explicit null check (difficultyId !== null) in saveClimb route - Update stale comment in moonboard-config to match actual color scheme - Remove unused imports (SetIdList, BoardName, HoldState) from list page Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues Found
Notes
|
The climb view/details page doesn't properly support MoonBoard yet. Hide the viewDetails action in ClimbCard for MoonBoard climbs until the view page is adapted for MoonBoard's grid-based rendering. Relates to #617 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
DocumentationNo documentation updates needed - changes do not affect documented WebSocket architecture. TestsExisting tests were updated for the new Moonboard board type. No new test coverage added for the Moonboard-specific code paths (save climb, list queries, OCR upload), but this is consistent with the repo's current test coverage patterns. |
Add moonboard entries to HOLD_STATE_MAP and PRODUCT_SIZES records to satisfy Record<BoardName, ...> type requirements now that moonboard is included in BoardName union type. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude ReviewIssues
|
Summary
Changes
Database & API
encodeMoonBoardHoldsToFramesutility andMOONBOARD_HOLD_STATE_CODESconstantsCreate & Import UI
List View & Rendering
statefieldlayoutFolderandholdSetImagesfields to BoardDetailsType Standardization
Context & Data Fetching
Test plan
🤖 Generated with Claude Code