[#6] feat: DVDesign Color 추가#11
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
Warning
|
| Layer / File(s) | Summary |
|---|---|
Color asset catalog foundation Projects/DVDesign/Resources/Assets.xcassets/color/Contents.json |
Root asset catalog metadata for the color directory, identifying the asset bundle as Xcode-managed. |
Color set definitions Projects/DVDesign/Resources/Assets.xcassets/color/black.colorset/Contents.json, Projects/DVDesign/Resources/Assets.xcassets/color/danger.colorset/Contents.json, Projects/DVDesign/Resources/Assets.xcassets/color/gray(100-900).colorset/Contents.json, Projects/DVDesign/Resources/Assets.xcassets/color/vault(dark, green, green dark, green tint).colorset/Contents.json, Projects/DVDesign/Resources/Assets.xcassets/color/warning.colorset/Contents.json, Projects/DVDesign/Resources/Assets.xcassets/color/white.colorset/Contents.json |
17 color assets defined with display-p3 or sRGB color spaces, each providing a default universal variant and a dark-mode (luminosity) appearance variant. White colorset updated to use display-p3 color space with corrected red component. |
Color token enum and computed accessors Projects/DVDesign/Sources/Foundations/Color/DVColor.swift |
DVColor public enum with CaseIterable conformance enumerating all 17 color tokens (e.g., vaultGreen, gray900, danger, warning). Computed property color: Color maps each token to its corresponding asset via module-bundled Color(_:bundle:) initialization. |
Color token factory and view modifiers Projects/DVDesign/Sources/Foundations/Color/Color+DVColor.swift, Projects/DVDesign/Sources/Foundations/Color/View+DVColor.swift |
Color.dv(_:) static factory unwraps a DVColor token to its underlying Color. View.dvForegroundColor(_:) and View.dvBackgroundColor(_:) modifiers apply token colors via foregroundStyle and background respectively. |
Cleanup Projects/DVDesign/Sources/Foundations/PlaceholderC.swift |
Removed placeholder comment. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
- DevaultProject/Devault-macOS#5: Both PRs establish foundational design system color assets and APIs; the related PR created the initial Assets.xcassets structure while this PR expands it with specific color definitions and a token-based abstraction layer.
Suggested reviewers
- dlguszoo
A palette of colors, neat and bright,
Tokens guide the way with design might,
From vault green deep to warnings' flame,
SwiftUI views now speak the same!
🐰✨
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The PR title references a feature addition for DVDesign Color with a ticket number, but uses Korean text that may not be universally clear to all team members reviewing the history. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
design/#6/Color_Setting
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
- Generate code and open pull requests
- Plan features and break down work
- Investigate incidents and troubleshoot customer tickets together
- Automate recurring tasks and respond to alerts with triggers
- Summarize progress and report instantly
Built for teams:
- Shared memory across your entire org—no repeating context
- Per-thread sandboxes to safely plan and execute work
- Governance built-in—scoped access, auditability, and budget controls
One agent for your entire SDLC. Right inside Slack.
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 help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@Projects/DVDesign/Resources/Assets.xcassets/color/vault` green
dark.colorset/Contents.json:
- Line 5: The dark-variant Contents.json uses "color-space" : "display-p3" while
the light variant uses "srgb", causing a tone mismatch; open the Contents.json
for the vault green dark.colorset and change its "color-space" value to match
the light variant (or vice versa) so both entries use the same color-space
string ("srgb" or "display-p3") for the "color-space" key to keep light/dark
color consistency.
In `@Projects/DVDesign/Resources/Assets.xcassets/color/vault`
green.colorset/Contents.json:
- Around line 5-31: The Contents.json entry for the "vault green" color asset
uses "color-space" : "srgb" for both light and dark appearances, causing a
mismatch with other new tokens that use "display-p3"; update the "color-space"
fields in the vault green asset's Contents.json (both appearance blocks under
the "color" object) from "srgb" to "display-p3" so it matches the project's
color-space convention and preserves correct rendering and token consistency.
🪄 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: 69ba71ad-fcdb-4d05-be56-586b1012248e
📒 Files selected for processing (22)
Projects/DVDesign/Resources/Assets.xcassets/color/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/black.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/danger.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray100.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray200.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray300.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray400.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray500.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray600.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray700.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray800.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/gray900.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/vault dark.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/vault green dark.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/vault green tint.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/vault green.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/warning.colorset/Contents.jsonProjects/DVDesign/Resources/Assets.xcassets/color/white.colorset/Contents.jsonProjects/DVDesign/Sources/Foundations/Color/Color+DVColor.swiftProjects/DVDesign/Sources/Foundations/Color/DVColor.swiftProjects/DVDesign/Sources/Foundations/Color/View+DVColor.swiftProjects/DVDesign/Sources/Foundations/PlaceholderC.swift
💤 Files with no reviewable changes (1)
- Projects/DVDesign/Sources/Foundations/PlaceholderC.swift
| "color-space" : "srgb", | ||
| "components" : { | ||
| "alpha" : "1.000", | ||
| "blue" : "0x75", | ||
| "green" : "0x9E", | ||
| "red" : "0x2D" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| }, | ||
| { | ||
| "appearances" : [ | ||
| { | ||
| "appearance" : "luminosity", | ||
| "value" : "dark" | ||
| } | ||
| ], | ||
| "color" : { | ||
| "color-space" : "srgb", | ||
| "components" : { | ||
| "alpha" : "1.000", | ||
| "blue" : "0x75", | ||
| "green" : "0x9E", | ||
| "red" : "0x2D" | ||
| } | ||
| }, | ||
| "idiom" : "universal" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 1) Show all color spaces used in the new color assets.
fd 'Contents.json' Projects/DVDesign/Resources/Assets.xcassets/color -t f \
-x sh -c 'printf "\n== %s ==\n" "$1"; rg -n "\"color-space\"" "$1"' sh {}
# 2) Locate DVColor mapping and check exact string used for "vault green".
fd 'DVColor.swift' Projects/DVDesign/Sources -t f \
-x sh -c 'printf "\n== %s ==\n" "$1"; rg -n "vault green|gray100|gray200|gray400|gray700|gray800|gray900|Color\\(" "$1"' sh {}Repository: DevaultProject/Devault-macOS
Length of output: 4764
Address color-space inconsistency for vault green.
This token uses srgb while all other new color tokens use display-p3, creating a visual inconsistency. DVColor correctly maps the asset name including the space, so token lookup works.
🤖 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 `@Projects/DVDesign/Resources/Assets.xcassets/color/vault`
green.colorset/Contents.json around lines 5 - 31, The Contents.json entry for
the "vault green" color asset uses "color-space" : "srgb" for both light and
dark appearances, causing a mismatch with other new tokens that use
"display-p3"; update the "color-space" fields in the vault green asset's
Contents.json (both appearance blocks under the "color" object) from "srgb" to
"display-p3" so it matches the project's color-space convention and preserves
correct rendering and token consistency.
✨ What’s this PR?
📌 관련 이슈 (Related Issue)
🧶 주요 변경 내용 (Summary)
디자인 시스템
DVDesign모듈의 컬러 관리 방식을 개선하고, 폰트 시스템(DVFont)과 일관된 사용성을 갖추도록 구성.DVColorEnum 도입:Colorextension 방식에서 Enum 기반 토큰 시스템으로 전환.dvForegroundColor,.dvBackgroundColor) 및 Static Factory(.dv()) 제공Foundations/Color디렉토리 하위로 관련 소스 코드(Enum, Extension, ViewModifier) 통합 관리🧪 테스트 / 검증 내역
DVColorEnum을 통한 17종 컬러 에셋 매핑 정상 작동 확인.dvFont()와.dvForegroundColor()Modifier 간의 혼용성 검증💬 기타 공유 사항
DVColorEnum 내부의color계산 프로퍼티에서colorScheme분기 로직을 통합 관리할 수 있도록 구조를 마련해 두었습니다.🙇🏻♀️ 리뷰 가이드 (선택)
Projects/DVDesign/Sources/Foundations/Color/DVColor.swift파일의 에셋 매핑 로직이 누락된 색상 없이 정확한지 확인 부탁드립니다.DVFont와 동일하게 도입된.dv()static method 사용성이 직관적인지 의견 부탁드립니다.Summary by CodeRabbit