Skip to content

feat(plan): optimize plan from Plan screen + modify proposed values - #65

Merged
silver-snoopy merged 2 commits into
masterfrom
feature/plan-screen-optimizer
Apr 12, 2026
Merged

feat(plan): optimize plan from Plan screen + modify proposed values#65
silver-snoopy merged 2 commits into
masterfrom
feature/plan-screen-optimizer

Conversation

@silver-snoopy

@silver-snoopy silver-snoopy commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Plan screen optimizer: Sparkles icon on active PlanVersionCard triggers the existing workout plan tuner using the latest available report — no need to navigate to Reports page
  • Modify adjustments: Pencil icon per accepted adjustment opens inline SetEditor for editing sets, reps, weight, and RPE before committing. Backend validates overrideValue via isValidPlanSetArray()
  • AdjustmentDecision type: Replaces old 'accepted' | 'rejected' string with { status, overrideValue? } object — backward-compatible at API layer

Files changed (13)

Layer Files What
Shared workout-plan.ts AdjustmentDecision type
Backend workout-plans.ts Override validation + isValidPlanSetArray
Frontend PlanVersionCard.tsx, PlanPage.tsx, AdjustmentReviewModal.tsx Optimize button, wiring, modify capability
Tests workout-plans.test.ts, AdjustmentReviewModal.test.tsx Updated for new decision shape
Docs product-capabilities.md UC-PLAN-06, UC-PLAN-07

Test plan

  • npm run build -w @vitals/shared — clean
  • npx tsc --noEmit — backend + frontend clean
  • Backend tests: 412 passed
  • Frontend tests: 74 passed
  • ESLint: 0 errors
  • Prettier: formatted
  • Manual: navigate to /plan, verify sparkles icon on active version
  • Manual: click optimize with a report available → review modal opens
  • Manual: modify an adjustment value → see "modified" badge → commit
  • Manual: verify new plan version appears after commit

🤖 Generated with Claude Code

)

Add sparkles icon button to active PlanVersionCard that triggers the
existing workout plan tuner using the latest available report. Users can
now optimize their plan without navigating to the Reports page.

Also add "modify" capability to AdjustmentReviewModal — pencil icon per
accepted adjustment opens inline SetEditor for editing sets, reps,
weight, and RPE before committing. Backend validates overrideValue as a
valid PlanSet[] via isValidPlanSetArray().

- AdjustmentDecision type wraps old string decision with optional overrideValue
- PATCH handler maps decisions to status-only for DB, uses override when present
- Deep clone in handleStartEdit prevents shared reference mutation bug
- Prettier formatting applied to 5 backend service files

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 1:10pm

Live E2E verification uncovered that @fastify/cors default methods
(GET,HEAD,PUT,POST,DELETE) omit PATCH — the adjustment commit endpoint
was unreachable from the browser. Also adds data-testid attributes to
optimize button, review modal, commit button, edit and modified badges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@silver-snoopy
silver-snoopy merged commit 0279f5f into master Apr 12, 2026
5 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