[#288] TodoEditorView에서 Todo의 완료 여부를 토글할 수 있는 UI를 구현한다#296
Conversation
Summary of ChangesHello, 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은 Todo 항목의 완료 상태를 관리하는 기능을 통합합니다. 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은 Todo 편집 화면에서 할 일의 완료 상태를 변경할 수 있는 UI를 추가하고, 관련 뷰모델 로직을 수정합니다. 전반적으로 변경 사항은 명확하며, 특히 TodoDetailView의 정보 시트는 List를 사용하여 가독성이 좋게 리팩토링되었습니다. 다만, TodoEditorViewModel에서 완료 상태를 저장할 때 completedAt 날짜를 처리하는 로직에 엣지 케이스 버그가 있어 수정이 필요해 보입니다. 자세한 내용은 코드 리뷰 코멘트를 참고해주세요.
| createdAt: self.createdAt ?? date, | ||
| updatedAt: date, | ||
| completedAt: self.completedAt, | ||
| completedAt: state.isCompleted ? (self.completedAt ?? date) : nil, |
There was a problem hiding this comment.
makeTodo() 메서드에서 completedAt을 결정하는 로직에 버그가 있습니다.
현재 로직은 할 일을 '완료' 상태로 저장할 때, 이전에 완료된 적이 있었다면 원래의 완료 시간을 그대로 사용합니다 (self.completedAt). 이로 인해 다음과 같은 엣지 케이스에서 의도치 않은 동작이 발생합니다.
- 이미 완료된 할 일 (완료 시간: T1)의 편집 화면으로 진입합니다.
- '완료' 토글을 해제하여 '미완료' 상태로 변경합니다.
- 다시 '완료' 토글을 설정하여 '완료' 상태로 변경합니다 (이때의 시간: T2).
- 저장하면,
completedAt이 T2가 아닌 T1으로 저장됩니다.
재완료 시에는 완료 시간이 새로고침되어야 합니다. 이 문제를 해결하려면 completedAt의 상태 관리 방식을 변경하는 것을 고려해볼 수 있습니다. 예를 들어, State 구조체에 completedAt을 포함시키고, setCompleted 액션을 처리할 때 '미완료'에서 '완료'로 상태가 변경되는 시점을 감지하여 completedAt을 현재 시간으로 업데이트하는 방식이 더 견고할 것 같습니다.
Uh oh!
There was an error while loading. Please reload this page.