ALFMOB-273: Source Chip styling from semantic Theme tokens#94
Open
khoinguyen-mindera wants to merge 4 commits into
Open
ALFMOB-273: Source Chip styling from semantic Theme tokens#94khoinguyen-mindera wants to merge 4 commits into
khoinguyen-mindera wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the SharedUI Chip component’s styling to be driven by semantic Theme.* tokens where available, and extracts the state→style resolution into a testable value type (ChipStyle). It also adds unit tests to cover the state→token mapping and counter-label logic.
Changes:
- Extract
ChipStylefromChipand rewireChip.bodyto consumeChipStyleproperties. - Replace hardcoded normal border width (
1.0) withCGFloat(Primitives.Border.borderWeightDefault)and map eligible colors through semanticTheme.*aliases. - Add
ChipStyleTeststo cover border/text/background color mapping, border width, height, and counter label boundaries.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Docs/Plans/ALFMOB-273-refactor-chip-tokens/scope.md | Scout report documenting existing token usage and remaining hardcoded constants. |
| Docs/Plans/ALFMOB-273-refactor-chip-tokens/plan.md | Plan defining semantic token mapping decisions and test strategy for ChipStyle. |
| Docs/Plans/ALFMOB-273-refactor-chip-tokens/phase-1-chip-tokens.md | Execution steps and acceptance criteria for the single-slice refactor + tests. |
| Docs/Plans/ALFMOB-273-refactor-chip-tokens/grill.md | Recorded decisions for semantic aliases and the ChipStyle extraction approach. |
| Docs/Plans/ALFMOB-273-refactor-chip-tokens/_status.md | Status tracking for the ticket workflow and verification checkpoints. |
| Alfie/AlfieKit/Sources/SharedUI/Components/Chips/Chip.swift | Implements ChipStyle, migrates styling to semantic tokens + border token, rewires Chip rendering. |
| Alfie/AlfieKit/Tests/SharedUITests/ChipStyleTests.swift | Adds unit coverage for state→style/token mapping and counter label formatting. |
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.
Ticket
ALFMOB-273
Summary
ChipStylevalue type fromChip(mirrors theBadgeHelperpattern) so the state→style mapping is unit-testable without snapshotsTheme.*layer instead of raw primitives:borderSoft/contentContentPrimary/surfaceForegroundPrimary(border),contentContentPrimaryDisabled(text),surfaceBackgroundPrimary/surfaceForegroundPrimary(background)Primitives.Border.borderWeightDefaultinstead of a hardcoded1.0(consistent with Badge ALFMOB-269)neutrals600— noThemealias exists at that valueChipStyleTests(21 XCTest cases) covering every state→token mapping plus counter-label boundariesScreenshot