[Feat] #77 공동생활 가이드 API 연결 - #80
Hidden character warning
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedFailed to post review comments WalkthroughmatchReport API 엔드포인트와 React Query 훅을 추가하고, 이를 활용하여 공동 생활 가이드 페이지와 roommate 매칭 컴포넌트에서 동적 matchReport 데이터를 페칭 및 렌더링하도록 변경. 정적 matchRate 상수 대신 API에서 조회한 matchReport 객체를 사용하여 조건부 섹션 표시 구현. ChangesMatch Report API와 Shared Life Guide 통합
UI, 레이아웃 및 네비게이션 변경
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ CI 검증 결과✅ TypeScript: 통과 🎉 모든 검증을 통과했습니다. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/features/board/hooks/useMatchReport.ts (1)
6-10: ⚡ Quick win
enabled기본값을true로 바꾸는 편이 안전합니다.현재 기본값이
false라 호출부에서 두 번째 인자를 빼먹으면 조회가 영구히 비활성화됩니다. 공개 훅 기본 동작은 조회 실행이 더 안전합니다.제안 패치
-export function useMatchReport(targetUserId: number, enabled = false) { +export function useMatchReport(targetUserId: number, enabled = true) { return useQuery({ queryKey: postQueryKeys.matchReport(targetUserId), queryFn: () => getMatchReport(targetUserId), enabled,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/board/hooks/useMatchReport.ts` around lines 6 - 10, The hook useMatchReport currently sets enabled = false by default which silently disables the query when callers omit the second argument; update the function signature so the default is enabled = true (i.e., set the default enabled parameter to true in useMatchReport) so queries run by default, and verify the query still uses queryKey: postQueryKeys.matchReport(targetUserId) and queryFn: () => getMatchReport(targetUserId).src/features/board/queries/postQueryKeys.ts (1)
11-11: ⚡ Quick win
matchReport키도 기존 posts 네임스페이스로 맞추는 걸 권장합니다.현재 키만
["matchReports", targetUserId]로 분리되어 있어postQueryKeys.all기반 무효화/관리 패턴과 어긋납니다. 일관성 유지가 캐시 운용에 유리합니다.제안 패치
- matchReport: (targetUserId: number) => ["matchReports", targetUserId] as const, + matchReport: (targetUserId: number) => + [...postQueryKeys.all, "matchReports", targetUserId] as const,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/board/queries/postQueryKeys.ts` at line 11, The matchReport key is defined as ["matchReports", targetUserId] and breaks the existing posts namespace pattern; update the matchReport key in postQueryKeys so it uses the same posts namespace (i.e., make it consistent with postQueryKeys.all and other postQueryKeys entries) to allow unified invalidation and cache management—locate the matchReport function in postQueryKeys and change its returned tuple to use the posts namespace instead of "matchReports".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/features/board/hooks/useMatchReport.ts`:
- Around line 6-10: The hook useMatchReport currently sets enabled = false by
default which silently disables the query when callers omit the second argument;
update the function signature so the default is enabled = true (i.e., set the
default enabled parameter to true in useMatchReport) so queries run by default,
and verify the query still uses queryKey:
postQueryKeys.matchReport(targetUserId) and queryFn: () =>
getMatchReport(targetUserId).
In `@src/features/board/queries/postQueryKeys.ts`:
- Line 11: The matchReport key is defined as ["matchReports", targetUserId] and
breaks the existing posts namespace pattern; update the matchReport key in
postQueryKeys so it uses the same posts namespace (i.e., make it consistent with
postQueryKeys.all and other postQueryKeys entries) to allow unified invalidation
and cache management—locate the matchReport function in postQueryKeys and change
its returned tuple to use the posts namespace instead of "matchReports".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: df4f332c-9b9a-4547-b6ff-39ab92acb842
📒 Files selected for processing (13)
src/api/index.tssrc/api/matchReports.tssrc/features/board/components/roommate/MatchActionBar.tsxsrc/features/board/hooks/index.tssrc/features/board/hooks/useMatchReport.tssrc/features/board/queries/postQueryKeys.tssrc/features/board/types/index.tssrc/features/chat/components/SharedLifeGuideContent.tsxsrc/features/chat/components/shared-life-guide/SharedLifeChecklistRow.tsxsrc/features/chat/components/shared-life-guide/SharedLifeCoordinationCard.tsxsrc/features/chat/components/shared-life-guide/SharedLifeTopicRow.tsxsrc/features/roommate/components/MatchingReportContent.tsxsrc/pages/ChatSharedLifeGuidePage.tsx
✅ CI 검증 결과✅ TypeScript: 통과 🎉 모든 검증을 통과했습니다. |
hdg0116
left a comment
There was a problem hiding this comment.
확인했습니다!! 기능 문제 없는 것 같아서 바로 머지해주시면 될 것 같아요ㅠㅠ 대신 연결해주셔서 너무 감사합니다...😭🙇♀️
아 그 말씀드리는 걸 깜빡햇는데 현재 api로 받아올 수 없는 정보들이 조금 잇어서... ui도 살짝 수정했습니다 ㅠ.ㅠ!! |
✅ CI 검증 결과✅ TypeScript: 통과 🎉 모든 검증을 통과했습니다. |
🗒️ PR 타입
🔗 관련 이슈
📌 작업사항
GET /match-reports/{targetUserId}API 함수(getMatchReport) 및 훅(useMatchReport) 추가MatchActionBar에서 매칭하기 버튼 클릭 시useMatchReport(targetUserId)호출로 변경 (기존 postId 기반 → userId 기반)MatchingReportContent에서postId없이 진입하는 경우(/roommate/:id/matching-report)useMatchReport(roommateId)로 매칭 리포트 조회하도록 수정 (버그 수정 포함)ChatSharedLifeGuidePage에서useMatchReport호출, 로딩·에러 상태 처리 추가SharedLifeGuideContentAPI 응답 데이터 기반으로 전환 — 하드코딩 상수 제거,matchReport: PostMatchRateDataprop으로 교체summaryComment.brief→ 힌트 배너matchedFeatures→ 공동 생활 체크포인트mismatchedFeatures→ 미리 조율하면 좋은 점 (넘버 뱃지 포함)conversationStarters→ 대화 추천 주제레이아웃 등)
MatchRateFeature,MatchRateMismatchedFeature,MatchRateConversationStarter타입 barrel export 추가📸 스크린샷
2026-05-29.205042.mp4
📣 기타사항 및 코멘트
/board게시글 상세에서의 매칭:GET /posts/{postId}/match-rate(usePostMatchRate유지)GET /match-reports/{targetUserId}(
useMatchReport신규)MatchingReportContent는 두 경로 모두 지원 (postId유무에 따라 자동 분기)✅ 체크리스트
Summary by CodeRabbit