Design/#13/UI component 구현 - #18
Hidden character warning
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 19 minutes and 42 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough이 PR은 DVDesign 시스템에 8개의 새로운 SwiftUI UI 컴포넌트를 추가하고, 각 컴포넌트의 미리보기 화면을 SampleApp에 구현합니다. ContentView의 라우팅 로직을 컴포넌트 이름 기반으로 변경하여 해당 미리보기를 동적으로 표시하도록 통합했습니다. ChangesUI 컴포넌트 라이브러리 확충
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
Projects/DVDesign/SampleApp/Sources/DVSecretTypePreviewView.swift (1)
10-39: ⚡ Quick win
body내부 중첩 레이아웃을 private 서브뷰로 분리해 주세요.현재
ScrollView/VStack/여러previewSection이body에 직접 중첩되어 있어, 섹션별private var/private func로 분리하면 가독성과 유지보수성이 좋아집니다.As per coding guidelines
var body 안에 중첩 레이아웃이 직접 구현되어 있으면 extension의 private var/func로 분리를 제안하세요.🤖 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/SampleApp/Sources/DVSecretTypePreviewView.swift` around lines 10 - 39, The body of DVSecretTypePreviewView contains nested ScrollView/VStack/previewSection blocks; extract each logical subsection into private helper views or vars (e.g., private var iconlessSection, private var iconSection, private func otherTypesSection() -> some View) and replace the inline blocks in var body with those private members; keep the navigationTitle and outer ScrollView wrapper in body and ensure the extracted helpers return the same view types and use the existing previewSection and DVSecretType calls to preserve behavior.Projects/DVDesign/SampleApp/Sources/DVVaultContainerPreviewView.swift (1)
16-60: ⚡ Quick win프리뷰의 중첩 레이아웃을
private섹션 단위로 분리해 주세요.
body에 섹션이 직접 길게 배치되어 있어, 섹션별private var/func로 추출하면 파일 구성 규칙과 일관성이 맞아집니다.As per coding guidelines
var body 안에 중첩 레이아웃이 직접 구현되어 있으면 extension의 private var/func로 분리를 제안하세요.🤖 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/SampleApp/Sources/DVVaultContainerPreviewView.swift` around lines 16 - 60, The body currently contains long nested preview sections; extract each previewSection block (e.g., the "Interactive" VStack using vaults and selected, and the static "Selected", "Unselected", "Expiring Soon", "Expired" blocks that create DVVaultContainer) into private helpers—either private var views or private func view builders—so body becomes a high-level Stack that calls these helpers; create a private extension (or private section) with functions like interactivePreview(), selectedPreview(), unselectedPreview(), expiringSoonPreview(), expiredPreview() that return some View and reference vaults, selected, and the DVVaultContainer initializers, ensuring closures and state bindings (selected) are captured correctly.Projects/DVDesign/SampleApp/Sources/DVTitleBarPreviewView.swift (1)
14-40: ⚡ Quick win프리뷰 섹션 구성을
private서브뷰로 분리해 주세요.
body가 섹션 구성/스타일링까지 한 번에 담고 있어,interactiveSection,expiredSection같은private var로 분리하면 변경 추적이 쉬워집니다.As per coding guidelines
var body 안에 중첩 레이아웃이 직접 구현되어 있으면 extension의 private var/func로 분리를 제안하세요.🤖 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/SampleApp/Sources/DVTitleBarPreviewView.swift` around lines 14 - 40, DVTitleBarPreviewView's body currently contains nested layout for both "Interactive" and "Expired" previews; extract each section into private computed subviews (e.g., private var interactiveSection: some View and private var expiredSection: some View) in an extension so body only composes those vars. Move the existing previewSection blocks that build DVTitleBar (including the .frame and .background modifiers) into those private vars, keep previewSection("Interactive") and previewSection("Expired") usage, and update body to reference interactiveSection and expiredSection instead of inlining the blocks.Projects/DVDesign/Sources/Components/DVButton.swift (1)
13-46: ⚡ Quick win
Style의 computed property들에fileprivate접근 제어를 추가하세요.
cornerRadius,height,horizontalPadding,width,font는DVButton파일 내부에서만 사용되는 구현 세부사항입니다. 현재 기본값인internal보다fileprivate이 더 엄격한 접근 제어 수준이므로, 외부 노출을 최소화할 수 있습니다.♻️ 제안하는 수정
- var cornerRadius: CGFloat { + fileprivate var cornerRadius: CGFloat { switch self { case .primary: return 20 case .secondary: return 6 } } - var height: CGFloat { + fileprivate var height: CGFloat { switch self { case .primary: return 40 case .secondary: return 24 } } - var horizontalPadding: CGFloat { + fileprivate var horizontalPadding: CGFloat { switch self { case .primary: return 16 case .secondary: return 16 } } - var width: CGFloat { + fileprivate var width: CGFloat { switch self { case .primary: return 242 case .secondary: return 74 } } - var font: DVFont { + fileprivate var font: DVFont { switch self { case .primary: return .bodyLG case .secondary: return .bodyMD } }가이드라인 준수: "접근 제어가 가능한 가장 엄격한 수준인지 확인하세요. (
private>fileprivate>internal)"🤖 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/Sources/Components/DVButton.swift` around lines 13 - 46, The computed properties on Style (cornerRadius, height, horizontalPadding, width, font) are currently internal but should be limited to file scope; update each property declaration in the Style type to use fileprivate access control (e.g., fileprivate var cornerRadius, fileprivate var height, etc.) so these implementation details remain private to the DVButton.swift file.Projects/DVDesign/Sources/Components/DVCategory.swift (1)
81-84: 💤 Low value
borderOverlay의 cornerRadius 불일치 확인 필요Line 40의 배경
clipShape는cornerRadius: 16을 사용하는데, 여기서는12를 사용하고 있습니다. 의도된 디자인이 아니라면 동일한 값(16)으로 통일하는 것을 권장합니다.수정 제안
private var borderOverlay: some View { - RoundedRectangle(cornerRadius: 12) + RoundedRectangle(cornerRadius: 16) .stroke(isHovered && !isSelected ? Color.dv(.gray300) : Color.clear, lineWidth: 1) }🤖 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/Sources/Components/DVCategory.swift` around lines 81 - 84, borderOverlay의 RoundedRectangle에 설정된 cornerRadius(12)가 배경의 clipShape에서 사용한 cornerRadius(16)와 불일치합니다; DVCategory.swift의 private var borderOverlay를 찾아 RoundedRectangle(cornerRadius: 12) 값을 디자인과 일치하도록 16으로 변경(나머지 속성인 .stroke(..., lineWidth: 1)은 유지)하여 두 요소의 모서리 반경을 통일하세요.Projects/DVDesign/Sources/Components/DVProjectContainer.swift (1)
80-83: 💤 Low value
borderOverlay의 cornerRadius 불일치 확인 필요Line 40의 배경
clipShape는cornerRadius: 6을 사용하는데, 여기서는8을 사용하고 있습니다. 의도된 디자인이 아니라면 동일한 값(6)으로 통일하는 것을 권장합니다.수정 제안
private var borderOverlay: some View { - RoundedRectangle(cornerRadius: 8) + RoundedRectangle(cornerRadius: 6) .stroke(isHovered && !isSelected ? Color.dv(.gray300) : Color.clear, lineWidth: 1) }🤖 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/Sources/Components/DVProjectContainer.swift` around lines 80 - 83, The borderOverlay's RoundedRectangle uses cornerRadius: 8 which mismatches the background's clipShape cornerRadius: 6; update the RoundedRectangle(cornerRadius: 8) in the borderOverlay property to cornerRadius: 6 so both the background clipShape and the stroke overlay use the same radius (check the background clipShape usage and ensure both use 6).
🤖 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/SampleApp/Sources/DVVaultContainerPreviewView.swift`:
- Around line 21-27: The ForEach is using id: \.0 (name string) and selected is
compared to name, which breaks when duplicate names exist; change the iteration
to use a stable identifier (e.g., the collection index or an Identifiable model)
and make selected track that stable id instead of the name. Concretely, replace
ForEach(vaults, id: \.0) with a ForEach over indices (or an Identifiable Vault
model) and update the DVVaultContainer calls and the toggle logic so isSelected
compares selectedIndex (or the model id) with the current index/id and toggles
selectedIndex = (selectedIndex == index ? nil : index).
---
Nitpick comments:
In `@Projects/DVDesign/SampleApp/Sources/DVSecretTypePreviewView.swift`:
- Around line 10-39: The body of DVSecretTypePreviewView contains nested
ScrollView/VStack/previewSection blocks; extract each logical subsection into
private helper views or vars (e.g., private var iconlessSection, private var
iconSection, private func otherTypesSection() -> some View) and replace the
inline blocks in var body with those private members; keep the navigationTitle
and outer ScrollView wrapper in body and ensure the extracted helpers return the
same view types and use the existing previewSection and DVSecretType calls to
preserve behavior.
In `@Projects/DVDesign/SampleApp/Sources/DVTitleBarPreviewView.swift`:
- Around line 14-40: DVTitleBarPreviewView's body currently contains nested
layout for both "Interactive" and "Expired" previews; extract each section into
private computed subviews (e.g., private var interactiveSection: some View and
private var expiredSection: some View) in an extension so body only composes
those vars. Move the existing previewSection blocks that build DVTitleBar
(including the .frame and .background modifiers) into those private vars, keep
previewSection("Interactive") and previewSection("Expired") usage, and update
body to reference interactiveSection and expiredSection instead of inlining the
blocks.
In `@Projects/DVDesign/SampleApp/Sources/DVVaultContainerPreviewView.swift`:
- Around line 16-60: The body currently contains long nested preview sections;
extract each previewSection block (e.g., the "Interactive" VStack using vaults
and selected, and the static "Selected", "Unselected", "Expiring Soon",
"Expired" blocks that create DVVaultContainer) into private helpers—either
private var views or private func view builders—so body becomes a high-level
Stack that calls these helpers; create a private extension (or private section)
with functions like interactivePreview(), selectedPreview(),
unselectedPreview(), expiringSoonPreview(), expiredPreview() that return some
View and reference vaults, selected, and the DVVaultContainer initializers,
ensuring closures and state bindings (selected) are captured correctly.
In `@Projects/DVDesign/Sources/Components/DVButton.swift`:
- Around line 13-46: The computed properties on Style (cornerRadius, height,
horizontalPadding, width, font) are currently internal but should be limited to
file scope; update each property declaration in the Style type to use
fileprivate access control (e.g., fileprivate var cornerRadius, fileprivate var
height, etc.) so these implementation details remain private to the
DVButton.swift file.
In `@Projects/DVDesign/Sources/Components/DVCategory.swift`:
- Around line 81-84: borderOverlay의 RoundedRectangle에 설정된 cornerRadius(12)가 배경의
clipShape에서 사용한 cornerRadius(16)와 불일치합니다; DVCategory.swift의 private var
borderOverlay를 찾아 RoundedRectangle(cornerRadius: 12) 값을 디자인과 일치하도록 16으로 변경(나머지
속성인 .stroke(..., lineWidth: 1)은 유지)하여 두 요소의 모서리 반경을 통일하세요.
In `@Projects/DVDesign/Sources/Components/DVProjectContainer.swift`:
- Around line 80-83: The borderOverlay's RoundedRectangle uses cornerRadius: 8
which mismatches the background's clipShape cornerRadius: 6; update the
RoundedRectangle(cornerRadius: 8) in the borderOverlay property to cornerRadius:
6 so both the background clipShape and the stroke overlay use the same radius
(check the background clipShape usage and ensure both use 6).
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 785c4680-6f6d-4418-9aeb-92d37bed3314
📒 Files selected for processing (18)
Projects/DVDesign/SampleApp/Sources/ContentView.swiftProjects/DVDesign/SampleApp/Sources/DVButtonPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVCategoryPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVCheckBoxPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVPageControlPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVProjectContainerPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVSecretTypePreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVTitleBarPreviewView.swiftProjects/DVDesign/SampleApp/Sources/DVVaultContainerPreviewView.swiftProjects/DVDesign/SampleApp/Sources/PreviewHelpers.swiftProjects/DVDesign/Sources/Components/DVButton.swiftProjects/DVDesign/Sources/Components/DVCategory.swiftProjects/DVDesign/Sources/Components/DVCheckBox.swiftProjects/DVDesign/Sources/Components/DVPageControl.swiftProjects/DVDesign/Sources/Components/DVProjectContainer.swiftProjects/DVDesign/Sources/Components/DVSecretType.swiftProjects/DVDesign/Sources/Components/DVTitleBar.swiftProjects/DVDesign/Sources/Components/DVVaultContainer.swift
|
@yeseonglee pr 올리기전에 develop rebase하고 나서 pr 올려주세요~! |
…ltProject/Devault-macOS into design/#12/ui-component-구현
✨ What's this PR?
📌 관련 이슈 (Related Issue)
🧶 주요 변경 내용 (Summary)
신규 컴포넌트 8개 추가 (
DVDesign/Sources/Components/)DVCategoryDVProjectContainerDVVaultContainerDVButtonDVCheckBoxDVTitleBarDVSecretTypeDVPageControlSampleApp 프리뷰 연동
ContentView라우팅 업데이트구현 상세
// MARK: -섹션 구분,body단일 컨테이너, 하위뷰는extension private var/func분리.contentShape(Rectangle())label 내부 적용 → 빈 영역 클릭 이슈 해결DVVaultContainer.TrailingIconenum으로 만료 상태 타입 안전하게 관리 (.expiringSoon/.expired)DVButton.Styleenum에cornerRadius/height/width/horizontalPadding/font토큰화DVTitleBar검색 필드.regularMaterial배경 적용 (Liquid Glass 대비)📸 스크린샷 (Optional)
🧪 테스트 / 검증 내역
💬 기타 공유 사항
.accessibilityLabel,.accessibilityAddTraits) 미적용 — 후속 PR 예정DVPageControl은 온보딩 전용으로 현재DVDesign에 위치, 추후DVPresentation이동 검토 필요🙇🏻♀️ 리뷰 가이드
DVButton.Styleenum의 토큰 구조 (cornerRadius / height / width / font 일괄 관리 방식)DVVaultContainer.TrailingIconenum 설계.contentShape위치를 Button label 내부에 적용한 이유Summary by CodeRabbit
릴리스 노트