Skip to content

fix(plan): parse D1/D2 day headers, em dashes, RIR notation - #64

Merged
silver-snoopy merged 1 commit into
masterfrom
fix/plan-parser-d-format
Apr 12, 2026
Merged

fix(plan): parse D1/D2 day headers, em dashes, RIR notation#64
silver-snoopy merged 1 commit into
masterfrom
fix/plan-parser-d-format

Conversation

@silver-snoopy

Copy link
Copy Markdown
Owner

Summary

Fixes the plan parser failing to recognize workout plans using the common coaching format:

D1 — UPPER (HEAVY | ~1 RIR)
Iso-Lateral HS Bench — 4×5–7 @1 RIR

Three parser gaps fixed:

  • Day headers: D1, D2, etc. now recognized (added d\d+ to DAY_HEADER_RE)
  • Exercise names: trailing em dashes (, ) stripped from names like "Bench Press —"
  • RIR notation: @1 RIR now parsed as RPE value (previously only @RPE N was recognized)

Also fixes notes display: whitespace-pre-wrap on 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

  • 412 backend tests pass (+1 new parser test for D1/D2 format)
  • 74 frontend tests pass
  • Build clean (shared/backend/frontend)
  • Manual browser verification: pasted D1–D3 plan → 3 day cards with correct exercises

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Apr 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vitals Ignored Ignored Apr 12, 2026 10:01am

@silver-snoopy
silver-snoopy merged commit cbf1f9c into master Apr 12, 2026
3 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.

1 participant