Skip to content

fix(routines): drop placeholder zero sets and '@+0' bodyweight suffix#51

Merged
DTTerastar merged 1 commit into
mainfrom
fix/empty-sets
Jun 15, 2026
Merged

fix(routines): drop placeholder zero sets and '@+0' bodyweight suffix#51
DTTerastar merged 1 commit into
mainfrom
fix/empty-sets

Conversation

@DTTerastar

@DTTerastar DTTerastar commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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} and Nx compression — 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:

Machine Shoulder Press
0@0

Sci-fit Upper Body
0:00

After:

Machine Shoulder Press

Sci-fit Upper Body

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:00 lines are dropped.

2. Bodyweight reps without added load drop the @+0 suffix

Scapular Pull Ups\n5@+0 is the system telling you "5 reps at +0 added weight." The +0 is meaningless — it's just 5 bodyweight reps. Same for AB (assisted) with zero assistance, and WR with zero weight. Before:

Scapular Pull Ups
3@+0
6@+0

Captain's Chair Leg Raise
2x5@+0

After:

Scapular Pull Ups
3
6

Captain's Chair Leg Raise
2x5

Sets with real added weight (e.g. Decline Crunch: 10@+15) are unchanged.

3. DRY the set-line switch

workouts.go was duplicating routines.go's fitdownSetLine (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 a SetData or PresetSetData.

Test plan

  • go vet ./... clean; go build clean; 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 Press renders as a bare name, no 0@0.
  • liftoff-export routines list — Free Weights tail (the 11 placeholder exercises) shows as bare names, no 0@-0 / 0@+0 / 0:00.
  • liftoff-export workouts list --since 1d — no regression; real numbers render unchanged.

Out of scope

  • JSON output is unchanged — placeholder sets are still present in --format json (upstream-faithful). This polish is markdown-only.
  • v1.2.0 has these issues. A patch release (v1.2.1) is the natural next step after this merges.

🤖 Generated with Claude Code

Made with Orca 🐋

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>
@DTTerastar DTTerastar merged commit 58204a0 into main Jun 15, 2026
4 checks passed
@DTTerastar DTTerastar deleted the fix/empty-sets branch June 15, 2026 05:23
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