Repository navigation
Allow completed workout sessions to be deleted or reopened (#5) - #80
Merged
Merged
Conversation
Session History can delete a completed session after confirmation, or reopen it in the live-workout editor while no other workout is active. Reopening snapshots the completed session; cancelling a reopened correction restores that snapshot, including canonical equipment, instead of destroying history. Closes #5.
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.
Closes #5.
What changes
delete_completed_workout_session.reopen_workout_sessionputs the session back in the live-workout editor. It is refused while another workout is in progress, which keeps the one-active-session rule.workout_session_reopen_snapshots: owner-scoped with RLS, and deleted along with the session.cancel_workout_sessionrestores the snapshot, includingcanonical_equipment_idand the legacy equipment fields, instead of deleting the session. Completing the correction discards the snapshot.Migration
supabase/migrations/20261018110000_add_completed_session_delete_and_reopen.sql. It sorts after #22's migrations and only adds things: a new table, new functions, and a replacedcancel_workout_session. It does not change existing rows.Validation
npm run agent:checkpasses locally against a fresh disposable DB: syntax, node tests, and all pgTAP suites, including the newworkout_session_lifecycle(54 checks) and #22'scanonical_equipment_identity. Not yet clicked through in a browser.Deploying
Merging deploys the frontend through GitHub Pages straight away, so apply the migration to production at the same time, as with #22.