Add duplicate style name detection across categories in configurator#7
Merged
Conversation
Co-authored-by: rozd <158493+rozd@users.noreply.github.com>
rozd
approved these changes
Feb 20, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
=======================================
Coverage 99.30% 99.30%
=======================================
Files 28 28
Lines 1154 1154
=======================================
Hits 1146 1146
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
When tokens across different categories resolve to the same effective style name (
style ?? name), the generated Swift code produces duplicate static properties onShapeStyle, causing compiler errors. The configurator now detects and warns about these conflicts.Changes
validation.js: AddedfindDuplicateStyleName()to compare effective style names across all enabled categories, returning the conflicting category namestate.svelte.js: ExportedgetAllStyles()to provide validation access to all token dataTokenTag.svelte: Integrated duplicate detection using Svelte 5's$derivedfor reactive updates; shows warning icon and tooltip identifying the conflicting categoryTokenPopover.svelte: Displays inline warning message when duplicates detected: "Style name.{name}is already used by another token in {Category}. This will cause a compiler error."TokenField.svelte: Passes category context to enable proper duplicate detectionAll conflicts (both SwiftUI built-ins and cross-category duplicates) use the same visual treatment: red outline/background with warning icon.
Example conflict scenario that now shows warnings:
{ "colors": ["surface"], "gradients": [{"name": "vibrant", "style": "surface"}] }Both tokens now highlight with warnings since they both resolve to
.surface.