Skip to content

ALFMOB-269: Refactor Badge component to use design tokens#93

Open
khoinguyen-mindera wants to merge 4 commits into
mainfrom
ALFMOB-269-refactor-badge-tokens
Open

ALFMOB-269: Refactor Badge component to use design tokens#93
khoinguyen-mindera wants to merge 4 commits into
mainfrom
ALFMOB-269-refactor-badge-tokens

Conversation

@khoinguyen-mindera

@khoinguyen-mindera khoinguyen-mindera commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Ticket

ALFMOB-269

Summary

  • Source BadgeViewModifier and BadgeTabViewModifier styling from the generated design-token system.
  • Migrate badge colors from raw Primitives.Colours.* to the semantic Theme.* layer (surfaceBackgroundDestructive / contentContentInvertedPrimary / surfaceBackgroundPrimary), matching the ALFMOB-271 ThemedButton precedent.
  • Replace hardcoded sizing constants with Primitives.Spacing.* tokens (badge height 16, text padding 4, indicator 12); borderLineWidth/capsuleOffsetXFactor stay literal (no token equivalent, documented inline).
  • Remove the unused badgePadding constant.
  • No visual change — every token resolves to the previous value. Public modifier API unchanged, so no call sites are affected.

Screenshot

Copilot AI review requested due to automatic review settings July 9, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors badge styling in SharedUI to source colors and sizing from the generated design-token system (Theme + Primitives), keeping the public modifier APIs unchanged and aiming for no visual differences.

Changes:

  • Updates BadgeViewModifier to use Theme.* semantic colors and Primitives.Spacing.* sizing tokens.
  • Updates BadgeTabViewModifier badge color/text attributes to use Theme.* semantic colors.
  • Removes an unused sizing constant and adds inline documentation for remaining literals.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Alfie/AlfieKit/Sources/SharedUI/Components/Indicators/BadgeViewModifier.swift Migrates badge view colors and sizing from raw primitives/literals to Theme + spacing tokens.
Alfie/AlfieKit/Sources/SharedUI/Components/Indicators/BadgeTabViewModifier.swift Migrates UITabBarItem badge appearance colors to Theme semantic tokens.

Comment thread Alfie/AlfieKit/Sources/SharedUI/Components/Indicators/BadgeViewModifier.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

2 participants