Skip to content

feat(training): shared design kit for the load screens - #28

Merged
DX23876 merged 5 commits into
mainfrom
redesign/c-design-kit
Sep 17, 2026
Merged

DX23876 merged 5 commits into
mainfrom
redesign/c-design-kit

Conversation

@DX23876

@DX23876 DX23876 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

Third package of the Training Load / Cardio / Strength redesign. Depends on #26 (lane colours) and #27 (shared lane reading). Both are merged into this branch, so until they land the diff also shows their commits. Merge them first.

Strand/Screens/TrainingDesignKit.swift adds the building blocks the three screens will share. Each screen still decides its own order and content. The blocks take finished values and use only design tokens.

Block What it is
TrainingLane Strength (teal) / Cardio (violet) identity: colours, symbol, pill fill
LoadPillState + LoadStatusPill below / about / above / well above usual, provisional, no comparison. The words carry the state; the colour only names the lane.
LoadHeroCard Signed percentage (counts on change, opens on the real value), pill, trend sparkline, measured figure, coverage line, caveat, maturity note; compact for half width
LaneHeroSurface Saturated lane wash in dark mode; lighter in light mode so secondary text keeps its contrast
KPIStrip / KPIItem Up to four figures per row, optional info action
LoadHistoryChart + LoadHistoryBuckets 7D daily bars for the read week; 4W/12W Monday-week totals ending with it. The usual-week band shows only on weekly spans and only once a personal range exists. Partly unmeasured bars are drawn lighter.
SummaryTile Compact fact with chevron that opens the full card
ExplainerRows / ExplainerItem "How it works" rows that open method text in a sheet
TrainingWeekControl Week stepper and history-window menu shared by Cardio and Strength
AdaptiveTwoColumn Side by side at ≥700 pt, stacked on a phone

LoadFormat.signedPercent keeps the existing "0 %" rule for changes that round to nothing.

Verification

  • TrainingDesignKitTests: week and weekly buckets, reading through today versus a past Sunday, unknown-day flag, pill mapping for every band, signed-percent formatting. Run together with TrainingLoadLanesTests: 10 tests pass.
  • xcodebuild -scheme Strand (macOS) and -scheme NOOPiOS (iOS Simulator) both build.
  • The blocks were rendered through ImageRenderer in dark and light mode and checked visually. That render led to two fixes: the percentage opened at "0 %", and the warning line was hard to read on the light wash.
  • Strings: 13 new keys were read from the build's .stringsdata. They were added to Strand/Resources/Localizable.xcstrings as a purely additive change, translated into all nine languages, and mirrored in Tools/translations/*.json. python3 Tools/i18n_audit.py --ci origin/main exits 0.
  • python3 Tools/doc_comment_lint.py: OK.

Analysis migration required: no

Strength and Cardio both used effortColor, so the two training lanes were
indistinguishable. Each lane now owns one identity colour for all seven
chart styles in light and dark: electric teal for Strength and violet for
Cardio, kept clear of the status and Charge colours so a lane never reads
as a warning. The hexes live in LaneColorTable and LaneColorTests pin hue
separation and white-text contrast on the deep tones.

Analysis migration required: no
Move the detached computation in TrainingLoadModel.load into a static
prepare function without changing a line of its arithmetic, so a fixture
can run it. The pinned figures cover rated and unrated sets, an unknown
cardio day inside and outside the window, a duplicate awaiting review and
a session rated twice.

Analysis migration required: no
…s lanes

The Cardio and Strength screens computed "load vs your usual" their own
way: Cardio could fall back to non-TRIMP effort and knew no unknown days,
and both compared only through today. Tapping from Training Load to either
screen could therefore show a different percentage for the same week.

TrainingLoadLanes now holds the one strength and cardio lane computation,
read through any day. Training Load reads it through today. Cardio and
Strength read it through the selected week's Sunday, over their history
window plus the 84-day lookback a reading needs, and their load tiles and
coach context use it.

Analysis migration required: no
The three screens get one visual grammar while each keeps its own layout:
a lane hero card with status pill, count-up percentage and trend line,
a KPI strip, a load-over-time chart with 7D/4W/12W and the usual-week
band, summary tiles that open their full card, explainer rows that move
method text into sheets, a shared week control and a two-column layout
for wide windows. Blocks take finished values and only design tokens.
No screen uses them yet.

Analysis migration required: no
Copilot AI balanced review requested due to automatic review settings September 17, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants