Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough스터디 그룹 생성 흐름에서 리더 참여 여부 폼 필드를 제거하고, 분류가 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/features/study/group/ui/step/step1-group.tsx`:
- Around line 61-65: When filtering out 'MENTORING' (shouldFilterMentoring /
filteredStudyTypes derived from STUDY_TYPES), ensure any existing selected type
equal to 'MENTORING' is replaced with a valid option: add logic (e.g., a
useEffect that runs when classification changes) that checks if
shouldFilterMentoring is true and the current selected type === 'MENTORING',
then set the selected type to a safe fallback such as filteredStudyTypes[0] (or
STUDY_TYPES.find(t => t !== 'MENTORING')). This guarantees the submitted value
is always valid when the mentoring option is hidden.
| const shouldFilterMentoring = classification === 'GROUP_STUDY'; | ||
| const filteredStudyTypes = shouldFilterMentoring | ||
| ? STUDY_TYPES.filter((type) => type !== 'MENTORING') | ||
| : STUDY_TYPES; | ||
|
|
There was a problem hiding this comment.
멘토링 필터링 시 기존 type 값 정합성 보장 필요
GROUP_STUDY로 전환되거나 편집 시 기존 값이 MENTORING이면 옵션이 숨겨진 채 값이 그대로 제출될 수 있습니다. 필터링될 때 유효하지 않은 값을 초기화/치환하세요.
✅ 제안 수정안
+import { useEffect } from 'react';
import { addDays } from 'date-fns';
...
const shouldFilterMentoring = classification === 'GROUP_STUDY';
const filteredStudyTypes = shouldFilterMentoring
? STUDY_TYPES.filter((type) => type !== 'MENTORING')
: STUDY_TYPES;
+
+ useEffect(() => {
+ if (shouldFilterMentoring && typeField.value === 'MENTORING') {
+ typeField.onChange(filteredStudyTypes[0] ?? undefined);
+ }
+ }, [shouldFilterMentoring, typeField.value, typeField.onChange, filteredStudyTypes]);🤖 Prompt for AI Agents
In `@src/features/study/group/ui/step/step1-group.tsx` around lines 61 - 65, When
filtering out 'MENTORING' (shouldFilterMentoring / filteredStudyTypes derived
from STUDY_TYPES), ensure any existing selected type equal to 'MENTORING' is
replaced with a valid option: add logic (e.g., a useEffect that runs when
classification changes) that checks if shouldFilterMentoring is true and the
current selected type === 'MENTORING', then set the selected type to a safe
fallback such as filteredStudyTypes[0] (or STUDY_TYPES.find(t => t !==
'MENTORING')). This guarantees the submitted value is always valid when the
mentoring option is hidden.
There was a problem hiding this comment.
굳이 useEffect를 써야 할 이유가 있어? 일단 그룹스터디 생성/수정 모달 호출 시 스터디 유형의 기본값은 '프로젝트'야.
There was a problem hiding this comment.
@HA-SEUNG-JEONG
좋은 지적이십니다. 기본값이 항상 '프로젝트'로 설정된다면 실제로 문제가 발생하지 않을 수 있습니다.
다만 한 가지 확인하고 싶은 점이 있습니다: 기존 스터디를 수정할 때도 동일한가요?
구체적으로:
- 만약 이전에
classification이 다른 값(예: PREMIUM_STUDY)이었고type이 'MENTORING'이었던 스터디가 있다면 - 해당 스터디를 편집 모드로 열 때
classification이 'GROUP_STUDY'로 바뀐 상태라면 - 이 경우에도 폼의
type필드가 자동으로 '프로젝트'로 초기화되나요?
만약 편집 모드에서도 항상 '프로젝트'로 리셋되거나, 또는 MENTORING 스터디가 GROUP_STUDY classification으로는 편집되지 않는 구조라면 말씀하신 대로 useEffect는 불필요합니다. 이 부분만 확인해주시면 제안을 철회하겠습니다.
🧠 Learnings used
Learnt from: seong-jin-jo
Repo: code-zero-to-one/study-platform-client PR: 370
File: src/components/section/my-participating-studies-section.tsx:81-89
Timestamp: 2026-02-03T18:49:50.822Z
Learning: The component `src/components/section/my-participating-studies-section.tsx` is a temporary implementation that fetches all studies and filters them client-side against the user's participating study ID set. This approach is used due to the lack of a suitable backend API. The component should be refactored or potentially removed in the future when a proper backend API becomes available.
There was a problem hiding this comment.
그룹 스터디 생성 시에는 기본값 스터디 유형이 프로젝트고
그룹 스터디 수정 시에는 스터디 생성 시 선택했던 스터디 유형을 불러오는 구조야
There was a problem hiding this comment.
@HA-SEUNG-JEONG
명확한 설명 감사합니다! 구조를 이해했습니다.
마지막으로 한 가지만 확인하고 싶습니다:
데이터베이스에 이미 저장된 기존 그룹 스터디(classification='GROUP_STUDY') 중에서 type='MENTORING'으로 되어 있는 데이터가 존재할 가능성이 있나요?
만약 그런 데이터가 없다면(또는 있을 수 없는 구조라면), 말씀하신 대로 수정 시 불러오는 스터디 유형이 항상 유효한 옵션이므로 useEffect는 불필요합니다. 제안을 철회하겠습니다.
만약 그런 데이터가 존재할 수 있다면, 해당 데이터를 편집할 때 라디오 버튼 옵션에는 '멘토링'이 없지만 form 값은 'MENTORING'으로 남아있는 상태가 될 수 있습니다.
🧠 Learnings used
Learnt from: seong-jin-jo
Repo: code-zero-to-one/study-platform-client PR: 370
File: src/components/section/my-participating-studies-section.tsx:81-89
Timestamp: 2026-02-03T18:49:50.822Z
Learning: The component `src/components/section/my-participating-studies-section.tsx` is a temporary implementation that fetches all studies and filters them client-side against the user's participating study ID set. This approach is used due to the lack of a suitable backend API. The component should be refactored or potentially removed in the future when a proper backend API becomes available.
There was a problem hiding this comment.
type='MENTORING'으로 되어 있는 데이터가 존재하고 있어
There was a problem hiding this comment.
@HA-SEUNG-JEONG
확인해주셔서 감사합니다! 그렇다면 제가 우려했던 문제가 실제로 발생할 수 있습니다.
문제 시나리오:
- DB에
classification='GROUP_STUDY'이면서type='MENTORING'인 기존 스터디가 있음 (사용자님 확인) - 해당 스터디를 수정 모드로 열면 form에
type='MENTORING'값이 로드됨 - 하지만 현재 코드는
filteredStudyTypes에서 'MENTORING'을 제외하므로 라디오 버튼 목록에 '멘토링' 옵션이 렌더링되지 않음 - 결과: 어떤 라디오 버튼도 선택되지 않은 상태로 보이지만, 실제 form 값은 'MENTORING'으로 남아있어 데이터 정합성 문제 발생
따라서 원래 제안드린 useEffect를 통한 값 초기화 로직이 필요합니다.
혹시 useEffect를 사용하고 싶지 않으시다면 다음 대안도 가능합니다:
filteredStudyTypes를 계산한 직후에 현재 선택된typeField.value가 필터링된 목록에 없으면 즉시typeField.onChange(filteredStudyTypes[0])를 호출- 또는 form 초기화 시점에 validation/sanitization 로직 추가
어떤 방식을 선호하시나요?
✏️ Learnings added
Learnt from: HA-SEUNG-JEONG
Repo: code-zero-to-one/study-platform-client PR: 379
File: src/features/study/group/ui/step/step1-group.tsx:61-65
Timestamp: 2026-02-05T02:17:49.724Z
Learning: In the repository `code-zero-to-one/study-platform-client`, there are existing database records where `classification='GROUP_STUDY'` and `type='MENTORING'`. When editing such records in `src/features/study/group/ui/step/step1-group.tsx`, the form must handle the case where the loaded type value is filtered out from the available options.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: seong-jin-jo
Repo: code-zero-to-one/study-platform-client PR: 370
File: src/components/section/my-participating-studies-section.tsx:81-89
Timestamp: 2026-02-03T18:49:50.822Z
Learning: The component `src/components/section/my-participating-studies-section.tsx` is a temporary implementation that fetches all studies and filters them client-side against the user's participating study ID set. This approach is used due to the lack of a suitable backend API. The component should be refactored or potentially removed in the future when a proper backend API becomes available.
🌱 연관된 이슈
☘️ 작업 내용
🍀 참고사항
그룹 스터디 수정 시 기존 스터디 유형이 '멘토링' 인 경우 스터디 수정 모달에서 스터디 유형이 선택되지 않은 상태로 변경

스크린샷 (선택)
Summary by CodeRabbit
Bug Fixes
New Features