Skip to content

[#356] 차트를 제거하고 히트맵 UI를 구체화하며 Todo 삭제도 집계되도록 개선한다#359

Merged
opficdev merged 29 commits intodevelopfrom
feat/#356-HeatMap
Apr 5, 2026
Merged

[#356] 차트를 제거하고 히트맵 UI를 구체화하며 Todo 삭제도 집계되도록 개선한다#359
opficdev merged 29 commits intodevelopfrom
feat/#356-HeatMap

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev commented Apr 5, 2026

opficdev added 26 commits April 3, 2026 19:44
@opficdev opficdev self-assigned this Apr 5, 2026
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

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)
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.

high

Firestore에서 필드가 존재하지 않는 문서는 해당 필드에 대한 쿼리 결과에 포함되지 않습니다. requestTodoDeletion에서 compactedAt 필드를 null로 초기화하지 않으므로, where("compactedAt", "==", null) 쿼리는 압축되지 않은 문서를 찾지 못할 가능성이 큽니다. isCompacted와 같은 불리언 플래그를 사용하거나, deletedAt 범위 쿼리 후 코드 레벨에서 필터링하는 방안을 검토해 주세요.

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()
)
}
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

dayKey(from:)date(from:) 메서드는 현재 클래스 내에서 사용되지 않는 것으로 보입니다. 불필요한 코드는 제거하여 유지보수성을 높이는 것이 좋습니다.

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
)
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

분기 활동 데이터를 가져오기 위해 세 개의 독립적인 쿼리를 병렬로 실행하고 있습니다. fetchAllPages: true 설정으로 인해 데이터 양이 많을 경우 Firestore 읽기 비용과 네트워크 부하가 증가할 수 있습니다. 활동 요약 데이터를 서버 측에서 미리 집계하거나, 클라이언트 측 캐싱 전략을 강화하는 것을 고려해 보세요.

@opficdev opficdev added the qa TestFlight에 배포 label Apr 5, 2026
@opficdev opficdev merged commit 1012250 into develop Apr 5, 2026
1 check passed
@opficdev opficdev deleted the feat/#356-HeatMap branch April 5, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa TestFlight에 배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

차트를 제거하고 히트맵 UI를 구체화하며 Todo 삭제도 집계되도록 개선한다

1 participant