Conversation
📝 WalkthroughWalkthrough새로운 SwiftUI 컴포넌트 Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
🚥 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)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift (3)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting 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: 4
🤖 Fix all issues with AI agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift:
- Line 62: Add a SwiftUI preview provider for the MonthPlan view to aid
development and design verification: create a #Preview block (or PreviewProvider
for older Swift versions) that instantiates MonthPlan with multiple sample
states (e.g., short and long interaction strings, different dDay values and
tags) inside a VStack with padding so designers can see layout variations;
reference the MonthPlan initializer to seed realistic props and place this
preview at the bottom of the MonthPlan.swift file.
- Around line 31-61: Add an accessibility label to the MonthPlan view by making
the outer HStack a single accessibility element and providing a descriptive
label that combines the existing pieces (interaction, dDay, tag); update the
body view’s HStack (where TypographyText(interaction), the "회복 \(dDay)일차" text,
and TypographyText(tag) live) to include .accessibilityElement(children:
.combine) and .accessibilityLabel(...) that composes a clear, localized string
from interaction, dDay and tag so screen readers announce the whole item
succinctly.
- Around line 42-49: The tag view uses a fixed .frame(width: 32, height: 18)
which can truncate longer tag text; update the layout in MonthPlan's tag
rendering (the TypographyText(tag...) block) to remove the fixed width and allow
flexible sizing—either use a minimum width (.frame(minWidth: 32, height: 18)) or
omit width entirely and rely on padding (Self.tagPaddingHorizontal /
Self.tagPaddingVertical) so the label grows with content, keeping the existing
background (RoundedRectangle with Self.tagCornerRadius, Self.tagBorderColor,
Self.tagBorderWidth) and ensure you preserve TypographyText, tag, and the Self.*
sizing constants when making the change.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
🧰 Additional context used
🧬 Code graph analysis (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift (1)
textColor(89-98)Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (4)
gray900(45-47)gray700(37-39)gray400(25-27)gray0(9-11)Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
body(9-17)
🔇 Additional comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift (1)
15-29: 스타일링 상수 정리가 잘 되어 있습니다.색상, 간격, 패딩 등의 값을
private static상수로 분리하여 관리한 점이 좋습니다. 유지보수성과 가독성이 향상됩니다.
| var body: some View { | ||
| HStack(spacing: 0) { | ||
|
|
||
| TypographyText(interaction, style: .body1_m_14, color: Self.textColor) | ||
|
|
||
| TypographyText(" • ", style: .body1_m_14, color: Self.textColor) | ||
|
|
||
| TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor) | ||
|
|
||
| Spacer().frame(width: Self.tagSpacing) | ||
|
|
||
| TypographyText(tag, style: .body3_r_12, color: Self.tagTextColor) | ||
| .frame(width: 32, height: 18) | ||
| .padding(.horizontal, Self.tagPaddingHorizontal) | ||
| .padding(.vertical, Self.tagPaddingVertical) | ||
| .background( | ||
| RoundedRectangle(cornerRadius: Self.tagCornerRadius) | ||
| .strokeBorder(Self.tagBorderColor, lineWidth: Self.tagBorderWidth) | ||
| ) | ||
|
|
||
| Spacer() | ||
| } | ||
| .padding(.vertical, Self.containerPaddingVertical) | ||
| .padding(.leading, Self.containerPaddingLeading) | ||
| .background(Self.containerBackgroundColor) | ||
| .clipShape(RoundedRectangle(cornerRadius: Self.cornerRadius)) | ||
| .overlay( | ||
| RoundedRectangle(cornerRadius: Self.cornerRadius) | ||
| .strokeBorder(Self.containerBorderColor, lineWidth: Self.containerBorderWidth) | ||
| ) | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
컨테이너 구조가 잘 구현되어 있습니다.
HStack 레이아웃과 컨테이너 스타일링이 적절합니다. 다만 접근성 향상을 위해 accessibilityLabel을 추가하는 것을 고려해 주세요.
♿ 접근성 레이블 추가 제안
.overlay(
RoundedRectangle(cornerRadius: Self.cornerRadius)
.strokeBorder(Self.containerBorderColor, lineWidth: Self.containerBorderWidth)
)
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel("\(interaction), 회복 \(dDay)일차, \(tag)")
}🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
around lines 31 - 61, Add an accessibility label to the MonthPlan view by making
the outer HStack a single accessibility element and providing a descriptive
label that combines the existing pieces (interaction, dDay, tag); update the
body view’s HStack (where TypographyText(interaction), the "회복 \(dDay)일차" text,
and TypographyText(tag) live) to include .accessibilityElement(children:
.combine) and .accessibilityLabel(...) that composes a clear, localized string
from interaction, dDay and tag so screen readers announce the whole item
succinctly.
| .strokeBorder(Self.containerBorderColor, lineWidth: Self.containerBorderWidth) | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
SwiftUI Preview 추가를 권장합니다.
개발 및 디자인 검증 편의를 위해 Preview를 추가하면 좋습니다.
👀 Preview 추가 예시
#Preview {
VStack(spacing: 16) {
MonthPlan(interaction: "시술명", dDay: 7, tag: "완료")
MonthPlan(interaction: "긴 시술명 테스트", dDay: 14, tag: "진행중")
}
.padding()
}🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift at
line 62, Add a SwiftUI preview provider for the MonthPlan view to aid
development and design verification: create a #Preview block (or PreviewProvider
for older Swift versions) that instantiates MonthPlan with multiple sample
states (e.g., short and long interaction strings, different dDay values and
tags) inside a VStack with padding so designers can see layout variations;
reference the MonthPlan initializer to seed realistic props and place this
preview at the bottom of the MonthPlan.swift file.
wotjs020708
left a comment
There was a problem hiding this comment.
크게 문제될거는 없은 거 같아욤 고생하셨습니담
|
|
||
| TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor) | ||
|
|
||
| Spacer().frame(width: Self.tagSpacing) |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift:
- Around line 62-63: Add a SwiftUI preview for the MonthPlan view by
implementing either a #Preview block or a PreviewProvider that instantiates
MonthPlan with representative props (e.g., different interaction, dDay and tag
values) to cover typical layouts and long text; ensure the preview uses padding
and a VStack (or similar) to show multiple variants side-by-side and place it
after the MonthPlan struct declaration so the preview compiles and renders in
Xcode.
- Around line 52-55: The view applies .padding(.leading,
Self.containerPaddingLeading) but omits trailing padding, causing no space
between tags and the container's right edge; update the MonthPlan view to add
symmetric right-side padding by adding .padding(.trailing,
Self.containerPaddingLeading) (or define and use a new
Self.containerPaddingTrailing constant if design requires a different value)
alongside the existing .padding(.vertical and .padding(.leading) calls so the
layout has the intended right margin.
- Around line 43-50: The tag view currently forces a fixed width via
.frame(width: 32, height: 22) which can truncate longer tag text; update the tag
layout (the TypographyText usage) to remove the fixed width, keep the height
constraint if needed, and let the label size to its content by applying
.fixedSize() (or .fixedSize(horizontal: true, vertical: false)) plus existing
padding and the RoundedRectangle background (see TypographyText and the
surrounding modifiers using Self.tagPaddingHorizontal, Self.tagPaddingVertical,
Self.tagCornerRadius, Self.tagBorderColor, Self.tagBorderWidth) so the tag
expands with longer text instead of clipping.
- Line 38: Replace the hardcoded Korean label in the TypographyText initializer
so it uses a localized format string: do not concatenate "회복 \(dDay)일차"
directly; instead fetch a localized format (e.g., key "recovery_day_format") via
String(localized:) or NSLocalizedString and pass dDay into the formatted string
used by TypographyText; update usages of TypographyText("회복 \(dDay)일차", ...) to
TypographyText(formattedLocalizedString, style: .body1_r_14, color:
Self.textColor) and add the corresponding "recovery_day_format" entry to
Localizable.strings (e.g., "recovery_day_format" = "회복 %d일차";).
- Around line 40-41: Replace the fixed-width Spacer() usage with trailing
padding on the preceding view: remove Spacer().frame(width: Self.tagSpacing) and
instead add .padding(.trailing, Self.tagSpacing) to the view immediately before
it (the tag/text view that currently relies on the spacer); keep the
Self.tagSpacing constant and remove the Spacer symbol entirely so the layout
uses padding rather than a fixed Spacer.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
🔇 Additional comments (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift (2)
10-14: 컴포넌트 구조 잘 구성되었습니다.속성들이 명확하게 정의되어 있고,
let을 사용하여 불변성을 보장하고 있습니다.
15-29: 스타일 상수 구성 좋습니다.
private static으로 스타일 상수를 분리하여 관리하는 방식이 유지보수성을 높여줍니다.
|
|
||
| TypographyText(" • ", style: .body1_m_14, color: Self.textColor) | ||
|
|
||
| TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor) |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
하드코딩된 한국어 문자열을 로컬라이제이션 처리하세요.
"회복 (dDay)일차" 문자열이 하드코딩되어 있어 다국어 지원 시 문제가 될 수 있습니다. String(localized:) 또는 NSLocalizedString을 사용하여 로컬라이제이션을 적용하는 것을 권장합니다.
♻️ 제안하는 수정
- TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor)
+ TypographyText(String(localized: "회복 \(dDay)일차"), style: .body1_r_14, color: Self.textColor)또는 Localizable.strings 파일에 키를 정의하여 사용:
TypographyText(String(format: NSLocalizedString("recovery_day_format", comment: ""), dDay), style: .body1_r_14, color: Self.textColor)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor) | |
| TypographyText(String(format: NSLocalizedString("recovery_day_format", comment: ""), dDay), style: .body1_r_14, color: Self.textColor) |
🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift at
line 38, Replace the hardcoded Korean label in the TypographyText initializer so
it uses a localized format string: do not concatenate "회복 \(dDay)일차" directly;
instead fetch a localized format (e.g., key "recovery_day_format") via
String(localized:) or NSLocalizedString and pass dDay into the formatted string
used by TypographyText; update usages of TypographyText("회복 \(dDay)일차", ...) to
TypographyText(formattedLocalizedString, style: .body1_r_14, color:
Self.textColor) and add the corresponding "recovery_day_format" entry to
Localizable.strings (e.g., "recovery_day_format" = "회복 %d일차";).
| Spacer() | ||
| .frame(width: Self.tagSpacing) |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Spacer 대신 padding 사용을 권장합니다.
고정 너비의 Spacer보다 .padding(.trailing, Self.tagSpacing)을 이전 요소에 적용하는 것이 더 관용적입니다.
♻️ 제안하는 수정
- TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor)
-
- Spacer()
- .frame(width: Self.tagSpacing)
+ TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor)
+ .padding(.trailing, Self.tagSpacing)🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
around lines 40 - 41, Replace the fixed-width Spacer() usage with trailing
padding on the preceding view: remove Spacer().frame(width: Self.tagSpacing) and
instead add .padding(.trailing, Self.tagSpacing) to the view immediately before
it (the tag/text view that currently relies on the spacer); keep the
Self.tagSpacing constant and remove the Spacer symbol entirely so the layout
uses padding rather than a fixed Spacer.
| TypographyText(tag, style: .body3_r_12, color: Self.tagTextColor) | ||
| .frame(width: 32, height: 22) | ||
| .padding(.horizontal, Self.tagPaddingHorizontal) | ||
| .padding(.vertical, Self.tagPaddingVertical) | ||
| .background( | ||
| RoundedRectangle(cornerRadius: Self.tagCornerRadius) | ||
| .strokeBorder(Self.tagBorderColor, lineWidth: Self.tagBorderWidth) | ||
| ) |
There was a problem hiding this comment.
태그 프레임 고정 크기가 텍스트 잘림을 유발할 수 있습니다.
width: 32로 고정된 프레임은 긴 태그 텍스트가 잘릴 수 있습니다. 태그 내용에 따라 동적으로 크기가 조정되도록 .fixedSize() 사용을 고려하세요.
🔧 제안하는 수정
TypographyText(tag, style: .body3_r_12, color: Self.tagTextColor)
- .frame(width: 32, height: 22)
.padding(.horizontal, Self.tagPaddingHorizontal)
.padding(.vertical, Self.tagPaddingVertical)
+ .fixedSize()
.background(
RoundedRectangle(cornerRadius: Self.tagCornerRadius)
.strokeBorder(Self.tagBorderColor, lineWidth: Self.tagBorderWidth)
)🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
around lines 43 - 50, The tag view currently forces a fixed width via
.frame(width: 32, height: 22) which can truncate longer tag text; update the tag
layout (the TypographyText usage) to remove the fixed width, keep the height
constraint if needed, and let the label size to its content by applying
.fixedSize() (or .fixedSize(horizontal: true, vertical: false)) plus existing
padding and the RoundedRectangle background (see TypographyText and the
surrounding modifiers using Self.tagPaddingHorizontal, Self.tagPaddingVertical,
Self.tagCornerRadius, Self.tagBorderColor, Self.tagBorderWidth) so the tag
expands with longer text instead of clipping.
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
Outdated
Show resolved
Hide resolved
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
Show resolved
Hide resolved
sum130
left a comment
There was a problem hiding this comment.
변수뺴두는 것들 한 번 생각해보세용 나머지는 굿입니당
| private static let textColor: Color = .gray900 | ||
| private static let tagTextColor: Color = .gray700 | ||
| private static let tagBorderColor: Color = .gray400 | ||
| private static let containerBorderColor: Color = .gray400 | ||
| private static let containerBackgroundColor: Color = .gray0 | ||
|
|
||
| private static let tagSpacing: CGFloat = 6 | ||
| private static let tagPaddingHorizontal: CGFloat = 8 | ||
| private static let tagPaddingVertical: CGFloat = 2 | ||
| private static let tagBorderWidth: CGFloat = 1 | ||
| private static let tagCornerRadius: CGFloat = 20 | ||
| private static let containerPaddingVertical: CGFloat = 12 | ||
| private static let containerPaddingLeading: CGFloat = 14 | ||
| private static let cornerRadius: CGFloat = 10 | ||
| private static let containerBorderWidth: CGFloat = 1 |
There was a problem hiding this comment.
고정값들은 변수로 뺴둘 필요가 있을까요?? padding값은 뺴도 될 것 같은데 한 번 고려해주세요!
y-eonee
left a comment
There was a problem hiding this comment.
굿 수고하셨습니당 상수로 뺀것만 다시 리팩토링해주시면 될 것 같아요
| private static let textColor: Color = .gray900 | ||
| private static let tagTextColor: Color = .gray700 | ||
| private static let tagBorderColor: Color = .gray400 | ||
| private static let containerBorderColor: Color = .gray400 | ||
| private static let containerBackgroundColor: Color = .gray0 | ||
|
|
||
| private static let tagSpacing: CGFloat = 6 | ||
| private static let tagPaddingHorizontal: CGFloat = 8 | ||
| private static let tagPaddingVertical: CGFloat = 2 | ||
| private static let tagBorderWidth: CGFloat = 1 | ||
| private static let tagCornerRadius: CGFloat = 20 | ||
| private static let containerPaddingVertical: CGFloat = 12 | ||
| private static let containerPaddingLeading: CGFloat = 14 | ||
| private static let cornerRadius: CGFloat = 10 | ||
| private static let containerBorderWidth: CGFloat = 1 |
| TypographyText(interaction, style: .body1_m_14, color: Self.textColor) | ||
|
|
||
| TypographyText(" • ", style: .body1_m_14, color: Self.textColor) | ||
|
|
||
| TypographyText("회복 \(dDay)일차", style: .body1_r_14, color: Self.textColor) |
| .frame(width: Self.tagSpacing) | ||
|
|
||
| TypographyText(tag, style: .body3_r_12, color: Self.tagTextColor) | ||
| .frame(width: 32, height: 22) |
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MonthPlan.swift
Outdated
Show resolved
Hide resolved
feat/#50 Month Plan 컴포넌트 추가
🔗 연결된 이슈
📄 작업 내용
사용법