Skip to content

Respect muteContent in HorizontalLabeledContentStyle - #13

Merged
Jeehut merged 1 commit into
mainfrom
wip/labeled-content-mute
Oct 15, 2026
Merged

Jeehut merged 1 commit into
mainfrom
wip/labeled-content-mute

Conversation

@Jeehut

@Jeehut Jeehut commented Oct 14, 2026

Copy link
Copy Markdown
Member

Overview

HorizontalLabeledContentStyle(muteContent:) ignored its parameter and always rendered the content in .secondary. The content is now secondary only when muteContent is true (the default), so nothing changes for callers that don't pass false.

Split out of #7. Adds the small renderedPixels(of:) test helper, which compares two views rendered with ImageRenderer.

How this was verified

HorizontalLabeledContentStyleTests renders the style with muteContent: true and false and compares the pixels with a hand-built reference in .secondary and .primary.

Red, with main's style:

✔ mutedContentIsSecondary()
✘ unmutedContentIsPrimary(): unmuted == renderedPixels(of: self.reference(contentStyle: .primary))
✘ Test run with 2 tests in 1 suite failed with 1 issue.

Green, this branch:

✔ Test run with 2 tests in 1 suite passed.

The style always rendered the content in the secondary style, so
`.horizontal(muteContent: false)` had no effect.
@Jeehut
Jeehut merged commit d3766c3 into main Oct 15, 2026
5 checks passed
@Jeehut
Jeehut deleted the wip/labeled-content-mute branch October 15, 2026 10:47
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