Skip to content

스터디 수정 시 썸네일 이미지 유지 및 유효성 검증 로직 수정#559

Merged
HA-SEUNG-JEONG merged 1 commit into
developfrom
fix/study-edit
Apr 16, 2026
Merged

스터디 수정 시 썸네일 이미지 유지 및 유효성 검증 로직 수정#559
HA-SEUNG-JEONG merged 1 commit into
developfrom
fix/study-edit

Conversation

@HA-SEUNG-JEONG

@HA-SEUNG-JEONG HA-SEUNG-JEONG commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

🌱 연관된 이슈

  • 스터디 수정 시 썸네일 이미지가 비어있었음

☘️ 작업 내용

  • ref를 이용하여 기존 썸네일 이미지를 스터디 수정 시 로드하도록 수정

🍀 참고사항

스크린샷 (선택)

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 그룹 스터디 폼의 썸네일 확장자 처리 로직 개선
    • 편집 모드에서 폼 초기화 및 다음 버튼 활성화 조건 개선
    • 폼 데이터 유효성 검증 강화

@HA-SEUNG-JEONG HA-SEUNG-JEONG self-assigned this Apr 16, 2026
@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
study-platform-client-dev Error Error Apr 16, 2026 9:11am

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
📝 Walkthrough

개요

그룹 스터디 폼의 썸네일 확장자 처리 로직을 강화했습니다. 편집 모드에서 썸네일 URL 존재 여부를 확인하는 조건을 추가하고, 썸네일 확장자 파싱을 더 엄격하게 개선했으며, 편집 폼 초기화를 일회성으로 제어하는 참조 변수를 도입했습니다.

변경 사항

Cohort / File(s) 요약
다음 버튼 비활성화 로직
src/components/group-study/forms/group-study-form.tsx
편집 모드에서 thumbnailExtension이 비어있거나 'DEFAULT'일 때 thumbnailUrl의 존재 여부를 추가로 검사하여 진행을 제어하도록 수정. useMemo 의존성 리스트에 methodsmode 추가.
썸네일 확장자 해석 및 폼 초기화
src/components/group-study/modals/group-study-form-modal.tsx
이미지 URL에서 쿼리 문자열 제거 후 확장자 검증하여 'JPG' 기본값 반환. 편집 모드에서 type, thumbnailUrl, targetRoles 등에 기본값 할당하여 undefined 전파 방지. isFormInitializedRef를 도입하여 편집 폼 초기화를 일회성으로 제어.

예상 코드 리뷰 소요 시간

🎯 3 (Moderate) | ⏱️ ~20분

관련 가능성 있는 PR

시 (Poem)

🐰 썸네일을 다듬고 URL을 확인하니,
편집 모드는 더욱 똑똑해졌네요.
초기화 참조로 한 번만 정리하고,
다음 버튼은 더 신중하게 결정하네요.
폼의 완성도 한 걸음 더 나아갑니다! ✨

🚥 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 제목이 변경사항의 주요 목적을 정확히 요약하고 있습니다. 썸네일 이미지 유지 및 유효성 검증 로직 수정이라는 제목이 raw_summary와 pr_objectives의 핵심 내용과 일치합니다.

✏️ 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 fix/study-edit

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


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.

@HA-SEUNG-JEONG HA-SEUNG-JEONG added 🐛 bug Something isn't working and removed 🐛 bug Something isn't working labels Apr 16, 2026

@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.

Caution

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

⚠️ Outside diff range comments (1)
src/components/group-study/forms/group-study-form.tsx (1)

128-153: ⚠️ Potential issue | 🟠 Major

편집 모드에서 thumbnailUrl 변경 시 다음 버튼 비활성화 상태가 반영되지 않습니다.

라인 130의 methods.getValues('thumbnailUrl')는 스냅샷만 반환하고 필드 변경을 구독하지 않습니다. STEP_FIELDS[2]thumbnailExtension, title, description, summary만 포함하므로, 편집 모드에서 사용자가 thumbnailUrl만 변경하면 isNextButtonDisabled 메모가 재계산되지 않아 검증 상태가 stale 상태로 남습니다. useWatchthumbnailUrl을 구독하여 의존성에 추가해야 합니다.

수정 예시
   const currentStepFields = STEP_FIELDS[step];
   const currentStepValues = useWatch({ name: currentStepFields, control });
+  const thumbnailUrl = useWatch({ name: 'thumbnailUrl', control });

   const isNextButtonDisabled = useMemo(() => {
     return currentStepFields.some((field, index) => {
       const value = currentStepValues[index];
       const error = formState.errors[field];
@@
       if (field === 'thumbnailExtension') {
         if (mode === 'edit') {
-          const existingUrl = methods.getValues('thumbnailUrl');
-          return (!value || value === 'DEFAULT') && !existingUrl;
+          return (!value || value === 'DEFAULT') && !thumbnailUrl;
         }
         return !value || value === 'DEFAULT';
       }
@@
   }, [
     currentStepFields,
     currentStepValues,
     formState.errors,
     classification,
-    methods,
     mode,
+    thumbnailUrl,
   ]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/group-study/forms/group-study-form.tsx` around lines 128 -
153, The disable-next-button logic uses methods.getValues('thumbnailUrl') which
returns a snapshot and doesn't trigger re-evaluation when thumbnailUrl changes;
replace that snapshot usage by subscribing to thumbnailUrl with useWatch (e.g.,
const thumbnailUrl = useWatch({ name: 'thumbnailUrl', control: methods.control
})) and include thumbnailUrl in the dependency array for the memo/calculation
that sets isNextButtonDisabled (the block referencing thumbnailExtension,
interviewPost, methods.getValues, currentStepFields, currentStepValues,
formState.errors, classification, mode), so edits to thumbnailUrl in edit mode
correctly re-run validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/group-study/forms/group-study-form.tsx`:
- Around line 128-153: The disable-next-button logic uses
methods.getValues('thumbnailUrl') which returns a snapshot and doesn't trigger
re-evaluation when thumbnailUrl changes; replace that snapshot usage by
subscribing to thumbnailUrl with useWatch (e.g., const thumbnailUrl = useWatch({
name: 'thumbnailUrl', control: methods.control })) and include thumbnailUrl in
the dependency array for the memo/calculation that sets isNextButtonDisabled
(the block referencing thumbnailExtension, interviewPost, methods.getValues,
currentStepFields, currentStepValues, formState.errors, classification, mode),
so edits to thumbnailUrl in edit mode correctly re-run validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca2fe974-878f-4c31-9780-9f1b97a82e30

📥 Commits

Reviewing files that changed from the base of the PR and between 0604012 and d74f5e2.

📒 Files selected for processing (2)
  • src/components/group-study/forms/group-study-form.tsx
  • src/components/group-study/modals/group-study-form-modal.tsx

@HA-SEUNG-JEONG HA-SEUNG-JEONG merged commit ac8456e into develop Apr 16, 2026
10 of 11 checks passed
@HA-SEUNG-JEONG HA-SEUNG-JEONG deleted the fix/study-edit branch April 16, 2026 09:44
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