Skip to content

Post-rebase: P22 fixes, vault 1RM, finish guard, modal encapsulation - #117

Merged
rghamilton3 merged 7 commits into
mainfrom
post-rebase/p22-and-vault-fixes
Apr 23, 2026
Merged

rghamilton3 merged 7 commits into
mainfrom
post-rebase/p22-and-vault-fixes

Conversation

@rghamilton3

Copy link
Copy Markdown
Contributor

Summary

  • refactor(workout): encapsulate showAddExercise, showDiscardDialog, and pageError state inside StrengthWorkoutView (P22-014)
  • feat(vault): restore aggregated 1RM view in Vault 1RM tab (P11-012)
  • feat(workout): guard FINISH button when a pending set input is dirtied
  • fix(review): resolve all P22 review findings (8 fixes, 4 tasks)
  • test(workout): add P22 review test tasks
  • chore(context): archive completed QuickPlans, resolve backlog items

These commits were rebased onto bc198ab (timer snap fix, #116) after a merge conflict with the split-route PR (#115).

Test plan

  • Start a strength workout -- confirm FINISH, DISCARD, and add-exercise sheet work correctly
  • Dirty a set input row and tap FINISH -- confirm the guard dialog appears
  • Start an event workout -- confirm discard dialog still works (uses route-level state)
  • Navigate to Vault 1RM tab -- confirm aggregated 1RM view renders
  • No TypeScript errors (bun run build)

… (P22-014)

showAddExercise, showDiscardDialog, and pageError were owned by the parent
ActiveWorkoutPage and prop-threaded into StrengthWorkoutView despite being
exclusively consumed there. Move them to local useState inside the component.

showDiscardDialog and pageError are retained at the parent level only for
EventWorkoutView, which also consumes them.
Wires OneRmManagement into VaultOneRmTab so all current exercise maxes
are visible alongside the per-exercise trend chart. Closes backlog item
P11-012 (OneRmManagement removed from profile in PR #76).
Adds a PENDING label to the auto-populated set row and tracks whether
the user has edited any field on it. When finishing a workout with a
dirtied-but-unconfirmed pending set, show a confirmation dialog so the
user doesn't silently lose entered data.
Marks P11-012, exercise completion signal, frequent exercises picker,
and P22-014 as resolved in Ideas.md. Adds a default list action and
renumbers workflow steps in the backlog command.
Fixes:
- P22-001: getFrequentExerciseIds throws on RPC error instead of returning []
- P22-002: useGymRoster throws when Supabase client is null (was returning degraded data)
- P22-003: Remove duplicate console.error at 3 catch sites that violate hook log ownership
- P22-005: unconfirmSet guard throws instead of silently returning (error now surfaces to user)
- P22-006: Add .refine cross-field invariants to GymInvitation and GymOwnershipTransfer; token min(1) -> min(24)
- P22-007: Remove unused _exercise/_groupType params from addExerciseToWorkout interface and impl
- P22-008: Toast user when notification prefs fail to load during rest timer start
- P22-009: Clear pendingDirty for activity when onSkipExercise fires in StrengthWorkoutView

Tasks (S008-T through S011-T added to F023/Steps.md Phase 6):
- P22-010: StrengthWorkoutView finish guard tests (S008-T)
- P22-011: SetRow.onPendingDirty idempotency tests (S009-T)
- P22-012: EventWorkoutView tests (S010-T)
- P22-013: allActivitiesDone mixed CIRCUIT+STRENGTH banner test (S011-T)

Note: P22-004 deferred -- finding invalid; existing test documents that
startProgrammedWorkout intentionally accepts standalone template workouts
without programContext.

Review: Context/Reviews/0022-since-beta10-2026-04-22.md
S008-T: StrengthWorkoutView test file (8 tests)
- Finish guard: no dirty rows calls handleFinish directly
- Finish guard: dirty row shows "Unconfirmed set" dialog
- Finish guard: dialog confirm calls handleFinish; cancel does not
- P22-009 regression: onSkipExercise clears pendingDirty so next
  Finish tap bypasses the dialog
- Discard dialog: open, cancel, and confirm paths

S009-T: SetRow onPendingDirty tests (3 tests added to set-row.test.tsx)
- Called exactly once on first weight edit of a pending row
- Not called on a confirmed (read-only) row
- Not called a second time on subsequent field edits (isDirty guard)

S010-T: EventWorkoutView test file (9 tests)
- Discard dialog triggered by WorkoutPausedBar.onDiscard
- Cancel path: setShowDiscardDialog(false), handleDiscard not called
- Discard path: handleDiscard called
- canFinish is always true (no set-count gate)
- pageError renders ErrorBanner, onDismiss calls setPageError(null)

S011-T: Verified covered by S007-T (no new test needed)
- Mixed CIRCUIT+STRENGTH all-done banner scenario already exists at
  line 542 of -log-workout-finish-banner.test.tsx
@vercel

vercel Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ardent-forge Ready Ready Preview, Comment Apr 23, 2026 3:07am

@rghamilton3
rghamilton3 changed the base branch from develop to main April 23, 2026 03:14
@rghamilton3
rghamilton3 merged commit 7889008 into main Apr 23, 2026
2 checks passed
@rghamilton3
rghamilton3 deleted the post-rebase/p22-and-vault-fixes branch April 23, 2026 03:14

This branch was successfully deployed

1 active deployment
Preview — 0d60eab7 Deployed Apr 23, 2026 by vercel[bot]
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