Skip to content

Strip symbol metadata in Image and Label convertible initializers - #11

Merged
Jeehut merged 1 commit into
mainfrom
wip/convertible-symbol-metadata
Oct 15, 2026
Merged

Jeehut merged 1 commit into
mainfrom
wip/convertible-symbol-metadata

Conversation

@Jeehut

@Jeehut Jeehut commented Oct 14, 2026

Copy link
Copy Markdown
Member

Overview

Image(convertible:) and Label(convertible:) passed the raw symbolName to Image(systemName:), including the :angle*count metadata that CustomSymbolConvertible documents as ignored (e.g. "star:45*2"). That is not a valid symbol name, so no image showed. Both now use symbolSystemName, as CustomLabelConvertible.label already did. This also fixes the CaseIterable Picker initializer and SideTabView, which go through these initializers.

Split out of #7.

How this was verified

ConvertibleTests uses a type whose symbolName is "star:45*2" and expects the same image as Image(systemName: "star").

Red, with main's sources:

✘ imageUsesTheSymbolNameWithoutMetadata(): Image(convertible: RotatedStar()) == Image(systemName: "star")
✘ labelUsesTheSymbolNameWithoutMetadata(): icon == Image(systemName: "star")
✘ Test run with 2 tests in 1 suite failed with 2 issues.

Green, this branch:

✔ Test run with 2 tests in 1 suite passed.

CustomSymbolConvertible allows metadata after `:` or `*` (rotation
and repeat count used by HPicker and VPicker) and documents that it is
ignored when creating images. Image(convertible:) and
Label(convertible:) passed the raw name though, so such symbols showed
no icon at all, also in the CaseIterable Picker initializer and
SideTabView that build on them.
@Jeehut
Jeehut merged commit f1279a5 into main Oct 15, 2026
5 checks passed
@Jeehut
Jeehut deleted the wip/convertible-symbol-metadata branch October 15, 2026 08:51
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