Skip to content

[#273] TodoEditorView에서 마감일이 있을 때의 ui/ux를 개선한다#279

Merged
opficdev merged 2 commits intodevelopfrom
ui/#273-TodoEditorView-dueDate
Mar 16, 2026
Merged

[#273] TodoEditorView에서 마감일이 있을 때의 ui/ux를 개선한다#279
opficdev merged 2 commits intodevelopfrom
ui/#273-TodoEditorView-dueDate

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev self-assigned this Mar 16, 2026
@gemini-code-assist
Copy link
Copy Markdown
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!

이 풀 리퀘스트는 할 일 편집기 내에서 마감일을 설정하고 관리하는 사용자 경험을 개선하는 데 중점을 둡니다. ViewModel의 기본 로직을 간소화하고, UI에서 마감일의 시각적 표현과 상호 작용을 크게 업그레이드하여 사용자가 마감일을 확인하고, 설정하고, 지우는 것을 더욱 직관적으로 만들었습니다.

Highlights

  • ViewModel 리팩토링: TodoEditorViewModel에서 hasDueDate 계산 속성을 제거하고 toggleDueDate 액션을 dueDate를 직접 확인하도록 리팩토링했습니다.
  • UI/UX 개선: TodoEditorView의 마감일 표시를 개선하여, 단순한 체크마크 대신 서식화된 날짜를 보여주고 쉽게 제거할 수 있는 Tag 컴포넌트로 변경했습니다.
  • 날짜 서식 지정: TodoEditorView에 현재 연도에 따라 날짜를 동적으로 서식화하는 새로운 dueDateText(for:) 헬퍼 함수를 추가했습니다.
Changelog
  • DevLog/Presentation/ViewModel/TodoEditorViewModel.swift
    • hasDueDate 계산 속성을 제거했습니다.
    • toggleDueDate 액션을 마감일 토글을 위해 dueDate를 직접 확인하도록 업데이트했습니다.
  • DevLog/UI/Home/TodoEditorView.swift
    • 날짜 작업을 위한 calendar 인스턴스를 추가했습니다.
    • 마감일 UI를 새로운 dueDateControl 계산 속성으로 리팩토링했습니다.
    • 마감일을 표시하고 관리하는 Tag 컴포넌트를 구현하여 사용자가 UI에서 직접 마감일을 지울 수 있도록 했습니다.
    • 연도에 따라 마감일을 서식화하는 dueDateText(for:) 헬퍼 함수를 추가했습니다.
Activity
  • 현재까지 특별한 활동(댓글, 리뷰 등)은 없습니다.
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
Copy Markdown
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은 TodoEditorView의 마감일 관련 UI/UX를 개선합니다. 기존의 체크박스 방식 대신, 마감일이 설정되면 날짜가 표시된 태그를 보여주고, 태그를 삭제하여 마감일을 제거할 수 있도록 변경되었습니다. 또한, 마감일이 현재 연도일 경우 연도를 생략하여 표시하는 등 날짜 포맷팅도 개선되었습니다.

전반적으로 좋은 개선이지만, 코드의 유지보수성과 테스트 용이성을 높이기 위한 몇 가지 제안 사항이 있습니다. ViewModel에서 사용되지 않는 것으로 보이는 액션을 정리하고, View의 날짜 포맷팅 함수를 순수 함수로 변경하는 것을 고려해볼 수 있습니다.

Comment on lines 142 to 147
case .toggleDueDate:
if state.hasDueDate {
state.dueDate = nil
} else {
if state.dueDate == nil {
state.dueDate = calendar.date(byAdding: .day, value: 1, to: Date())
} else {
state.dueDate = nil
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

.toggleDueDate 액션이 TodoEditorView에서 사용되지 않는 것으로 보입니다. 이 PR에서 변경된 UI에서는 마감일 설정/해제를 위해 .setDueDate 액션을 사용하고 있습니다. 만약 다른 곳에서도 .toggleDueDate를 사용하지 않는다면, 코드 명확성과 유지보수성 향상을 위해 Action enum에서 해당 케이스와 reduce 함수의 관련 로직을 제거하는 것을 고려해 보세요.

Comment on lines +215 to +228
private func dueDateText(for dueDate: Date) -> String {
let currentYear = calendar.component(.year, from: Date())
let dueDateYear = calendar.component(.year, from: dueDate)

if currentYear == dueDateYear {
return dueDate.formatted(
.dateTime.month(.defaultDigits).day(.defaultDigits)
)
}

return dueDate.formatted(
.dateTime.year(.twoDigits).month(.defaultDigits).day(.defaultDigits)
)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

dueDateText(for:) 함수 내에서 Date()를 직접 호출하면 현재 시간에 의존하게 되어 테스트하기 어려워집니다. 함수를 순수 함수로 만들고 테스트 용이성을 높이기 위해 현재 날짜를 파라미터로 전달하고 기본값으로 Date()를 사용하는 것이 좋습니다.

Suggested change
private func dueDateText(for dueDate: Date) -> String {
let currentYear = calendar.component(.year, from: Date())
let dueDateYear = calendar.component(.year, from: dueDate)
if currentYear == dueDateYear {
return dueDate.formatted(
.dateTime.month(.defaultDigits).day(.defaultDigits)
)
}
return dueDate.formatted(
.dateTime.year(.twoDigits).month(.defaultDigits).day(.defaultDigits)
)
}
private func dueDateText(for dueDate: Date, now: Date = Date()) -> String {
let currentYear = calendar.component(.year, from: now)
let dueDateYear = calendar.component(.year, from: dueDate)
if currentYear == dueDateYear {
return dueDate.formatted(
.dateTime.month(.defaultDigits).day(.defaultDigits)
)
}
return dueDate.formatted(
.dateTime.year(.twoDigits).month(.defaultDigits).day(.defaultDigits)
)
}

@opficdev opficdev merged commit 56e8e89 into develop Mar 16, 2026
2 checks passed
@opficdev opficdev deleted the ui/#273-TodoEditorView-dueDate branch March 16, 2026 02: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에서 마감일이 있을 때의 ux를 개선한다

1 participant