[FEAT] 투두 메모 날짜별 수정 API 연동 - #288
Open
jjangminii wants to merge 3 commits into
Open
Conversation
- orval로 PATCH /api/v1/todos/{todoId}/memo 엔드포인트를 codegen에 반영했습니다
- 백엔드가 TodoUpdateRequest에서 memo 필드를 제거함에 따라 일반 투두 수정 요청에서 memo를 분리했습니다
- 메모 수정을 date 인스턴스에 스코프된 전용 엔드포인트로 호출하도록 use-update-todo-memo-submit 훅을 추가하고 자동저장 로직을 분리했습니다
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011a4CUkqSModZ8xjXsptKjv
- memo가 primitive라 ref로 최신값을 따로 추적할 필요가 없어 latestMemoRef와 임시 변수를 제거했습니다 - 훅이 반환하는 함수가 이제 memo도 같이 저장하므로 submitTextUpdate를 submitPendingUpdates로 이름을 바꿨습니다 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011a4CUkqSModZ8xjXsptKjv
- 홈/투데이/상세/포커스 invalidateQueries 호출이 update, delete, toggle-subtask, memo 4개 훅에 반복되고 있어 use-todo-query-invalidation.ts로 통합했습니다 - 각 훅은 useStatisticsQueryInvalidation처럼 필요한 invalidate 함수만 골라 쓰도록 했습니다 (액션마다 무효화 대상이 달라 필요한 것만 조합) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011a4CUkqSModZ8xjXsptKjv
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: Comment |
Timo Performance ReportBundle Size — timo-web
Lighthouse — timo-web
Image Optimization — timo-web
측정 커밋: |
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.
ISSUE 🔗
close #287
What is this PR? 🔍
투두 메모 수정이 날짜에 상관없이 투두 전체를 덮어쓰는 범용 API를 타고 있던 것을, 백엔드가 새로 제공하는 날짜별 메모 전용 엔드포인트로 교체했습니다. 겸사겸사 4개 훅에 반복되던 쿼리 캐시 무효화 로직도 공유 훅으로 정리했습니다.
배경
PATCH /api/v1/todos/{todoId}범용 수정 API에 묶여 나갔습니다.TodoUpdateRequest에서memo필드를 제거하면서, 반복 투두의 날짜별 메모 분리 요구사항(해당 date 인스턴스에만 저장, 없으면 규칙 메모로 폴백)을 범용 API로는 더 이상 처리할 수 없게 됐습니다.PATCH /api/v1/todos/{todoId}/memo?date=전용 엔드포인트를 연동하고, 메모 자동저장을 title/subtasks 저장과 분리했습니다.투두 메모 API 연동
pnpm gen:api로useUpdateMemo훅을 코드젠에 반영하고, 메모 수정만 담당하는use-update-todo-memo-submit.ts를 새로 추가했습니다.date를 실어 보내야 날짜별 인스턴스에만 저장되는 백엔드 동작을 프론트에서 정확히 트리거할 수 있습니다.use-detail-todo-text-auto-save.ts에서 title/subtasks 시그니처와 memo 값을 각각 별도로 추적해, 2초 디바운스 시점에 변경된 것만 독립적으로 전송하도록 했습니다. 컨테이너(DetailTodoModalContainer.tsx)가 열려 있는 모달의currentDate를 클로저로 잡아updateMemo(memo)호출에 실어 보냅니다.쿼리 캐시 무효화 정리
use-update-todo-submit,use-delete-todo-submit,use-toggle-subtask-submit, 새로 추가한use-update-todo-memo-submit4곳에 반복되고 있어hooks/todo/use-todo-query-invalidation.ts로 통합했습니다.useStatisticsQueryInvalidation과 동일한 패턴으로invalidateHome/invalidateToday/invalidateTodoDetail/invalidateFocus를 개별 함수로 노출하고, 각 훅이 실제로 필요한 조합만 호출하도록 했습니다 (예:use-toggle-subtask-submit은 통계/포커스를 건드리지 않고,use-delete-todo-submit은 상세를 건드리지 않습니다). 무조건 5개 전부 무효화하는 단일 함수 대신 개별 함수로 만든 이유는 액션마다 실제로 영향받는 화면이 달라, 하나로 묶으면 불필요한 재요청이 생기기 때문입니다.To Reviewers
메모 저장이 date 인스턴스 단위로 정확히 스코프되는지는 로그인 세션에서 직접 확인하지 못했습니다 (타입체크/린트만 통과 확인). 반복 투두에서 날짜별로 다른 메모를 저장·조회하는 시나리오를 리뷰 시 한 번 확인해주시면 좋겠습니다.
캐시 무효화 리팩토링은 이번 이슈 범위를 넘어 기존 파일 3개(
use-update-todo-submit,use-delete-todo-submit,use-toggle-subtask-submit)까지 건드렸는데, 각 훅이 무효화하는 쿼리 키 조합은 리팩토링 전후로 동일하게 유지했습니다.Screenshot 📷
Test Checklist ✔
pnpm check-types통과pnpm lint통과pnpm build— 미실행