[#356] 차트를 제거하고 히트맵 UI를 구체화하며 Todo 삭제도 집계되도록 개선한다#359
Merged
Conversation
Owner
opficdev
commented
Apr 5, 2026
- closed 차트를 제거하고 히트맵 UI를 구체화하며 Todo 삭제도 집계되도록 개선한다 #356
Contributor
There was a problem hiding this comment.
Code Review
This pull request transitions the todo deletion logic from a boolean flag to a timestamp-based soft delete (deletedAt) and introduces a compaction strategy for old deleted items. It also enhances the profile activity heatmap by including deleted activities and refactoring the underlying data structures. Feedback focuses on a potential issue with the Firestore query for non-compacted documents, the presence of unused helper methods in ProfileViewModel, and suggestions to optimize the parallel fetching of activity data to reduce Firestore costs.
| let query = admin.firestore() | ||
| .collectionGroup("todoLists") | ||
| .where("isDeleted", "==", true) | ||
| .where("compactedAt", "==", null) |
Contributor
Comment on lines
+599
to
+616
| func dayKey(from date: Date) -> String { | ||
| date.formatted( | ||
| Date.ISO8601FormatStyle(timeZone: calendar.timeZone) | ||
| .year() | ||
| .month() | ||
| .day() | ||
| ) | ||
| } | ||
|
|
||
| func date(from dayKey: String) -> Date? { | ||
| try? Date( | ||
| dayKey, | ||
| strategy: Date.ISO8601FormatStyle(timeZone: calendar.timeZone) | ||
| .year() | ||
| .month() | ||
| .day() | ||
| ) | ||
| } |
Contributor
Comment on lines
+364
to
396
| async let createdTodoPage = fetchTodosUseCase.execute( | ||
| TodoQuery( | ||
| createdAtFrom: quarterStart, | ||
| createdAtTo: nextQuarterStart, | ||
| sortDateFrom: quarterStart, | ||
| sortDateTo: nextQuarterStart, | ||
| includesDeleted: true, | ||
| sortTarget: .createdAt, | ||
| pageSize: 100, | ||
| fetchAllPages: true | ||
| ), | ||
| cursor: nil | ||
| ) | ||
| return page.items | ||
| } | ||
|
|
||
| func fetchEarliestQuarterStart() async throws -> Date { | ||
| let page = try await fetchTodosUseCase.execute( | ||
| async let completedTodoPage = fetchTodosUseCase.execute( | ||
| TodoQuery( | ||
| sortTarget: .createdAt, | ||
| sortOrder: .oldest, | ||
| pageSize: 1 | ||
| sortDateFrom: quarterStart, | ||
| sortDateTo: nextQuarterStart, | ||
| includesDeleted: true, | ||
| sortTarget: .completedAt, | ||
| pageSize: 100, | ||
| fetchAllPages: true | ||
| ), | ||
| cursor: nil | ||
| ) | ||
| async let deletedTodoPage = fetchTodosUseCase.execute( | ||
| TodoQuery( | ||
| sortDateFrom: quarterStart, | ||
| sortDateTo: nextQuarterStart, | ||
| includesDeleted: true, | ||
| sortTarget: .deletedAt, | ||
| pageSize: 100, | ||
| fetchAllPages: true | ||
| ), | ||
| cursor: nil | ||
| ) |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.