fix(plan): parse D1/D2 day headers, em dashes, RIR notation - #64
Merged
Conversation
…es display The parser couldn't recognize workout plans using the "D1 — UPPER" format (common in coaching programs). Three regex gaps: 1. DAY_HEADER_RE didn't match "D1", "D2" etc. — added `d\d+` pattern 2. Exercise name cleanup didn't strip trailing em dashes (U+2014/2013) from "Bench Press — 4×5–7" format 3. RPE_RE only recognized "RPE" but not "RIR" (Reps In Reserve) — added RIR as an accepted suffix Also fixes the notes fallback display: exercise.notes in the table cell now uses whitespace-pre-wrap so multi-line raw text renders with line breaks instead of a single-line wall of text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the plan parser failing to recognize workout plans using the common coaching format:
Three parser gaps fixed:
D1,D2, etc. now recognized (addedd\d+toDAY_HEADER_RE)—,–) stripped from names like "Bench Press —"@1 RIRnow parsed as RPE value (previously only@RPE Nwas recognized)Also fixes notes display:
whitespace-pre-wrapon the notes table cell so fallback plans render with line breaks instead of a wall of text.Before / After
Before: entire plan dumped as a single "See notes" row — one long unformatted line
After: 3 structured day cards with individual exercises, sets × reps, and RIR values
Test plan
🤖 Generated with Claude Code