[#246] TodoEditorView에서 content가 선택 사항임에도 공란이면 추가, 수정이 안되는 이슈를 해결한다#257
[#246] TodoEditorView에서 content가 선택 사항임에도 공란이면 추가, 수정이 안되는 이슈를 해결한다#257
Conversation
opficdev
commented
Mar 11, 2026
- closed TodoEditorView에서 content가 선택 사항임에도 공란이면 추가, 수정이 안되는 이슈를 해결한다 #246
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은 TodoEditorView에서 할 일의 content 필드가 비어있을 때 저장 또는 업데이트가 불가능했던 버그를 해결합니다. content 필드는 원래 선택 사항으로 의도되었으나, 유효성 검사 로직 때문에 빈 content를 허용하지 않았습니다. 이번 변경으로 TodoEditorViewModel의 유효성 검사 로직이 수정되어, 할 일 저장 시 title 필드만 비어있지 않으면 유효한 것으로 간주되어 content 필드의 선택적 특성이 올바르게 반영됩니다. 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
|
| var isValidToSave: Bool { | ||
| !title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty && | ||
| !content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty | ||
| !title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
There was a problem hiding this comment.
현재 로직은 문제 없이 동작하지만, 공백을 제외한 문자열이 비어있는지 확인하는 로직은 다른 곳에서도 사용될 가능성이 높습니다. 코드의 가독성을 높이고 재사용성을 확보하기 위해 String에 대한 확장을 추가하는 것을 고려해보시는 건 어떨까요?
예를 들어, 다음과 같은 isBlank 프로퍼티를 추가할 수 있습니다.
extension String {
var isBlank: Bool {
self.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
}이 확장을 사용하면 isValidToSave를 아래와 같이 더 명확하고 간결하게 표현할 수 있습니다.
var isValidToSave: Bool {
!title.isBlank
}이러한 유틸리티 성격의 확장은 별도 파일로 관리하여 프로젝트 전반에서 활용하는 것이 좋습니다.