Skip to content

[#288] TodoEditorView에서 Todo의 완료 여부를 토글할 수 있는 UI를 구현한다#296

Merged
opficdev merged 3 commits intodevelopfrom
ui/#288-completion-todo
Mar 17, 2026
Merged

[#288] TodoEditorView에서 Todo의 완료 여부를 토글할 수 있는 UI를 구현한다#296
opficdev merged 3 commits intodevelopfrom
ui/#288-completion-todo

Conversation

@opficdev
Copy link
Owner

@opficdev opficdev commented Mar 17, 2026

@opficdev opficdev self-assigned this Mar 17, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 항목의 완료 상태를 관리하는 기능을 통합합니다. TodoEditorViewModel의 상태와 액션에 isCompleted 속성을 추가하여 데이터 모델을 확장하고, TodoDetailView에서 이 상태를 명확하게 표시하도록 UI를 개선했습니다. 또한, TodoEditorView에 완료 상태를 토글할 수 있는 사용자 인터페이스를 추가하여 Todo 항목의 생명 주기를 더욱 완벽하게 제어할 수 있도록 합니다.

Highlights

  • Todo 완료 상태 관리 기능 추가: Todo 항목의 완료 여부를 관리할 수 있도록 TodoEditorViewModelisCompleted 속성과 관련 액션을 추가했습니다.
  • Todo 상세 정보 UI 개선: TodoDetailView에서 Todo의 상세 정보를 표시하는 시트를 리팩토링하고, 완료 상태를 시각적으로 보여주도록 업데이트했습니다.
  • Todo 편집기 UI에 완료 토글 추가: TodoEditorView의 정보 시트에 Todo의 완료 여부를 토글할 수 있는 UI 요소를 추가하여 사용자가 직접 상태를 변경할 수 있도록 했습니다.
Changelog
  • DevLog/Presentation/ViewModel/TodoEditorViewModel.swift
    • Draft 구조체에 isCompleted 속성을 추가했습니다.
    • State 구조체에 isCompleted 속성을 추가하고 기본값을 false로 설정했습니다.
    • Action 열거형에 setCompleted(Bool) 케이스를 추가했습니다.
    • Todo 객체 생성 시 isCompleted 상태를 반영하고 completedAt을 조건부로 설정하도록 수정했습니다.
  • DevLog/UI/Home/TodoDetailView.swift
    • 기존 TodoInfoSheetViewTodoDetailInfoSheetView라는 새로운 private 구조체로 리팩토링했습니다.
    • TodoDetailInfoSheetView에 Todo 항목의 완료 상태(isCompleted)를 표시하는 로직을 추가했습니다.
  • DevLog/UI/Home/TodoEditorView.swift
    • TodoEditorInfoSheetView에 Todo 완료 여부를 토글할 수 있는 UI를 추가했습니다.
Activity
  • 이 PR에는 아직 인간 활동이 없습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

makeTodo() 메서드에서 completedAt을 결정하는 로직에 버그가 있습니다.

현재 로직은 할 일을 '완료' 상태로 저장할 때, 이전에 완료된 적이 있었다면 원래의 완료 시간을 그대로 사용합니다 (self.completedAt). 이로 인해 다음과 같은 엣지 케이스에서 의도치 않은 동작이 발생합니다.

  1. 이미 완료된 할 일 (완료 시간: T1)의 편집 화면으로 진입합니다.
  2. '완료' 토글을 해제하여 '미완료' 상태로 변경합니다.
  3. 다시 '완료' 토글을 설정하여 '완료' 상태로 변경합니다 (이때의 시간: T2).
  4. 저장하면, completedAt이 T2가 아닌 T1으로 저장됩니다.

재완료 시에는 완료 시간이 새로고침되어야 합니다. 이 문제를 해결하려면 completedAt의 상태 관리 방식을 변경하는 것을 고려해볼 수 있습니다. 예를 들어, State 구조체에 completedAt을 포함시키고, setCompleted 액션을 처리할 때 '미완료'에서 '완료'로 상태가 변경되는 시점을 감지하여 completedAt을 현재 시간으로 업데이트하는 방식이 더 견고할 것 같습니다.

@opficdev opficdev merged commit 2322a33 into develop Mar 17, 2026
2 checks passed
@opficdev opficdev deleted the ui/#288-completion-todo branch March 17, 2026 14:27
@opficdev opficdev restored the ui/#288-completion-todo branch March 17, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TodoEditorView에서 Todo의 완료 여부를 토글할 수 있는 UI를 구현한다

1 participant