feat: Primitive/Radius/Dimension 토큰 추가 및 Spacing 갱신#486
Conversation
Figma "2 Typo / Grid / Number" variables 정의를 SwiftUI 토큰으로 이식. - Primitive: 0,1,2,4,6,8,10,12,14,16,18,20,24,32,40,48,56,64,72,80,9999 (21개) - Radius: 0,4,8,10,12,14,16,20,24 (9개, scope CORNER_RADIUS) - Dimension: 14,16,18,20,24,32,40,48,56,64 (10개, scope WIDTH_HEIGHT) - Spacing: pt01~pt80 → s0~s80 으로 Figma 정합 (BREAKING) CGFloat/Float 확장에 .primitive/.radius/.spacing/.dimension 헬퍼 제공. make 실행으로 documentation·MCP 데이터 동기화 포함. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 29 minutes and 16 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
워크스루이 PR은 Montage 디자인 시스템의 토큰 아키텍처를 재설계합니다. 새로운 Primitive 기반 계층 위에 Dimension과 Radius 토큰을 추가하고, 기존 Spacing과 Opacity를 열거형 케이스 기반에서 정적 프로퍼티 기반으로 마이그레이션하여 토큰 접근성을 개선합니다. 변경 사항토큰 시스템 개선
예상 코드 리뷰 난이도🎯 4 (복잡함) | ⏱️ ~45분 제안된 라벨
제안된 리뷰어
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
- enum + static func 형태를 CGFloat static let 확장으로 교체 (예: .spacing(.s16) → .spacing16)
- Spacing/Radius/Dimension은 .primitive{N}을 참조하여 일관성 유지
- dimension28 및 primitive28 신규 추가
- primitive9999를 primitiveInfinity로 개명 (값은 .infinity)
- Float extension 제거 (CGFloat만 제공)
- DocC 페이지 식별을 위한 빈 enum placeholder 유지 (Spacing/Radius/Dimension/Primitive)
- 주석 단위 px → pt로 통일
BREAKING CHANGE: .spacing(.s16) 형태의 함수형 API 제거
- enum Opacity + static func 형태를 CGFloat static let 확장으로 교체 (예: .opacity(.p052) → .opacity52) - 선행 0 표기 폐기: .p008 → .opacity8, .p100 → .opacity100 - Color.Semantic.resolve()를 CGFloat 직접 사용으로 마이그레이션 (.opacity() 래퍼 제거) - ContentBadgeUIView 호출부 마이그레이션 - DocC 페이지 식별을 위한 빈 Opacity enum placeholder 유지 - Float extension 제거 (CGFloat만 제공) BREAKING CHANGE: Opacity enum 케이스 (.p000 ~ .p100) 제거
디자이너 요청에 따라 36pt 토큰 추가. Dimension은 .primitive36을 참조한다.
- Primitive: '원시 값 — Spacing/Radius/Dimension에 없는 값이 필요할 때만 직접 사용' - Spacing: 'Npt의 간격' (spacing16은 '기본 간격') - Radius: 'Npt의 모서리 반경' (radius0은 '직각') - Dimension: 'Npt의 크기' - Opacity: 'N%의 불투명도' (opacity0/100은 완전 투명/불투명 명시)
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/build_mcp_data.js (1)
296-305: 💤 Low valueseed tokens 객체에 새 토큰 타입 누락
TOKEN_NAMES에radius,dimension,primitive가 추가되었지만,ensureFigmaMapping의 seed tokens 객체에는 반영되지 않았습니다. figma-mapping.json이 처음 생성될 때 일관성을 위해 추가하는 것이 좋습니다.♻️ 제안 수정
const seed = { version: 1, description: 'Manual Figma component/token → Montage Swift mapping. Convention-based matching is the fallback; entries here override.', components: {}, - tokens: { color: {}, typography: {}, spacing: {}, shadow: {}, opacity: {} }, + tokens: { color: {}, typography: {}, spacing: {}, shadow: {}, opacity: {}, radius: {}, dimension: {}, primitive: {} }, };🤖 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 `@scripts/build_mcp_data.js` around lines 296 - 305, The seed object created in ensureFigmaMapping (used to write figma-mapping.json) is missing the newly added token types; update the seed.tokens structure to include empty objects for "radius", "dimension", and "primitive" (matching TOKEN_NAMES) so the initial figma-mapping.json contains those keys and stays consistent with the rest of the codebase.
🤖 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 `@Sources/Montage/1` Components/9 Utilities/Primitive.swift:
- Around line 72-73: primitiveInfinity currently exposes a non-finite CGFloat
(.infinity); change the public constant Primitive.primitiveInfinity in
Primitive.swift to a finite value matching the Figma token (use CGFloat(9999))
and update its doc comment to reflect the 9999 mapping; after making the change,
run the project make task to regenerate documentation and
THIRD_PARTY_LICENSES.md so docs stay in sync.
---
Nitpick comments:
In `@scripts/build_mcp_data.js`:
- Around line 296-305: The seed object created in ensureFigmaMapping (used to
write figma-mapping.json) is missing the newly added token types; update the
seed.tokens structure to include empty objects for "radius", "dimension", and
"primitive" (matching TOKEN_NAMES) so the initial figma-mapping.json contains
those keys and stays consistent with the rest of the codebase.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 090099fc-4f4d-4d22-9e57-cc20bcf550b0
📒 Files selected for processing (17)
.gitignoreSources/Montage/1 Components/4 Contents/ContentBadgeUIView.swiftSources/Montage/1 Components/9 Utilities/Color.swiftSources/Montage/1 Components/9 Utilities/Dimension.swiftSources/Montage/1 Components/9 Utilities/Opacity.swiftSources/Montage/1 Components/9 Utilities/Primitive.swiftSources/Montage/1 Components/9 Utilities/Radius.swiftSources/Montage/1 Components/9 Utilities/Spacing.swiftdocumentation/utilities/ios-extensions/corefoundation.mddocumentation/utilities/ios-extensions/swift.mddocumentation/utilities/ios-utility-components/dimension.mddocumentation/utilities/ios-utility-components/opacity.mddocumentation/utilities/ios-utility-components/primitive.mddocumentation/utilities/ios-utility-components/radius.mddocumentation/utilities/ios-utility-components/spacing.mdpackages/montage-mcp/data/tokens.jsonscripts/build_mcp_data.js
💤 Files with no reviewable changes (1)
- documentation/utilities/ios-extensions/swift.md
✅ Files skipped from review due to trivial changes (1)
- .gitignore
TOKEN_NAMES에는 radius/dimension/primitive를 추가했지만 ensureFigmaMapping의 seed tokens 객체에 반영되지 않아 figma-mapping.json 최초 생성 시 일관성이 깨질 수 있었음. CodeRabbit nitpick 반영.
개요
Figma "2 Typo / Grid / Number" 라이브러리 variables 정의를 SwiftUI 토큰으로 이식. 컴포넌트에 적용하는 용도의 디자인 토큰 4종(Primitive, Radius, Spacing, Dimension)을 도입합니다. 컴포넌트별 토큰 적용은 별도 브랜치에서 진행 예정.
수정사항
Primitive(신규, 21개): 0,1,2,4,6,8,10,12,14,16,18,20,24,32,40,48,56,64,72,80,9999Radius(신규, 9개, scopeCORNER_RADIUS): 0,4,8,10,12,14,16,20,24Dimension(신규, 10개, scopeWIDTH_HEIGHT): 14,16,18,20,24,32,40,48,56,64Spacing(갱신, 19개, scopeGAP):pt01~pt80→s0~s80(BREAKING — release/4.0.0 메이저 적합)CGFloat/Floatextension에.primitive/.radius/.spacing/.dimension헬퍼 추가make실행으로 documentation·MCP 데이터 동기화미리보기
N/A (enum 토큰 — UI 컴포넌트 변경 없음. 컴포넌트 적용은 별도 PR 예정)