[#136] PushNotificationListView에서 row를 탭하면 푸시알람 데이터가 읽은 상태로 되도록 구현한다#140
[#136] PushNotificationListView에서 row를 탭하면 푸시알람 데이터가 읽은 상태로 되도록 구현한다#140
Conversation
opficdev
commented
Feb 26, 2026
- closed PushNotificationView에서 row를 탭 하면 읽지 않은 경우 읽은 상태로 파란 점을 보이지 않게 한다 #136
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! 이 Pull Request는 푸시 알림 관련 ViewModel과 View의 이름을 변경하여 코드의 가독성과 유지보수성을 향상시키고, 사용자가 목록에서 알림을 탭할 때 해당 알림이 자동으로 읽음 처리되도록 기능을 추가합니다. 이는 사용자 경험을 개선하고 알림 관리의 효율성을 높이는 데 기여합니다. Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
이번 PR은 푸시 알림 목록에서 알림을 탭했을 때 '읽음' 상태로 처리하는 기능을 구현하셨네요. 파일과 클래스 이름을 PushNotificationListView와 PushNotificationListViewModel로 변경하여 명확성을 높인 점이 좋습니다.
한 가지 개선점을 제안합니다. 현재 구현에서는 이미 읽은 알림을 탭했을 때 상세 화면으로 이동하지 않는 문제가 있습니다. 사용자는 알림의 읽음 상태와 무관하게 내용을 확인하고 싶을 수 있으므로, 탭할 때 항상 상세 화면으로 이동하도록 수정하는 것이 좋겠습니다. 자세한 내용은 코드 리뷰 댓글을 참고해주세요.
| if let index = state.notifications.firstIndex(where: { $0.id == item.id }), !item.isRead { | ||
| state.selectedTodoID = TodoIDItem(id: item.todoID) | ||
| state.notifications[index].isRead.toggle() | ||
| return [.toggleRead(item.todoID)] | ||
| } |
There was a problem hiding this comment.
현재 구현에서는 이미 읽은 알림을 탭하면 아무 동작도 하지 않습니다. 사용자가 알림을 탭하는 것은 읽음 상태와 관계없이 관련 내용을 확인하려는 의도일 가능성이 높으므로, 항상 상세 화면으로 이동하도록 하는 것이 좋습니다.
또한, item.isRead를 확인하는 대신 state.notifications[index].isRead를 확인하여 상태의 일관성을 보장하는 것이 더 안전합니다. item은 View가 생성될 때의 스냅샷일 수 있기 때문입니다.
따라서 알림을 탭하면 항상 selectedTodoID를 설정하여 화면 이동을 트리거하고, 해당 알림이 아직 읽지 않은 상태일 경우에만 읽음으로 처리하도록 수정하는 것을 제안합니다.
| if let index = state.notifications.firstIndex(where: { $0.id == item.id }), !item.isRead { | |
| state.selectedTodoID = TodoIDItem(id: item.todoID) | |
| state.notifications[index].isRead.toggle() | |
| return [.toggleRead(item.todoID)] | |
| } | |
| state.selectedTodoID = TodoIDItem(id: item.todoID) | |
| if let index = state.notifications.firstIndex(where: { $0.id == item.id }) { | |
| if !state.notifications[index].isRead { | |
| state.notifications[index].isRead = true | |
| return [.toggleRead(item.todoID)] | |
| } | |
| } |