Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthrough다운타임 설정 화면을 렌더링하는 새로운 SwiftUI 뷰 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
y-eonee
left a comment
There was a problem hiding this comment.
서버 연결하고 바로 리팩토링합시다 ........
| ForEach(treatments, id: \.self) { treatment in | ||
| TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) |
| #Preview { | ||
| DownTimeSettingView(treatments: TreatmentEntity.mockData) | ||
| } |
| // MARK: - Navigation | ||
| extension NoTreatment { | ||
| mutating func next() { | ||
| let allCases = Self.allCases | ||
| guard let currentIndex = allCases.firstIndex(of: self), | ||
| currentIndex + 1 < allCases.count else { return } | ||
| self = allCases[allCases.index(after: currentIndex)] | ||
| } | ||
|
|
||
| mutating func previous() { | ||
| let allCases = Self.allCases | ||
| guard let currentIndex = allCases.firstIndex(of: self), | ||
| currentIndex > 0 else { return } | ||
| self = allCases[allCases.index(before: currentIndex)] | ||
| } | ||
| } |
There was a problem hiding this comment.
프로토콜로 리팩토링해보시면 좋을 것 같아요 ~ ~~
| .frame(height: 1.adjustedH) | ||
| .gray500() | ||
| } | ||
| .frame(height: 105) |
| init(viewModel: NoTreatmentViewModel = NoTreatmentViewModel()) { | ||
| _viewModel = StateObject(wrappedValue: viewModel) | ||
| } |
| } | ||
| } | ||
|
|
||
| //MARK: - TreatmentSelectedCategoryView |
sum130
left a comment
There was a problem hiding this 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/Treatment/NoTreatment/Model/DownTimeSettingView.swift`:
- Around line 36-52: Replace the three separate TypographyText views inside the
VStack with a single TypographyText that uses a multiline string (with explicit
\n line breaks) so the same text, style (.body3_r_12) and color (.gray600) are
preserved; ensure the \n placements match the current visual line breaks/design
and keep the VStack alignment/spacing unchanged (refer to the VStack and
TypographyText usages in DownTimeSettingView.swift to locate the code to
update).
- Around line 1-11: DownTimeSettingView is a SwiftUI view declared as struct
DownTimeSettingView and currently lives in the Model folder; move the
DownTimeSettingView.swift file into the project's View (or
Presentation/Feature/Calendar/Treatment/View) folder to match project
conventions, update any module or target membership if needed, and verify
imports/usage of TreatmentEntity remain valid (adjust import statements or
access levels if the move causes visibility issues) and update any file
references in project settings so builds and references to DownTimeSettingView
compile correctly.
- Around line 25-26: The ForEach is using id: \.self which hashes entire
TreatmentEntity objects; change it to use the entity's unique identifier by
switching to id: \.id so SwiftUI can diff efficiently. Locate the ForEach over
treatments (the call rendering TreatmentRowView with displayMode:
.completeBoxView and treatmentEntity: treatment) and update its id parameter to
.id (ensure TreatmentEntity exposes an id property or provide the correct
identifier property) so identity is stable and performance improves.
♻️ Duplicate comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift (1)
63-65: Preview 코드 삭제가 필요합니다.이전 리뷰에서 지적된 대로 Preview 코드를 삭제해주세요.
| // | ||
| // DownTimeSettingView.swift | ||
| // Cherrish-iOS | ||
| // | ||
| // Created by 어재선 on 1/16/26. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| struct DownTimeSettingView: View { | ||
| var treatments: [TreatmentEntity] |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
파일 위치가 적절하지 않습니다.
DownTimeSettingView.swift 파일이 Model 폴더에 위치해 있지만, 이 파일은 SwiftUI View입니다. 프로젝트 구조의 일관성을 위해 View 폴더로 이동하는 것이 좋습니다.
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 1 - 11, DownTimeSettingView is a SwiftUI view declared as struct
DownTimeSettingView and currently lives in the Model folder; move the
DownTimeSettingView.swift file into the project's View (or
Presentation/Feature/Calendar/Treatment/View) folder to match project
conventions, update any module or target membership if needed, and verify
imports/usage of TreatmentEntity remain valid (adjust import statements or
access levels if the move causes visibility issues) and update any file
references in project settings so builds and references to DownTimeSettingView
compile correctly.
| ForEach(treatments, id: \.self) { treatment in | ||
| TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
ForEach에서 id: \.id 사용을 권장합니다.
id: \.self는 전체 객체를 해시하므로, TreatmentEntity가 id 속성을 가지고 있다면 id: \.id를 사용하는 것이 더 명확하고 성능상 유리합니다.
♻️ 제안하는 수정
- ForEach(treatments, id: \.self) { treatment in
+ ForEach(treatments, id: \.id) { treatment in
TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {})
}📝 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.
| ForEach(treatments, id: \.self) { treatment in | |
| TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) | |
| ForEach(treatments, id: \.id) { treatment in | |
| TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) |
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 25 - 26, The ForEach is using id: \.self which hashes entire
TreatmentEntity objects; change it to use the entity's unique identifier by
switching to id: \.id so SwiftUI can diff efficiently. Locate the ForEach over
treatments (the call rendering TreatmentRowView with displayMode:
.completeBoxView and treatmentEntity: treatment) and update its id parameter to
.id (ensure TreatmentEntity exposes an id property or provide the correct
identifier property) so identity is stable and performance improves.
| VStack(alignment: .leading, spacing: 0) { | ||
| TypographyText( | ||
| "본 정보는 의료 상담이나 진단을 대체하지 않으며,", | ||
| style: .body3_r_12, | ||
| color: .gray600 | ||
| ) | ||
| TypographyText( | ||
| "실제 다운타임 및 회복 과정은 개인에 따라 다를 수 있습니다.", | ||
| style: .body3_r_12, | ||
| color: .gray600 | ||
| ) | ||
| TypographyText( | ||
| "정확한 내용은 의료진 상담을 통해 확인하세요.", | ||
| style: .body3_r_12, | ||
| color: .gray600 | ||
| ) | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
면책 조항 텍스트를 하나의 문자열로 통합하는 것을 고려해보세요.
세 개의 TypographyText를 사용하는 대신 하나의 멀티라인 문자열로 통합하면 코드가 더 간결해질 수 있습니다. 단, 현재 방식이 특정 줄바꿈 위치를 보장해야 하는 디자인 요구사항이라면 현재 구현도 괜찮습니다.
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 36 - 52, Replace the three separate TypographyText views inside the
VStack with a single TypographyText that uses a multiline string (with explicit
\n line breaks) so the same text, style (.body3_r_12) and color (.gray600) are
preserved; ensure the \n placements match the current visual line breaks/design
and keep the VStack alignment/spacing unchanged (refer to the VStack and
TypographyText usages in DownTimeSettingView.swift to locate the code to
update).
🔗 연결된 이슈
📄 작업 내용
💻 주요 코드 설명
코드 설명할 파일 이름 (ex: HomeView)