Conversation
opficdev
commented
Feb 26, 2026
- closed PushNotificationListView에서 Todo를 여러개 제거하고 다른 뷰로 갔다가 다시 넘어오면 가장 최근에 지운 것만 제거되고 나머지 지운 것들은 유지되는 현상을 해결한다 #141
Summary of ChangesHello @opficdev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| effects.append(.delete(pendingItem)) | ||
| } | ||
| guard let index = state.notifications.firstIndex(where: { $0.id == item.id }) else { | ||
| return [] |
There was a problem hiding this comment.
새로운 리뷰를 시작하려면 /gemini review 명령어를 사용해 주세요. 이 스레드에서는 추가적인 답변이 필요하지 않습니다.
|
/gemini review |
There was a problem hiding this comment.
Code Review
이 PR은 PushNotificationListView에서 여러 항목을 연속으로 삭제할 때, 이전에 삭제한 항목이 복원되는 버그를 수정합니다. 새로운 삭제 요청이 들어왔을 때 이전에 대기 중이던 삭제 작업을 즉시 처리하도록 로직을 변경하여 문제를 해결한 점이 좋습니다. 동일한 수정이 TodoListViewModel에도 일관성 있게 적용되어 앱 전반의 안정성을 높였습니다. 또한, AlertType과 ToastType을 제거하여 얼럿 및 토스트 관련 코드를 간소화한 리팩토링도 훌륭합니다. 전반적으로 좋은 수정이지만, 상태 관리 측면에서 더 개선할 수 있는 부분에 대해 몇 가지 의견을 남깁니다.
| func setAlert( | ||
| _ state: inout State, | ||
| isPresented: Bool, | ||
| for type: AlertType? | ||
| isPresented: Bool | ||
| ) { | ||
| switch type { | ||
| case .error: | ||
| state.alertTitle = "오류" | ||
| state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요." | ||
| case .none: | ||
| state.alertTitle = "" | ||
| state.alertMessage = "" | ||
| } | ||
| state.alertType = type | ||
| state.alertTitle = "오류" | ||
| state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요." | ||
| state.showAlert = isPresented | ||
| } |
There was a problem hiding this comment.
setAlert 함수가 isPresented 값에 관계없이 항상 alertTitle과 alertMessage를 설정하고 있습니다. 얼럿이 사라질 때(isPresented가 false일 때)는 메시지를 설정할 필요가 없으며, 이전 구현처럼 메시지를 비워주는 것이 상태 관리에 더 안전합니다. isPresented 값에 따라 분기하여 처리하도록 수정하는 것을 제안합니다.
func setAlert(
_ state: inout State,
isPresented: Bool
) {
if isPresented {
state.alertTitle = "오류"
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
} else {
state.alertTitle = ""
state.alertMessage = ""
}
state.showAlert = isPresented
}| func setToast( | ||
| _ state: inout State, | ||
| isPresented: Bool, | ||
| for type: ToastType? | ||
| isPresented: Bool | ||
| ) { | ||
| switch type { | ||
| case .delete: | ||
| state.toastMessage = "실행 취소" | ||
| case .none: | ||
| state.toastMessage = "" | ||
| } | ||
| state.toastMessage = "실행 취소" | ||
| state.showToast = isPresented | ||
| } |
There was a problem hiding this comment.
setToast 함수도 setAlert와 유사하게, isPresented 값에 관계없이 항상 toastMessage를 설정하고 있습니다. 토스트가 사라질 때(isPresented가 false일 때)는 메시지를 비워주는 것이 상태 관리에 더 좋습니다. 삼항 연산자를 사용하여 코드를 간결하게 수정하는 것을 제안합니다.
func setToast(
_ state: inout State,
isPresented: Bool
) {
state.toastMessage = isPresented ? "실행 취소" : ""
state.showToast = isPresented
}There was a problem hiding this comment.
Code Review
안녕하세요. 수석 iOS 개발자입니다. 코드 리뷰를 시작하겠습니다. 이번 PR은 여러 항목 삭제 후 화면 전환 시 데이터가 롤백되는 현상을 수정하였네요. PushNotificationListViewModel과 TodoListViewModel에서 연속 삭제 시 이전 삭제 대기 항목을 즉시 처리하도록 변경하여 문제를 해결한 점이 인상적입니다. 또한, AlertType과 ToastType을 제거하여 코드를 간소화한 리팩토링도 좋습니다. 다만, Alert와 Toast가 사라질 때 관련 상태가 초기화되지 않는 부분이 있어, 이에 대한 수정 제안을 코멘트로 남겼습니다. 전반적으로 훌륭한 수정입니다.
| state.alertTitle = "오류" | ||
| state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요." | ||
| state.showAlert = isPresented |
There was a problem hiding this comment.
Alert가 사라질 때 관련 상태(alertTitle, alertMessage)를 초기화하는 로직이 누락되었습니다. Alert가 다시 표시될 때 이전 메시지가 잠시 보이는 문제를 방지하기 위해 isPresented가 false일 때 메시지를 비워주는 것이 좋습니다.
| state.alertTitle = "오류" | |
| state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요." | |
| state.showAlert = isPresented | |
| state.alertTitle = isPresented ? "오류" : "" | |
| state.alertMessage = isPresented ? "문제가 발생했습니다. 잠시 후 다시 시도해주세요." : "" | |
| state.showAlert = isPresented |
| state.toastMessage = "실행 취소" | ||
| state.showToast = isPresented |