[SwiftUI] Update LemonadeBadge to use modifier instead of direct argument#149
Open
abiliogp wants to merge 1 commit into
Open
[SwiftUI] Update LemonadeBadge to use modifier instead of direct argument#149abiliogp wants to merge 1 commit into
abiliogp wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the SwiftUI LemonadeUi.Badge API to configure badge sizing via a view modifier (environment-driven) rather than a direct function parameter, and updates usages across components and the SampleApp accordingly.
Changes:
- Refactors
LemonadeUi.Badgeto readLemonadeBadgeSizefrom environment and introduces abadgeSize(_:)modifier. - Updates component previews/usages (Tile, SymbolContainer) and SampleApp screens to the new modifier-based API.
- Applies formatting/whitespace-only adjustments in several SwiftUI component/sample files.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| swiftui/Sources/Lemonade/Components/LemonadeBadge.swift | Introduces environment-based badge sizing + badgeSize(_:) modifier; updates Badge API and previews. |
| swiftui/Sources/Lemonade/Components/LemonadeTile.swift | Updates Tile preview addon badge usage to new modifier API (plus whitespace). |
| swiftui/Sources/Lemonade/Components/LemonadeSymbolContainer.swift | Updates preview badge usage to new modifier API (plus whitespace). |
| swiftui/SampleApp/BadgeDisplayView.swift | Migrates sample badge usages to modifier API; demo sizing needs correction in a couple places. |
| swiftui/SampleApp/TileDisplayView.swift | Migrates sample Tile addon badges to modifier API (plus whitespace). |
| swiftui/SampleApp/SymbolContainerDisplayView.swift | Migrates sample SymbolContainer badge to modifier API (plus whitespace). |
| swiftui/SampleApp/ListItemDisplayView.swift | Migrates trailing badge to modifier API (plus whitespace). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ca4b667 to
3ac587b
Compare
e50dafa to
7278866
Compare
williankl
reviewed
Apr 16, 2026
williankl
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, but I am not really the best person to review this
cc @hrafaelveloso
caiqueslp
previously approved these changes
Apr 17, 2026
7278866 to
b82c7ef
Compare
williankl
approved these changes
May 20, 2026
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
Update the LemonadeBadge to use a modifier
It makes it more flexible to use and extend.
Figma component
https://www.figma.com/design/91S16rhVrl5wivqV66fNjm/%F0%9F%8D%8B-Lemonade-DS---New-App-Components?node-id=2201-68&p=f&t=QwYH3DuXBSAEjzV4-0
Screenshot