Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "app icon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand All @@ -12,6 +13,7 @@
"value" : "dark"
}
],
"filename" : "app icon 1.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand All @@ -23,6 +25,7 @@
"value" : "tinted"
}
],
"filename" : "app icon 2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.100",
"blue" : "0x52",
"green" : "0x4C",
"red" : "0x46"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.100",
"blue" : "0x52",
"green" : "0x4C",
"red" : "0x46"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 2085667406.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2085667406@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2085667406@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
//
// DowntimeBottomSheetView.swift
// Cherrish-iOS
//
// Created by 이나연 on 1/16/26.
//

import SwiftUI

struct DowntimeBottomSheetView: View {
@State var selectedDowntime: Int = 5
@State var rate: Double = 0.5
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

rate 값이 selectedDowntime 변경에 따라 갱신되지 않습니다.

현재 rate는 0.5로 고정되어 있어, 사용자가 피커에서 다운타임 값을 변경해도 프로그레스 바가 업데이트되지 않습니다. rateselectedDowntime 기반으로 계산하거나 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.

Suggested change
@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/외부` 프로퍼티를 추가해 값을 노출하도록 변경하세요.


var body: some View {
VStack(spacing: 0) {
Spacer()
.frame(height: 25.adjustedH)

TypographyText("개인 다운타임으로 설정해주세요.", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.leading, 25.adjustedH)

Spacer()
.frame(height: 44.adjustedH)

speechBubble

downtimeProgressBar
.padding(.top, 8.adjustedH)

Spacer()
.frame(height: 25.adjustedH)

grayLineView
.padding(.horizontal, 25.adjustedW)

pickerView

grayLineView
.padding(.horizontal, 25.adjustedW)

}
}
}

extension DowntimeBottomSheetView {
private var speechBubble: some View {
ZStack {
Image(.speechBubble)
.resizable()
.scaledToFill()
.frame(height: 53.adjustedH)

TypographyText("회복 목표디데이로부터 약 7일 전에 안정될 수 있어요.", style: .body1_r_14, color: .gray1000)
.lineLimit(1)
.minimumScaleFactor(0.8)
.padding(.horizontal, 18.adjustedW)
.offset(y: -4.adjustedH)

}
.padding(.horizontal, 25.adjustedW)
.frame(height: 53.adjustedH)
}

private var downtimeProgressBar: some View {
VStack {
HStack {
Spacer()

TypographyText("다운타임 \(selectedDowntime)일", style: .title2_m_16, color: .red600)

Spacer ()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

타이포 수정: 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.

Suggested change
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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 해줭


TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800)

Comment on lines +71 to +76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "DowntimeBottomSheetView.swift" | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 157


🏁 Script executed:

cd Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar && wc -l DowntimeBottomSheetView.swift

Repository: 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 -n

Repository: 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.

Spacer()
}

GeometryReader { geometry in
ZStack(alignment: .leading) {
RoundedRectangle(cornerRadius: 24)
.fill(.gray400)
.frame(height: 8.adjustedH)

RoundedRectangle(cornerRadius: 24)
.fill(.red600)
.frame(
width: geometry.size.width * rate,
height: 8.adjustedH
)
.animation(.easeOut(duration: 0.5), value: rate)
}
}
.frame(height: 8.adjustedH)
.padding(.horizontal, 25.adjustedW)

HStack {
TypographyText("1월 2일", style: .body2_r_13, color: .gray700)
.frame(height: 18.adjustedH)

Spacer()

TypographyText("1월 14일", style: .body2_r_13, color: .gray700)
.frame(height: 18.adjustedH)
}
.padding(.horizontal, 25.adjustedW)
}
}

private var grayLineView: some View {
Rectangle()
.frame(height: 1.adjustedH)
.foregroundColor(.gray400)
}

private var pickerView: some View {
HStack {
Spacer()

VStack(spacing: 0) {
TypographyText("다운타임", style: .headline_sb_20, color: .gray1000)
.frame(height: 30.adjustedH)

TypographyText("보통 3-5일", style: .title2_m_16, color: .gray600)
}

Spacer()

CherrishPicker(selection: $selectedDowntime, range: 1...30)

Spacer()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SwiftUI
import UIKit

struct CustomWheelPicker: View {
struct CherrishPicker: View {
@Binding var selection: Int
let range: ClosedRange<Int>
var width: CGFloat = 74.adjustedW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private struct TreatmentCheckBoxView: View {
isSelected: Binding<Bool>,
isCompleted: Binding<Bool>,
isCompletedView: Bool = false,
action: @escaping () -> Void,
action: @escaping () -> Void
) {
self.treatmentEntity = treatmentEntity
self._isSelected = isSelected
Expand Down