feat(training): shared design kit for the load screens - #28
Merged
Merged
Conversation
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
This was referenced Sep 17, 2026
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
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.swiftadds 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.TrainingLaneLoadPillState+LoadStatusPillLoadHeroCardcompactfor half widthLaneHeroSurfaceKPIStrip/KPIItemLoadHistoryChart+LoadHistoryBucketsSummaryTileExplainerRows/ExplainerItemTrainingWeekControlAdaptiveTwoColumnLoadFormat.signedPercentkeeps 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 withTrainingLoadLanesTests: 10 tests pass.xcodebuild -scheme Strand(macOS) and-scheme NOOPiOS(iOS Simulator) both build.ImageRendererin 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..stringsdata. They were added toStrand/Resources/Localizable.xcstringsas a purely additive change, translated into all nine languages, and mirrored inTools/translations/*.json.python3 Tools/i18n_audit.py --ci origin/mainexits 0.python3 Tools/doc_comment_lint.py: OK.Analysis migration required: no