fix(routines): drop placeholder zero sets and '@+0' bodyweight suffix#51
Merged
Conversation
Two fitdown polish fixes the spec is silent on: 1. Exercises added to a routine but never given target sets/reps arrived as zero/zero placeholder sets and rendered as "0@0" / "0@+0" / "0:00". They now show just the exercise name — still part of the routine, but no fake numbers. 2. WR / BR / AB sets with a zero weight component (a true bodyweight rep with no added load or assistance) now emit just the rep count: "5" instead of "5@+0" or "5@-0". The exercise name and type carry the rest of the context. Also DRYs the WR/BR/AB/WD/DD/ND set-line switch — workouts.go was duplicating routines.go's `fitdownSetLine`. Now both renderers share it, which is also how the polish fix above applies to both surfaces in one place. Signature changed to (exTypes, inputOne, inputTwo) so the helper doesn't care whether the caller has a SetData or PresetSetData. Tests cover the suppression for WR + ND, the WR/BR/AB zero-weight simplification, and assert real numbers still render unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Orca <help@stably.ai>
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.
Summary
Two follow-up fitdown polish fixes to v1.2.0 that surfaced once the routines export was in everyday use. Fitdown's spec only covers
${reps}@${poundage}andNxcompression — every edge case below is our extension.1. Placeholder zero sets render as bare names
An exercise added to a routine in the Liftoff app but never given target sets/reps arrives as one or more zero/zero placeholder sets. Before:
After:
The exercise stays in the rendered routine (so an LLM agent reading "what's in my Free Weights routine?" still sees it) but the bogus
0@0/0@+0/0:00lines are dropped.2. Bodyweight reps without added load drop the
@+0suffixScapular Pull Ups\n5@+0is the system telling you "5 reps at +0 added weight." The+0is meaningless — it's just 5 bodyweight reps. Same for AB (assisted) with zero assistance, and WR with zero weight. Before:After:
Sets with real added weight (e.g.
Decline Crunch: 10@+15) are unchanged.3. DRY the set-line switch
workouts.gowas duplicatingroutines.go'sfitdownSetLine(the WR/BR/AB/WD/DD/ND mapping). They now share it, which is also how (1) and (2) apply to both renderers in one place. Helper signature is(exTypes, inputOne, inputTwo json.Number)so it doesn't care whether the caller has aSetDataorPresetSetData.Test plan
go vet ./...clean;go buildclean;go test ./cmd/...19/19 passing (added cases for empty-set suppression on WR + ND, and zero-weight simplification for WR / BR / AB).liftoff-export routines show "Valley Creek 1"against live account —Machine Shoulder Pressrenders as a bare name, no0@0.liftoff-export routines list— Free Weights tail (the 11 placeholder exercises) shows as bare names, no0@-0/0@+0/0:00.liftoff-export workouts list --since 1d— no regression; real numbers render unchanged.Out of scope
--format json(upstream-faithful). This polish is markdown-only.🤖 Generated with Claude Code
Made with Orca 🐋