Conversation
📝 WalkthroughWalkthrough다운타임 바텀시트용 새로운 SwiftUI 뷰(DowntimeBottomSheetView)와 관련 자산(아이콘 파일명 추가, dimColor 색상 세트, speechBubble 이미지 세트)을 추가하고, 피커 컴포넌트 이름 변경 및 사소한 문법 정리를 포함합니다. Changes
Sequence Diagram(s)(해당 변경은 주로 UI/자산 추가 및 경미한 리네이밍으로, 다중 컴포넌트 간의 명확한 시퀀스 흐름을 시각화할 필요가 없어 다이어그램을 생략합니다.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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)
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
🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`:
- Around line 11-12: The rate state is fixed at 0.5 and not updated when the
user changes selectedDowntime in DowntimeBottomSheetView; update rate by
deriving it from selectedDowntime (e.g., make rate a computed value like
Double(selectedDowntime)/12.0) or add an onChange(of: selectedDowntime) handler
that sets rate = Double(newValue)/12.0 so the progress/progress bar that reads
rate updates correctly (adjust any references to rate in the view accordingly).
- Around line 11-12: 현재 DowntimeBottomSheetView의 `@State` 프로퍼티 selectedDowntime와
rate가 public으로 선언되어 있으니 SwiftUI 모범 사례에 따라 두 속성에 private 접근 제어자를 추가해 뷰 외부에서 직접
접근/수정되지 않도록 하세요; 만약 외부에서 초기값이나 바인딩이 필요하면 selectedDowntime과 rate 대신 init에 Binding
파라미터를 받아 처리하거나 별도의 `@Binding/외부` 프로퍼티를 추가해 값을 노출하도록 변경하세요.
- Line 73: The code contains an extra space between the identifier and its
parentheses for the SwiftUI view Spacer in DowntimeBottomSheetView (currently
written as "Spacer ()"); update the invocation to remove the space and use
"Spacer()" wherever "Spacer ()" appears (e.g., in the body of
DowntimeBottomSheetView) to follow Swift style and avoid inconsistent
formatting.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (6)
Cherrish-iOS/Cherrish-iOS/Assets.xcassets/AppIcon.appiconset/app icon 1.pngis excluded by!**/*.pngCherrish-iOS/Cherrish-iOS/Assets.xcassets/AppIcon.appiconset/app icon 2.pngis excluded by!**/*.pngCherrish-iOS/Cherrish-iOS/Assets.xcassets/AppIcon.appiconset/app icon.pngis excluded by!**/*.pngCherrish-iOS/Cherrish-iOS/Assets.xcassets/speechBubble.imageset/Group 2085667406.pngis excluded by!**/*.pngCherrish-iOS/Cherrish-iOS/Assets.xcassets/speechBubble.imageset/Group 2085667406@2x.pngis excluded by!**/*.pngCherrish-iOS/Cherrish-iOS/Assets.xcassets/speechBubble.imageset/Group 2085667406@3x.pngis excluded by!**/*.png
📒 Files selected for processing (6)
Cherrish-iOS/Cherrish-iOS/Assets.xcassets/AppIcon.appiconset/Contents.jsonCherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/dimColor.colorset/Contents.jsonCherrish-iOS/Cherrish-iOS/Assets.xcassets/speechBubble.imageset/Contents.jsonCherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swiftCherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swiftCherrish-iOS/Cherrish-iOS/Presentation/Global/Components/Treatment/TreatmentRowView.swift
🔇 Additional comments (5)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swift (1)
11-28: 레거시 이름CustomWheelPicker사용 기록 없음 - 호환성 우려 불필요
CustomWheelPicker는 현재 코드베이스에 존재하지 않습니다. 전체 코드베이스를 검색한 결과CustomWheelPicker에 대한 참조가 없으며,CherrishPicker는 내부(internal) 스코프의 구조체이므로 공개 API 호환성 문제가 없습니다. 이미 모든 코드가 새 이름으로 통일되어 있고(DowntimeBottomSheetView에서 사용), 제안된typealias는 불필요합니다.Likely an incorrect or invalid review comment.
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift (4)
99-105: 하드코딩된 날짜 값에 대한 검토가 필요합니다.현재 "1월 2일", "1월 14일" 등 날짜가 하드코딩되어 있습니다. UI 목업 단계라면 괜찮지만, 실제 기능 구현 시에는 동적으로 계산된 날짜를 사용해야 합니다.
델리게이트 기반 구현이라고 명시되어 있는데, 날짜 데이터는 외부에서 주입받을 계획인지 확인이 필요합니다.
48-64:scaledToFill()과frame의 조합을 검토하세요.
scaledToFill()은 이미지가 프레임을 넘어갈 수 있습니다. 다양한 화면 크기에서 이미지가 잘리거나 레이아웃이 깨지지 않는지 확인이 필요합니다.scaledToFit()이 더 안전할 수 있습니다.
117-134: LGTM!피커 뷰의 레이아웃과 바인딩 구현이 적절합니다.
CherrishPicker와selectedDowntime의 연결이 올바르게 설정되어 있습니다.
14-44: 구조가 잘 정리되어 있습니다.확장(extension)을 활용한 서브뷰 분리와
adjustedH/adjustedW를 사용한 반응형 사이징이 일관되게 적용되어 있습니다.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| @State var selectedDowntime: Int = 5 | ||
| @State var rate: Double = 0.5 |
There was a problem hiding this comment.
rate 값이 selectedDowntime 변경에 따라 갱신되지 않습니다.
현재 rate는 0.5로 고정되어 있어, 사용자가 피커에서 다운타임 값을 변경해도 프로그레스 바가 업데이트되지 않습니다. rate를 selectedDowntime 기반으로 계산하거나 onChange를 사용하여 동기화해야 합니다.
🐛 제안된 수정 (computed property 사용)
- `@State` var rate: Double = 0.5
+ private var rate: Double {
+ // 예: 총 기간이 12일이고 다운타임이 selectedDowntime일 경우
+ Double(selectedDowntime) / 12.0
+ }또는 onChange를 사용하여 동기화:
.onChange(of: selectedDowntime) { newValue in
rate = Double(newValue) / 12.0
}Also applies to: 86-92
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`
around lines 11 - 12, The rate state is fixed at 0.5 and not updated when the
user changes selectedDowntime in DowntimeBottomSheetView; update rate by
deriving it from selectedDowntime (e.g., make rate a computed value like
Double(selectedDowntime)/12.0) or add an onChange(of: selectedDowntime) handler
that sets rate = Double(newValue)/12.0 so the progress/progress bar that reads
rate updates correctly (adjust any references to rate in the view accordingly).
🧹 Nitpick | 🔵 Trivial
@State 프로퍼티에 private 접근 제어자를 추가하세요.
SwiftUI 모범 사례에 따르면, @State 프로퍼티는 뷰 내부에서만 관리되어야 하므로 private으로 선언하는 것이 권장됩니다. 외부에서 직접 초기화하려면 init을 통해 바인딩하거나 별도의 프로퍼티를 사용하세요.
♻️ 제안된 수정
- `@State` var selectedDowntime: Int = 5
- `@State` var rate: Double = 0.5
+ `@State` private var selectedDowntime: Int = 5
+ `@State` private var rate: Double = 0.5📝 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.
| @State var selectedDowntime: Int = 5 | |
| @State var rate: Double = 0.5 | |
| `@State` private var selectedDowntime: Int = 5 | |
| `@State` private var rate: Double = 0.5 |
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`
around lines 11 - 12, 현재 DowntimeBottomSheetView의 `@State` 프로퍼티 selectedDowntime와
rate가 public으로 선언되어 있으니 SwiftUI 모범 사례에 따라 두 속성에 private 접근 제어자를 추가해 뷰 외부에서 직접
접근/수정되지 않도록 하세요; 만약 외부에서 초기값이나 바인딩이 필요하면 selectedDowntime과 rate 대신 init에 Binding
파라미터를 받아 처리하거나 별도의 `@Binding/외부` 프로퍼티를 추가해 값을 노출하도록 변경하세요.
|
|
||
| TypographyText("다운타임 \(selectedDowntime)일", style: .title2_m_16, color: .red600) | ||
|
|
||
| Spacer () |
There was a problem hiding this comment.
타이포 수정: Spacer () → Spacer()
괄호 앞에 불필요한 공백이 있습니다.
🔧 제안된 수정
- Spacer ()
+ Spacer()📝 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.
| Spacer () | |
| Spacer() |
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`
at line 73, The code contains an extra space between the identifier and its
parentheses for the SwiftUI view Spacer in DowntimeBottomSheetView (currently
written as "Spacer ()"); update the invocation to remove the space and use
"Spacer()" wherever "Spacer ()" appears (e.g., in the body of
DowntimeBottomSheetView) to follow Swift style and avoid inconsistent
formatting.
sum130
left a comment
There was a problem hiding this comment.
프리뷰랑 기기대응(adjusted들) 수정해주세용! 굿!!
| TypographyText("개인 다운타임으로 설정해주세요.", style: .title1_sb_18, color: .gray1000) | ||
| .frame(height: 27.adjustedH) | ||
| .frame(maxWidth: .infinity, alignment: .leading) | ||
| .padding(.leading, 25) |
| .padding(.horizontal, 25) | ||
|
|
||
| pickerView | ||
|
|
||
| grayLineView | ||
| .padding(.horizontal, 25) |
| .padding(.horizontal, 18) | ||
| .offset(y: -4.adjustedH) | ||
|
|
||
| } | ||
| .padding(.horizontal, 25) |
| #Preview { | ||
| DowntimeBottomSheetView() | ||
| } |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`:
- Around line 71-76: DowntimeBottomSheetView currently hardcodes "여유기간 7일" and
the start/end date display; add properties let startDate: Date, let endDate:
Date, and let bufferDays: Int to the struct and replace hardcoded strings in the
TypographyText views with computed values: use a static DateFormatter
(dateFormatter) with locale "ko_KR" and format "M월 d일" and a helper func
dateText(_:) that returns Self.dateFormatter.string(from:); then display
bufferDays (e.g. "\(bufferDays)일") and dateText(startDate) / dateText(endDate)
in place of the hardcoded "7일", "1월 2일", "1월 14일" so the UI reflects injected
data.
♻️ Duplicate comments (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift (3)
11-12: 프로그레스 바가 선택값 변경에 동기화되지 않습니다.
Line 11-12의rate가 고정값이라selectedDowntime변경 시 Line 86-92의 바가 갱신되지 않습니다.rate를 계산 속성으로 만들고 0...1로 클램프하세요.🐛 제안된 수정
- `@State` var rate: Double = 0.5 + private var rate: Double { + let total = max(1, selectedDowntime + 7) + return min(Double(selectedDowntime) / Double(total), 1) + }
11-12:@State는private로 제한하세요.
Line 11-12의 상태는 뷰 내부에서만 관리되도록 제한하는 편이 안전합니다.♻️ 제안된 수정
- `@State` var selectedDowntime: Int = 5 + `@State` private var selectedDowntime: Int = 5
22-22: 수평 패딩에는adjustedW를 사용하세요.
Line 22에서 수평 여백에adjustedH를 사용하면 기기 비율에 따라 레이아웃이 틀어질 수 있습니다.🔧 제안된 수정
- .padding(.leading, 25.adjustedH) + .padding(.leading, 25.adjustedW)
| TypographyText("다운타임 \(selectedDowntime)일", style: .title2_m_16, color: .red600) | ||
|
|
||
| Spacer () | ||
|
|
||
| TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800) | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "DowntimeBottomSheetView.swift" | head -20Repository: TEAM-Cherrish/Cherrish-iOS
Length of output: 157
🏁 Script executed:
cd Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar && wc -l DowntimeBottomSheetView.swiftRepository: TEAM-Cherrish/Cherrish-iOS
Length of output: 103
🏁 Script executed:
cd Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar && sed -n '1,150p' DowntimeBottomSheetView.swift | cat -nRepository: TEAM-Cherrish/Cherrish-iOS
Length of output: 5031
여유기간 문자열과 날짜가 하드코딩되어 실제 데이터와 불일치할 수 있습니다.
Line 75의 "여유기간 7일"과 Line 99-105의 "1월 2일", "1월 14일"은 하드코딩된 상태입니다. 버퍼 일수와 시작/종료 날짜를 프로퍼티로 주입받아 표시하세요.
제안된 수정
- TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800)
+ TypographyText("여유기간 \(bufferDays)일", style: .title2_m_16, color: .gray800)
...
- TypographyText("1월 2일", style: .body2_r_13, color: .gray700)
+ TypographyText(dateText(startDate), style: .body2_r_13, color: .gray700)
...
- TypographyText("1월 14일", style: .body2_r_13, color: .gray700)
+ TypographyText(dateText(endDate), style: .body2_r_13, color: .gray700)구조체에 아래와 같이 추가하세요:
let startDate: Date
let endDate: Date
let bufferDays: Int
private static let dateFormatter: DateFormatter = {
let f = DateFormatter()
f.locale = Locale(identifier: "ko_KR")
f.dateFormat = "M월 d일"
return f
}()
private func dateText(_ date: Date) -> String {
Self.dateFormatter.string(from: date)
}🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/DowntimeBottomSheetView.swift`
around lines 71 - 76, DowntimeBottomSheetView currently hardcodes "여유기간 7일" and
the start/end date display; add properties let startDate: Date, let endDate:
Date, and let bufferDays: Int to the struct and replace hardcoded strings in the
TypographyText views with computed values: use a static DateFormatter
(dateFormatter) with locale "ko_KR" and format "M월 d일" and a helper func
dateText(_:) that returns Self.dateFormatter.string(from:); then display
bufferDays (e.g. "\(bufferDays)일") and dateText(startDate) / dateText(endDate)
in place of the hardcoded "7일", "1월 2일", "1월 14일" so the UI reflects injected
data.

🔗 연결된 이슈
📄 작업 내용