PLASMA-7803: styles-API aggregator - #497
Conversation
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (83)
📝 WalkthroughWalkthroughAdds SDDS API metadata markers across component appearance declarations, introduces a SwiftSyntax-based generator with Props reconciliation and marker-plan support, and updates generated iOS appearance metadata with explicit unmapped parameters. ChangesiOS API metadata generation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GenerationScript
participant MetadataGenerator
participant SymbolTable
participant Scanner
participant Reconciler
participant MetadataJSON
GenerationScript->>MetadataGenerator: build and run
MetadataGenerator->>SymbolTable: parse Swift sources
MetadataGenerator->>Scanner: scan annotated components
Scanner->>Reconciler: match component fields and appearance params
Reconciler-->>MetadataGenerator: return reconciled metadata
MetadataGenerator->>MetadataJSON: serialize generated components
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@SDDSComponents/Sources/SDDSComponents/Components/SDDSAvatarGroup/SDDSAvatarGroup.swift`:
- Around line 132-135: Correct the sdds:apiName annotations in
AvatarGroupSizeConfiguration so itemSpacing maps to the borderWidth property and
itemOffset maps to the spacing property as intended, then regenerate the
associated API metadata file.
In `@Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift`:
- Around line 147-159: The generator must reject --output generation when
reconciliation reports contain gaps, unless the explicit override option is
enabled; add this validation to the flow using reports before writing output. In
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift lines
147-159, preserve report collection while ensuring unresolved gaps fail
generation. In SDDSThemeBuilder/.sdds/ios-api-meta.json lines 274-283, fix the
Avatar mapping and regenerate the metadata to remove the unresolved placeholder.
In `@Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Reconciler.swift`:
- Around line 62-95: The reconciliation flow in Reconciler.swift must reserve
each matched parameter identity across marker, override, and bestMatch
selections; reject or skip candidates whose normalized methodName is already in
usedParamKeys, and report duplicate claims. Apply this consistently to all three
matching paths so incompatible config IDs cannot share one target. Regenerate
SDDSThemeBuilder/.sdds/ios-api-meta.json for lines 2957-3004 after correcting
the duplicate textTypography mapping.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 391d0932-a443-4e00-8d03-00da97b06b8e
⛔ Files ignored due to path filters (1)
Tools/SDDSApiInfoGenerator/Package.resolvedis excluded by!**/Package.resolved
📒 Files selected for processing (83)
SDDSComponents/Sources/SDDSComponents/Components/SDDSAccordion/AccordionAppearance/AccordionAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSAccordionItem/AccordionItemAppearance/AccordionItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSAutocomplete/AutocompleteAppearance/AutocompleteAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSAvatar/AvatarAppearance/AvatarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSAvatarGroup/AvatarGroupAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSAvatarGroup/SDDSAvatarGroup.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSBadge/BadgeAppearance/BadgeAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSBadge/BadgeAppearance/BadgeSizeConfiguration.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSBottomSheet/BottomSheetAppearance/BottomSheetAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSButton/ButtonAppearance/ButtonAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSButton/ButtonAppearance/ButtonSize.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSButtonGroup/ButtonGroupAppearance/ButtonGroupAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCard/CardAppearance/CardAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCarousel/CarouselAppearance/CarouselAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCell/CellAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCheckbox/CheckboxAppearance/CheckboxAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCheckboxGroup/CheckboxGroupAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCheckboxGroup/SDDSCheckboxGroup.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSChip/ChipAppearance/ChipAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSChip/ChipAppearance/ChipSizeConfiguration.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSChipGroup/ChipGroupAppearance/ChipGroupAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCircularProgressBar/CircularProgressBarAppearance/CircularProgressBarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCodeField/CodeFieldAppearance/CodeFieldAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCodeInput/CodeInputAppearance/CodeInputAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCollapsingNavigationBar/CollapsingNavigationBarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCounter/CounterAppearance/CounterAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSCounter/CounterAppearance/CounterSize.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSDivider/DividerAppearance/DividerAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSDrawer/DrawerAppearance/DrawerAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSDropdownMenu/DropdownMenuAppearance/DropdownMenuAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSEditable/EditableAppearance/EditableAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSFormItem/FormItemAppearance/FormItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSImage/ImageAppearance/ImageAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSIndicator/IndicatorAppearance/IndicatorAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSList/ListAppearance/ListAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSListItem/ListItemAppearance/ListItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSLoader/LoaderAppearance/LoaderAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSModal/ModalAppearance/ModalAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNavigationBarInternalPage/NavigationBarInternalPageAppearance/NavigationBarInternalPageAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNavigationBarMainPage/NavigationBarMainPageAppearance/NavigationBarMainPageAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNote/NoteAppearance/NoteAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNoteCompact/NoteCompactAppearance/NoteCompactAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNotification/NotificationAppearance/NotificationAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSNotificationContent/NotificationContentAppearance/NotificationContentAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSOverlay/OverlayAppearance/OverlayAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSPaginationDots/PaginationDotsAppearance/PaginationDotsAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSPopover/PopoverAppearance/PopoverAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSProgressBar/ProgressBarAppearance/ProgressBarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSProgressBar/ProgressBarAppearance/ProgressBarSizeConfiguration.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSRadiobox/RadioboxAppearance/RadioboxAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSRadioboxGroup/Appearance/RadioboxGroupAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSRadioboxGroup/SDDSRadioboxGroup.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSRectSkeleton/SkeletonAppearance/SkeletonAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSScrollbar/ScrollbarAppearance/ScrollbarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSegment/SegmentAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentItem/SegmentItemAppearance/SegmentItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSelect/SelectAppearance/SelectAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSelectItem/SelectItemAppearance/SelectItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSpinner/SpinnerAppearance/SpinnerAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSSwitch/SwitchAppearance/SwitchAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTabBar/TabBarAppearance/TabBarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTabBar/TabBarIslandAppearance/TabBarIslandAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTabBar/TabBarItemAppearance/TabBarItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTabs/TabItemAppearance/TabItemAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTabs/TabsAppearance/TabsAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTextArea/TextAreaAppearance/TextAreaAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTextField/TextFieldAppearance/TextFieldAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTextField/TextFieldAppearance/TextFieldSizeConfiguration.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSToast/ToastAppearance/ToastAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSToolbar/ToolbarAppearance/ToolbarAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSTooltip/TooltipAppearance/TooltipAppearance.swiftSDDSComponents/Sources/SDDSComponents/Components/SDDSWheel/WheelAppearance/WheelAppearance.swiftSDDSComponents/Sources/SDDSComponents/Views/SelectionControl/SelectionControlSizeConfiguration.swiftSDDSThemeBuilder/.sdds/ios-api-meta.jsonTools/SDDSApiInfoGenerator/Package.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Meta.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/PropsCatalog.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Reconciler.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Scanner.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/SymbolTable.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/TypeCategory.swiftTools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swiftscripts/generate_api_meta.sh
| for meta in scanned { | ||
| if let fields = propsCatalog?.fields(forComponent: meta.componentName), !fields.isEmpty { | ||
| let (reconciled, report) = reconciler.reconcile( | ||
| meta: meta, | ||
| fields: fields, | ||
| overrides: overrides[meta.componentName] ?? [:] | ||
| ) | ||
| components.append(reconciled) | ||
| reports.append(report) | ||
| } else { | ||
| components.append(meta) | ||
| } | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
The generator publishes unresolved reconciliation gaps. Gaps only reach stderr reporting, while output generation succeeds and writes metadata with empty targets.
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift#L147-L159: reject--outputgeneration when reports contain gaps, unless explicitly overridden.SDDSThemeBuilder/.sdds/ios-api-meta.json#L274-L283: remove the unresolved Avatar placeholder by fixing its mapping and regenerating.
📍 Affects 2 files
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift#L147-L159(this comment)SDDSThemeBuilder/.sdds/ios-api-meta.json#L274-L283
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift` around
lines 147 - 159, The generator must reject --output generation when
reconciliation reports contain gaps, unless the explicit override option is
enabled; add this validation to the flow using reports before writing output. In
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/main.swift lines
147-159, preserve report collection while ensuring unresolved gaps fail
generation. In SDDSThemeBuilder/.sdds/ios-api-meta.json lines 274-283, fix the
Avatar mapping and regenerate the metadata to remove the unresolved placeholder.
| if let match = index[Self.normalize(field.id)]?.first(where: { | ||
| Self.normalize($0.id) == Self.normalize(field.id) && $0.id != $0.methodName | ||
| }) { | ||
| usedParamKeys.insert(Self.normalize(match.methodName)) | ||
| newParams.append(Param( | ||
| type: match.type, id: field.id, methodName: match.methodName, paramName: match.paramName, | ||
| paramQualifiedType: match.paramQualifiedType, paramSimpleType: match.paramSimpleType, | ||
| valueQualifiedType: match.valueQualifiedType, group: match.group | ||
| )) | ||
| continue | ||
| } | ||
| // Курируемый override (sidecar) — для структурных исключений, если заданы. | ||
| if let target = overrides[field.id], | ||
| let match = index[Self.normalize(target)]?.first { | ||
| usedParamKeys.insert(Self.normalize(match.methodName)) | ||
| newParams.append(Param( | ||
| type: match.type, id: field.id, methodName: match.methodName, paramName: match.paramName, | ||
| paramQualifiedType: match.paramQualifiedType, paramSimpleType: match.paramSimpleType, | ||
| valueQualifiedType: match.valueQualifiedType, group: match.group | ||
| )) | ||
| continue | ||
| } | ||
| if let match = bestMatch(for: field, in: index) { | ||
| usedParamKeys.insert(Self.normalize(match.methodName)) | ||
| newParams.append(Param( | ||
| type: match.type, | ||
| id: field.id, | ||
| methodName: match.methodName, | ||
| paramName: match.paramName, | ||
| paramQualifiedType: match.paramQualifiedType, | ||
| paramSimpleType: match.paramSimpleType, | ||
| valueQualifiedType: match.valueQualifiedType, | ||
| group: match.group | ||
| )) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Reconciliation permits duplicate Appearance targets. Selected params are tracked only for drift reporting, not excluded from subsequent matches, allowing incompatible config IDs to share one target.
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Reconciler.swift#L62-L95: reserve a unique parameter identity across marker, override, and heuristic matching; report duplicate claims.SDDSThemeBuilder/.sdds/ios-api-meta.json#L2957-L3004: regenerate after correcting the duplicatetextTypographymapping.
📍 Affects 2 files
Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Reconciler.swift#L62-L95(this comment)SDDSThemeBuilder/.sdds/ios-api-meta.json#L2957-L3004
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Tools/SDDSApiInfoGenerator/Sources/SDDSApiInfoGenerator/Reconciler.swift`
around lines 62 - 95, The reconciliation flow in Reconciler.swift must reserve
each matched parameter identity across marker, override, and bestMatch
selections; reject or skip candidates whose normalized methodName is already in
usedParamKeys, and report duplicate claims. Apply this consistently to all three
matching paths so incompatible config IDs cannot share one target. Regenerate
SDDSThemeBuilder/.sdds/ios-api-meta.json for lines 2957-3004 after correcting
the duplicate textTypography mapping.
| @@ -0,0 +1,32 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
это просто скрипт?
не часть cli?
There was a problem hiding this comment.
Надо держать в голове, что все инструменты по генерации кода, сборке документации, демо-приложений будут использоваться общей CLI. Поэтому возможно стоит подумать, чтобы собирать iOS tools как один общий бинарь
There was a problem hiding this comment.
ага, пока отдельный SPM-бинарь + скрипт-обёртка. отдельно от ThemeBuilder, тк он на xcodebuild и swift-syntax через SPM не подтянуть. сведу iOS-тулы в общий CLI в рамках задачи на универсальный генератор 👍
| @@ -0,0 +1,9193 @@ | |||
| [ | |||
There was a problem hiding this comment.
Результат выглядит норм. Теперь главное, чтобы его хватило универсальному генератору стилей)
There was a problem hiding this comment.
схема параметров как раз под контракт генератора. разводку сделаем в задаче на универсальный генератор, там и проверим на реальной генерации
| "group" : "root", | ||
| "id" : "shape", | ||
| "methodName" : "", | ||
| "paramName" : "", |
There was a problem hiding this comment.
это намеренно, у таких id нет пары в iOS Appearance: либо ручки на iOS вообще нет (как shape у BottomSheet), либо структурный кейс, где iOS схлопывает в одно свойство (paddingStart/End → EdgeInsets, offsetX/Y → CGPoint). добавил таким записям unmapped: true, чтоб не читалось как баг (пустой methodName = «id известен, прямого свойства нет», генератор их обрабатывает особо)
| "group" : "root", | ||
| "id" : "minWidth", | ||
| "methodName" : "", | ||
| "paramName" : "", |
There was a problem hiding this comment.
то же самое, пометил unmapped: true
…tions + SwiftSyntax meta)
52313d5 to
093ff4b
Compare
Summary by CodeRabbit