Skip to content

[Feat] #77 공동생활 가이드 API 연결 - #80

Merged
nabbang6 merged 7 commits into
developfrom
feat/#77-공동생활-가이드-api-연결
May 30, 2026

Hidden character warning

The head ref may contain hidden characters: "feat/#77-\uacf5\ub3d9\uc0dd\ud65c-\uac00\uc774\ub4dc-api-\uc5f0\uacb0"
Merged

nabbang6 merged 7 commits into
developfrom
feat/#77-공동생활-가이드-api-연결

Conversation

@nabbang6

@nabbang6 nabbang6 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

🗒️ PR 타입

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 코드 리팩토링
  • 문서 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

🔗 관련 이슈


📌 작업사항

  • GET /match-reports/{targetUserId} API 함수(getMatchReport) 및 훅(useMatchReport) 추가
  • MatchActionBar에서 매칭하기 버튼 클릭 시 useMatchReport(targetUserId) 호출로 변경 (기존 postId 기반 → userId 기반)
  • MatchingReportContent에서 postId 없이 진입하는 경우(/roommate/:id/matching-report)
    useMatchReport(roommateId) 로 매칭 리포트 조회하도록 수정 (버그 수정 포함)
  • ChatSharedLifeGuidePage에서 useMatchReport 호출, 로딩·에러 상태 처리 추가
  • SharedLifeGuideContent API 응답 데이터 기반으로 전환 — 하드코딩 상수 제거, matchReport: PostMatchRateData prop으로 교체
    • summaryComment.brief → 힌트 배너
    • matchedFeatures → 공동 생활 체크포인트
    • mismatchedFeatures → 미리 조율하면 좋은 점 (넘버 뱃지 포함)
    • conversationStarters → 대화 추천 주제
  • 공동생활 가이드 UI를 Figma 디자인에 맞게 개선 (힌트 배너 색상, 체크포인트 텍스트 스타일, 조율 카드
    레이아웃 등)
  • MatchRateFeature, MatchRateMismatchedFeature, MatchRateConversationStarter 타입 barrel export 추가

📸 스크린샷

2026-05-29.205042.mp4

📣 기타사항 및 코멘트

  • 엔드포인트 구분
    • /board 게시글 상세에서의 매칭: GET /posts/{postId}/match-rate (usePostMatchRate 유지)
    • 룸메이트 프로필·공동생활 가이드에서의 매칭: GET /match-reports/{targetUserId}
      (useMatchReport 신규)
  • MatchingReportContent는 두 경로 모두 지원 (postId 유무에 따라 자동 분기)

✅ 체크리스트

  • 로컬에서 빌드 및 테스트 완료
  • Label 지정 완료
  • 리뷰어 지정 완료
  • 코드 리뷰 반영 완료

Summary by CodeRabbit

  • 신규 기능
    • 룸메이트 매칭 확인 시 사용자 기반 매칭 리포트 조회 기능 추가
  • 개선 사항
    • 공유 라이프 가이드가 매칭 리포트 기반으로 재구성되어 매칭률·요약·추천 항목을 조건부로 표시
    • 대화 주제·체크리스트·조정 항목의 표현과 레이아웃 개선
    • 일부 내비게이션/내 프로필 화면의 레이아웃·버튼 동작 정비

Review Change Stack

@nabbang6
nabbang6 requested a review from hdg0116 May 29, 2026 11:55
@nabbang6 nabbang6 self-assigned this May 29, 2026
@nabbang6 nabbang6 added ✨ Feature 기능 개발 🔗 API API 관련 작업 labels May 29, 2026
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bangjjack-frontend-dev Ready Ready Preview, Comment May 30, 2026 7:35am

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Caution

Review failed

Failed to post review comments

Walkthrough

matchReport API 엔드포인트와 React Query 훅을 추가하고, 이를 활용하여 공동 생활 가이드 페이지와 roommate 매칭 컴포넌트에서 동적 matchReport 데이터를 페칭 및 렌더링하도록 변경. 정적 matchRate 상수 대신 API에서 조회한 matchReport 객체를 사용하여 조건부 섹션 표시 구현.

Changes

Match Report API와 Shared Life Guide 통합

Layer / File(s) Summary
API and React Query setup
src/api/matchReports.ts, src/api/index.ts, src/features/board/hooks/useMatchReport.ts, src/features/board/hooks/index.ts, src/features/board/queries/postQueryKeys.ts
getMatchReport(targetUserId) API 래퍼와 useMatchReport React Query 훅 추가. postQueryKeys.matchReport(targetUserId) 쿼리 키로 관리하고 staleTime: Infinity 설정으로 데이터 유지.
Type system expansion
src/features/board/types/index.ts
MatchRateFeature, MatchRateMismatchedFeature, MatchRateConversationStarter 타입을 board features 계층에서 재내보내기하여 컴포넌트 접근성 확보.
SharedLifeGuideContent refactoring
src/features/chat/components/SharedLifeGuideContent.tsx
Props를 정적 matchRate + 상수 배열에서 matchReport: PostMatchRateData로 변경. 조건부 렌더링으로 matchReport.matchedFeatures, mismatchedFeatures, conversationStarters 섹션 표시.
Shared life guide subcomponents
src/features/chat/components/shared-life-guide/SharedLifeChecklistRow.tsx, SharedLifeCoordinationCard.tsx, SharedLifeTopicRow.tsx
각 컴포넌트의 props 타입을 새 matchReport 구조에 맞춰 업데이트. SharedLifeChecklistRowMatchRateFeature 기반으로, SharedLifeCoordinationCardMatchRateMismatchedFeature + index 기반으로, SharedLifeTopicRowMatchRateConversationStarter 기반으로 변경.
ChatSharedLifeGuidePage integration
src/pages/ChatSharedLifeGuidePage.tsx
useMatchReport 훅 호출 추가. 로딩/에러 상태 조건부 처리 후 matchReportSharedLifeGuideContent에 전달하는 페이지 레벨 데이터 플로우 구현.
Roommate matching components
src/features/board/components/roommate/MatchActionBar.tsx, src/features/roommate/components/MatchingReportContent.tsx
MatchActionBar에서 usePostMatchRateuseMatchReport(targetUserId) 훅 교체. MatchingReportContent에서 usePostMatchRateuseMatchReport를 조합하여 postId 또는 roommateId 기반 데이터 선택적 페칭 구현.

UI, 레이아웃 및 네비게이션 변경

Layer / File(s) Summary
Post flow 및 뒤로가기 훅 적용
src/features/board/components/post/PostChecklistContent.tsx, src/features/board/components/post/PostDetailContent.tsx, src/hooks/useGoBack.ts
마운트 시 draft 존재 여부 추적으로 불필요한 리다이렉트 방지, 포스트 생성/수정 이후 navigate state에 preventBack: true 추가, PostDetailContent에서 useGoBack 훅으로 뒤로가기 처리 교체.
MyPage 레이아웃·메뉴·체크리스트
src/features/mypage/components/MyActivityContent.tsx, src/features/mypage/components/MyPageMenuSection.tsx, src/features/mypage/components/checklist/MyChecklistContent.tsx
마이페이지 활동·메뉴·체크리스트 컴포넌트의 레이아웃/버튼/다이얼로그 로직 및 메뉴 항목(회원탈퇴 제거) 단순화.
프로필 편집/뷰
src/features/mypage/components/profile-edit/ProfileEditFields.tsx, src/features/mypage/components/profile-edit/ProfileViewContent.tsx
ProfileEditFields에서 Controller 기반 바인딩 및 parseDisplayName 사용, ProfileViewContent에서 ChecklistItem에 전달하던 isMatched 제거.
라우트 및 배포 설정
src/pages/MainPage.tsx, vercel.json
ROUTE_CONFIGS에서 일부 경로 헤더 및 showBottomNav/fullBleed 설정 변경, vercel.json의 rewrites → routes 전환.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • hdg0116
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning MyPageMenuSection의 회원탈퇴 기능 제거, MyPageMenuItem 타입 변경 등 일부 변경이 #77 이슈의 범위를 벗어나 있습니다. MyPage 관련 기능 제거는 별도 이슈로 분리하거나, #77과의 연관성을 명시하세요. 공동생활 가이드 API 연결과 직접 관련이 없는 변경사항입니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 공동생활 가이드 API 연결이라는 주요 변경점을 명확하게 나타내고 있으며, PR의 핵심 목적(API 연결)을 간결하게 표현합니다.
Description check ✅ Passed PR 설명은 템플릿의 모든 필수 섹션(PR 타입, 관련 이슈, 작업사항)을 완성했으며, 상세한 작업 항목과 엔드포인트 구분 설명을 포함하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 주요 변경사항이 #77 이슈의 목표인 '공동 생활 가이드 페이지 매칭률 전달'을 충족합니다. 새로운 API(getMatchReport), 훅(useMatchReport) 추가, SharedLifeGuideContent API 데이터 기반 전환, 및 ChatSharedLifeGuidePage 로딩·에러 처리 추가가 이슈의 요구사항을 모두 구현합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#77-공동생활-가이드-api-연결

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

✅ CI 검증 결과

TypeScript: 통과
ESLint: 통과
Prettier: 통과
Build: 통과

🎉 모든 검증을 통과했습니다.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f940b4 and 7042af4.

📒 Files selected for processing (13)
  • src/api/index.ts
  • src/api/matchReports.ts
  • src/features/board/components/roommate/MatchActionBar.tsx
  • src/features/board/hooks/index.ts
  • src/features/board/hooks/useMatchReport.ts
  • src/features/board/queries/postQueryKeys.ts
  • src/features/board/types/index.ts
  • src/features/chat/components/SharedLifeGuideContent.tsx
  • src/features/chat/components/shared-life-guide/SharedLifeChecklistRow.tsx
  • src/features/chat/components/shared-life-guide/SharedLifeCoordinationCard.tsx
  • src/features/chat/components/shared-life-guide/SharedLifeTopicRow.tsx
  • src/features/roommate/components/MatchingReportContent.tsx
  • src/pages/ChatSharedLifeGuidePage.tsx

@github-actions

Copy link
Copy Markdown

✅ CI 검증 결과

TypeScript: 통과
ESLint: 통과
Prettier: 통과
Build: 통과

🎉 모든 검증을 통과했습니다.

@hdg0116 hdg0116 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다!! 기능 문제 없는 것 같아서 바로 머지해주시면 될 것 같아요ㅠㅠ 대신 연결해주셔서 너무 감사합니다...😭🙇‍♀️

@nabbang6

Copy link
Copy Markdown
Collaborator Author

확인했습니다!! 기능 문제 없는 것 같아서 바로 머지해주시면 될 것 같아요ㅠㅠ 대신 연결해주셔서 너무 감사합니다...😭🙇‍♀️

아 그 말씀드리는 걸 깜빡햇는데 현재 api로 받아올 수 없는 정보들이 조금 잇어서... ui도 살짝 수정했습니다 ㅠ.ㅠ!!
설계서랑 ppt에도 제가 반영해두께욤

@github-actions

Copy link
Copy Markdown

✅ CI 검증 결과

TypeScript: 통과
ESLint: 통과
Prettier: 통과
Build: 통과

🎉 모든 검증을 통과했습니다.

@nabbang6
nabbang6 merged commit 38fc55b into develop May 30, 2026
4 checks passed
@nabbang6
nabbang6 deleted the feat/#77-공동생활-가이드-api-연결 branch June 2, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔗 API API 관련 작업 ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] #77 공동 생활 가이드 페이지 매칭률 전달

2 participants