Training plan retention: redesign, persistence, progress tracking, mobile layout - #77
Merged
Merged
Conversation
The generated plan view read like a gray settings form. Reworks the /plan presentation layer only (plan-math untouched): - Dark emerald hero card: goal time as the dominant numeral, race-day countdown, big-number stat tiles, integrated phase timeline with a mobile legend instead of clipped labels - Single workout-type + phase color system (utils/planDisplay.ts) used across the volume chart, badges, rails, and day cards - Week list grouped by phase with colored rails; week 1 auto-expands; expanded weeks show rich day cards only (removed duplicated text list) - Pace chips become zone cards on the pace-ladder color ramp - Form polish: filled selected states, live-feeling CTA with helper copy - Mobile pass at 390px: no clipped, orphaned, or mid-word truncated text Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011gQkB7Td39HRHSY7Z7oL9Z
Guests lost a generated plan on refresh, and the 'Sign in to save' banner navigated away and destroyed the plan they wanted to save. - Persist the generated plan + form inputs to localStorage (trainpace_plan_draft / trainpace_plan_inputs); restore on mount, discard drafts whose race date has passed, survive private mode - Start over clears the draft plan but keeps inputs as form prefill - Sign-in banner now links to /login?returnTo=/plan and sets a pending-save flag; on return, the restored plan auto-saves once and the draft is cleared on success Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011gQkB7Td39HRHSY7Z7oL9Z
Saved plans were static documents with no reason to return. Adds
per-workout done-tracking and a daily-return surface:
- completedWorkouts map on the plan doc ('week:Day' -> ISO timestamp),
toggled via dot-path updates so devices merge instead of clobbering
- Shared calendar math in utils/planSchedule.ts (week dates, current
week, next run up, active plan selection); PlanCalendar now agrees
with the iCal export on week boundaries
- usePlanProgress hook: optimistic toggles with per-key rollback,
guest progress in localStorage, merged into the doc on save
- Done-toggles on day cards, n/m runs + progress bars on week rows,
hero, and dashboard plan cards
- ThisWeekCard on /plan and dashboard: current week at a glance with
the next run highlighted, before-start and post-race states
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011gQkB7Td39HRHSY7Z7oL9Z
The generated plan stacked hero, chart, paces, this-week, and 14 week rows into one ~5000px mobile column. Restructures the layout: - Sticky This Week / Schedule / Stats segments; This Week is the default for in-progress plans (Schedule before the plan starts) - Hero slimmed to race, goal, countdown, stats, and phase bar; volume chart, pace zones, and phase details move to the Stats segment - Compact collapsed week rows on mobile (82px -> 55px) - Schedule auto-scrolls the current week into view once per visit, honoring prefers-reduced-motion This Week segment now measures ~2561px on a 390px viewport, down ~49%. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011gQkB7Td39HRHSY7Z7oL9Z
✅ Deploy Preview for trainpace ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| UnusedCode | 8 medium |
| ErrorProne | 10 medium 27 high |
| Security | 10 high |
| CodeStyle | 1 minor |
| Complexity | 12 medium |
🟢 Metrics 241 complexity · 4 duplication
Metric Results Complexity 241 Duplication 4
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.

Turns the /plan generator from a one-shot form into a product users return to. Four stacked changes:
1. Runna-level visual redesign (
b60a2a4)utils/planDisplay.ts) shared by the chart, badges, rails, and day cards2. Draft persistence + sign-in handoff (
1ebfeff)trainpace_plan_draft/trainpace_plan_inputs); restored on mount, stale drafts (past race date) self-clean, private-mode safe/login?returnTo=/planwith a pending-save flag; on return the restored plan auto-saves once — previously the banner destroyed the plan the user was trying to save3. Workout completion tracking (
5bdd63d)completedWorkoutsmap on the plan doc ("week:Day" → ISO timestamp), toggled via dot-path updates so devices merge instead of clobbering; no Firestore rules change needed (owner update already allowed)utils/planSchedule.ts; PlanCalendar now agrees with the iCal export on week boundaries (fixes a latent current-week discrepancy)usePlanProgress: optimistic toggles with per-key rollback; guest progress lives in localStorage and merges into the doc at save time (including through the auto-save handoff)4. Mobile de-scroll (
cbe3455)prefers-reduced-motion)Verification
npm run build(tsc + full prerender) andnpm run lintpass at every commit; no new warningsProduct defaults chosen (easy to flip): missed past runs render neutral (not red), future runs are tickable, race day is tickable as the capstone. The optional firestore.rules hardening (pinning
userIdon update) was deliberately left out — happy to follow up separately since rules deploys deserve their own review.🤖 Generated with Claude Code
https://claude.ai/code/session_011gQkB7Td39HRHSY7Z7oL9Z
Generated by Claude Code