feat(design): strength and cardio lane colour tokens - #26
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
There was a problem hiding this comment.
🟡 Changes recommended
Add coverage for public accessors and shared canonical palette references.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds style-aware Strength and Cardio identity color tokens to StrandPalette for the upcoming redesign.
Changes:
- Adds light/dark lane colors and gradients across seven chart styles.
- Adds hue-separation and contrast regression tests.
- Requires no analysis migration; tokens are not yet consumed by screens.
File summaries
| File | Summary |
|---|---|
Packages/StrandDesign/Tests/StrandDesignTests/LaneColorTests.swift |
Tests lane color separation and contrast. |
Packages/StrandDesign/Sources/StrandDesign/Palette.swift |
Defines lane color tables and public palette accessors. |
Review details
Suppressed comments (2)
Packages/StrandDesign/Sources/StrandDesign/Palette.swift:830
- The new tests never exercise the public token accessors introduced here: every assertion reads
LaneColorTable.style(style)directly. A wiring error such as selecting the wrong field for an accessor or using the wrong gradient endpoints would therefore leave the suite green while consumers receive the wrong color. Add coverage that resolves each publicstrength*/cardio*token and both gradients for every style and scheme, or make the accessors consume a shared mapping that is itself exercised.
public static var strengthDeep: Color {
let hex = LaneColorTable.style(chartStyle).strengthDeep
return Color(light: hex.light, dark: hex.dark)
Packages/StrandDesign/Tests/StrandDesignTests/LaneColorTests.swift:76
- The separation and contrast checks use copied literals for the existing status, charge, effort, and
onDarkPrimarytokens rather than the canonical palette definitions. If one of those tokens changes later, these tests can still pass even though a lane becomes hue-close to the new status/charge color or its real text contrast drops below 4.5:1. Keep the reference pairs in the same source tables as their accessors, or otherwise provide one shared source of truth for production and tests.
// Existing token hex values, copied from `StrandPalette` (Palette.swift) for the hue-separation
// checks below — NOT changed by this change; see the file for their canonical definitions.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+127
to
+129
| private func lane(_ style: ChartStyle) -> StrandPalette.LaneColorTable.Style { | ||
| StrandPalette.LaneColorTable.style(style) | ||
| } |
This was referenced Sep 17, 2026
DX23876
added a commit
that referenced
this pull request
Sep 17, 2026
…o dodge an x86_64 emit-module crash The universal macOS leg of app-build.yml crashes swift-frontend during x86_64 module emission (the -experimental-skip-non-inlinable-function-bodies path of incremental Debug mode) with a stack dump and no source diagnostic. It failed on every redesign PR (#26-#31) and on the upstream sync branch. Whole-module mode, set only on the CI xcodebuild invocation, avoids that code path; local incremental builds are unchanged. Taken from 4bb8e9e on sync/upstream-2026-09-17, which is not merged yet. Analysis migration required: no
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
First package of the Training Load / Cardio / Strength redesign. Strength and Cardio both used
effortColor, so the two training lanes could not be told apart. This adds one identity colour per lane toStrandPalette:strengthDeep/Color/Bright/Gradient: electric tealcardioDeep/Color/Bright/Gradient: violet-indigoIt covers all seven chart styles in light and dark. Signature and Health are the most vivid; Aurora and Forest are muted to fit their palettes. Orange, red and yellow are status colours and green is Charge, so a lane never reads as a status. The hex values sit in
LaneColorTable, so tests read the source values directly.No screen uses the tokens yet; the redesign packages that follow will.
Verification
swift test --filter LaneColorTestsinPackages/StrandDesign: 4/4 pass. The tests cover:strengthDeep/cardioDeepagainstonDarkPrimaryis at least 4.5:1.testRecoveryStateWords(PlaceholderTests.swift, untouched here). It expects English recovery words and gets German ones under a German system locale.python3 Tools/doc_comment_lint.py: OK.Analysis migration required: no