Skip to content

Comments

그룹 스터디 로직 수정#388

Merged
HA-SEUNG-JEONG merged 6 commits intodevelopfrom
fix/study
Feb 9, 2026
Merged

그룹 스터디 로직 수정#388
HA-SEUNG-JEONG merged 6 commits intodevelopfrom
fix/study

Conversation

@HA-SEUNG-JEONG
Copy link
Contributor

@HA-SEUNG-JEONG HA-SEUNG-JEONG commented Feb 9, 2026

🌱 연관된 이슈

☘️ 작업 내용

  • 그룹 스터디 내 평가 관련 UI 삭제
  • 피어 리뷰 / 과제 제출 기능은 유지
  • 미션 생성자는 피어 리뷰를 못 남기도록 수정

🍀 참고사항

스크린샷 (선택)

Summary by CodeRabbit

  • 리팩토링

    • 숙제 상태 카드(MyHomeworkStatusCard)가 내부적으로 데이터 조회/처리하도록 변경되어 외부 props가 missionId만 남도록 축소되었습니다.
    • MissionDetailContent의 props에서 groupStudyId가 제거되어 해당 흐름과 분기가 간소화되었습니다.
  • 개선사항

    • 숙제 제출 시 관련 미션 데이터도 함께 갱신하도록 캐시 무효화가 추가되었습니다.
    • 피어 리뷰 권한 검증 로직이 컴포넌트 내부로 이동하여 권한 처리 방식이 일원화되었습니다.
  • 제거

    • 리더 평가 관련 UI/기능(LeaderEvaluation 등)과 관련 모달이 제거되었습니다.

HA-SEUNG-JEONG and others added 3 commits February 9, 2026 11:12
- 과제 제출: 리더/참가자 모두 가능하도록 !isLeader guard 제거
- 피어 리뷰: 리더/참가자 모두 작성 가능 (자기 과제 제외 guard 유지)
- 리더 평가 UI 전체 제거 (LeaderEvaluationSection, CreateEvaluationModal 참조 삭제)
- MissionDetailContent에서 불필요한 groupStudyId prop 제거

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- MyHomeworkStatusCard에서 useGetMission, useUserStore, useRouter로 데이터 자체 조달
- TanStack Query 캐시 공유를 활용하여 네트워크 요청 중복 없이 동작
- useSubmitHomework onSuccess에 mission 캐시 invalidation 추가 (onRefetch prop 대체)
- MissionDetailContent에서 myHomework useMemo, isMissionClosed 등 제거

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@HA-SEUNG-JEONG HA-SEUNG-JEONG self-assigned this Feb 9, 2026
@vercel
Copy link

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
study-platform-client-dev Ready Ready Preview, Comment Feb 9, 2026 2:48am

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

요약

여러 컴포넌트에서 prop drilling을 제거하고 내부 데이터 파생을 도입했습니다. MyHomeworkStatusCard는 이제 missionId만 받으며 리더 기반 평가 관련 UI와 props가 제거되었습니다. 제출 훅은 미션별 캐시 무효화를 추가합니다.

Walkthrough

MyHomeworkStatusCard가 내부에서 미션/내 숙제 데이터를 파생하도록 변경되고, HomeworkDetailContent에서 리더 평가 섹션이 제거되며 MissionDetailContent/사용처에서 groupStudyId prop이 삭제되었습니다. useSubmitHomework는 미션 쿼리도 무효화합니다.

Changes

Cohort / File(s) Summary
MyHomeworkStatusCard 리팩토링
src/components/card/my-homework-status-card.tsx
컴포넌트 public API를 { missionId }로 축소. 내부에서 useGetMission으로 미션·내 숙제 데이터 파생, URL 검색 파라미터 업데이트를 위한 handleSelectHomework 도입. 기존 props( myHomework, isMissionClosed, onSelectHomework, onRefetch ) 제거.
HomeworkDetailContent 단순화
src/components/contents/homework-detail-content.tsx
리더 전용 평가 섹션(LeaderEvaluationSection, EvaluationResult, EvaluationPending) 및 관련 모달 제거. PeerReviewSection의 권한 계산을 외부 isLeader에서 내부 isMissionCreator/isMyHomework 기반으로 전환. 일부 삭제 훅과 관련 prop 정리.
MissionDetailContent & MissionSection 변경
src/components/contents/mission-detail-content.tsx, src/components/section/mission-section.tsx
groupStudyId prop 제거. 리더/멤버 분기 로직 삭제 및 MyHomeworkStatus를 항상 missionId만으로 렌더링하도록 변경.
Hook: 제출 후 캐시 무효화 추가
src/hooks/queries/group-study-homework-api.ts
useSubmitHomeworkonSuccess가 두 번째 인자(variables)를 받아 ['mission', variables.missionId] 쿼리도 무효화하도록 변경하여 미션 데이터 캐시를 갱신.

Sequence Diagram(s)

(생성 조건 미충족 — 생략)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Props를 덜어내니 발걸음 가볍네
미션 아이디면 알아서 척척 해내죠
리더 섹션은 정리하고, 캐시도 반짝
코드 숲을 뛰어다니며 기뻐하는 토끼 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 요약하고 있습니다. groupStudyId prop 삭제, 평가 UI 제거, 피어 리뷰 권한 로직 변경 등의 핵심 변경사항이 '그룹 스터디 로직 수정'이라는 제목에 반영되어 있습니다.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/study

No actionable comments were generated in the recent review. 🎉


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/contents/homework-detail-content.tsx (1)

23-32: 🛠️ Refactor suggestion | 🟠 Major

사용되지 않는 groupStudyId prop을 제거해 주세요.

groupStudyId가 인터페이스에 정의되어 있고 구조 분해 할당되지만, 컴포넌트 내부에서 실제로 사용되지 않습니다. 다른 컴포넌트들(MissionDetailContent)에서 이미 groupStudyId를 제거했으므로, 일관성을 위해 여기서도 제거하는 것이 좋습니다.

♻️ 사용되지 않는 prop 제거
 interface HomeworkDetailContentProps {
-  groupStudyId: number;
   missionId: number;
   homeworkId: number;
 }

 export default function HomeworkDetailContent({
   homeworkId,
   missionId,
 }: HomeworkDetailContentProps) {

또한 src/components/section/mission-section.tsx의 호출 부분도 업데이트가 필요합니다:

         <HomeworkDetailContent
-          groupStudyId={groupStudyId}
           missionId={Number(missionId)}
           homeworkId={Number(homeworkId)}
         />
🧹 Nitpick comments (1)
src/components/card/my-homework-status-card.tsx (1)

22-30: 로딩 상태 처리를 고려해 주세요.

useGetMission에서 데이터를 로딩하는 동안 missionundefined이므로, myHomeworknull로 설정되어 "아직 과제를 제출하지 않았습니다" UI가 잠깐 표시될 수 있습니다. 로딩 상태에서는 스켈레톤이나 null을 반환하는 것이 UX 측면에서 더 좋을 수 있습니다.

💡 로딩 상태 처리 제안
  const { data: mission } = useGetMission(missionId);
+
+  const isLoading = !mission;

  const myHomework = useMemo(() => {
    if (!mission?.homeworks || !memberId) return null;

    return mission.homeworks.find((hw) => hw.submitterId === memberId) ?? null;
  }, [mission?.homeworks, memberId]);

  const isMissionClosed = mission?.status === 'ENDED';

+  if (isLoading) {
+    return null; // 또는 스켈레톤 UI
+  }
+
  // 미제출 상태

@HA-SEUNG-JEONG HA-SEUNG-JEONG merged commit 508545f into develop Feb 9, 2026
9 checks passed
@HA-SEUNG-JEONG HA-SEUNG-JEONG deleted the fix/study branch February 9, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant