Skip to content

fix: 멘토링 등록 계약과 경력 입력 검증 흐름을 정합하게 수정#442

Merged
Hyeonjun0527 merged 1 commit into
developfrom
refactor/mentoring-registration-sqaush-2
Mar 24, 2026
Merged

fix: 멘토링 등록 계약과 경력 입력 검증 흐름을 정합하게 수정#442
Hyeonjun0527 merged 1 commit into
developfrom
refactor/mentoring-registration-sqaush-2

Conversation

@Hyeonjun0527

@Hyeonjun0527 Hyeonjun0527 commented Mar 24, 2026

Copy link
Copy Markdown
Member

🌱 연관된 이슈

  • 없음

☘️ 작업 내용

  • 공개 멘토 조회의 coreKeywords 파서를 백엔드 응답 계약(code, label)과 호환되도록 정리했습니다.
  • 멘토 경력 입력에서 현재 재직을 하나만 선택할 수 있게 막고, 기간 입력 후 현재 재직을 선택할 때 종료기간 오류가 남지 않도록 상태 갱신을 일관되게 수정했습니다.
  • 멘토링 등록 저장 완료 안내 문구 앞에 성공 표시 이모지를 추가했습니다.

🍀 참고사항

  • 검증: yarn lint --fix, yarn prettier:fix, yarn typecheck
  • 대상 브랜치: develop

스크린샷 (선택)

  • 없음

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 멘토 커리어 항목에서 현재 직장을 하나만 선택하도록 개선했습니다. 다른 항목이 현재 직장으로 선택되어 있으면 새로운 항목을 현재 직장으로 변경할 수 없습니다.
    • 현재 직장으로 설정하면 종료 월이 자동으로 제거됩니다.
  • 개선사항

    • 프로필 저장 완료 메시지에 체크마크 표시를 추가했습니다.

@vercel

vercel Bot commented Mar 24, 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 Mar 24, 2026 9:36am

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
📝 Walkthrough

개요

멘토 프로필의 핵심 키워드 타입을 확장하고, 키워드 읽기 로직을 리팩토링하며, 경력 항목의 "현재 직책" 상태 관리를 개선하고 온보딩 메시지에 이모지를 추가했습니다.

변경 사항

변경 집합 / 파일 요약
타입 정의 확장
src/features/mentoring/api/mentor-api.types.ts
새로운 MentorReadableCoreKeywordResponseDto 유니온 타입 추가(CodeLabelResponseDto | MentorSavedCoreKeywordResponseDto). ProfileResponseDto.coreKeywords 타입을 더 광범위한 형태의 키워드를 허용하도록 업데이트.
핵심 키워드 계약 리팩토링
src/features/mentoring/api/mentor-core-keyword-contract.ts
readMentorCoreKeyword 내부 헬퍼 함수 도입으로 키워드 파싱 로직을 통합. toTrimmedString 유틸리티 추가. 세 가지 validation 함수들이 공유 reader를 사용하도록 리팩토링하여 중복 제거.
UI 및 컨트롤러 업데이트
src/features/mentoring/model/use-mentor-registration-controller.ts, src/features/mentoring/ui/registration/mentor-career-entries-editor.tsx
온보딩 메시지에 체크마크 이모지(✅) 추가. 경력 항목 에디터의 "현재 직책" 상태 관리 개선: 한 항목을 현재로 설정할 때 다른 모든 항목의 상태를 자동으로 비활성화하고, UI에서 다른 항목이 현재로 선택되면 체크박스 비활성화.

예상 코드 리뷰 노력

🎯 3 (보통) | ⏱️ ~20분

관련 가능성 있는 PR

  • study-platform-client#439: 멘토 핵심 키워드 타입 및 계약 리팩토링이 해당 PR의 멘토링 등록 관련 변경사항과 직접적으로 겹침.

🐰 타입을 다듬고, 로직을 정리하고,
체크마크 하나 살살 얹고,
경력 상태는 이제 깔끔하게,
한 번에 하나씩만 빛나게,
멘토님의 정보는 더욱 반짝반짝! ✨

🚥 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 제목이 변경사항의 주요 내용을 명확하게 요약하고 있습니다. 멘토링 등록 계약과 경력 입력 검증 흐름의 정합성 수정이라는 핵심 변경사항을 정확히 반영합니다.

✏️ 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 refactor/mentoring-registration-sqaush-2

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.

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/features/mentoring/model/use-mentor-registration-controller.ts (1)

1326-1332: 성공 메시지 간 표시 일관성을 맞춰주세요.

Line 1332에만 ✅ 이모지가 추가되었지만, 동일한 저장 성공 시나리오를 나타내는 Line 1329와 Line 1331의 제목에는 이모지가 없어 일관성이 떨어집니다. 세 가지 타이틀 모두 저장 완료 상태를 안내하는 메시지이므로, 사용자 경험 통일을 위해 다음 중 한 가지 방법을 권장합니다:

  1. 세 가지 타이틀 모두에 ✅ 이모지를 추가하거나
  2. Line 1332에서 이모지를 제거하여 나머지와 동일하게 유지
♻️ 일관성 개선 제안 (옵션 1: 모든 성공 메시지에 이모지 추가)
             setWelcomeOnboarding({
               mentorId,
               title: isApplyReady
-                ? '저장은 완료되었고 신청 가능 상태로 반영됩니다'
+                ? '✅ 저장은 완료되었고 신청 가능 상태로 반영됩니다'
                 : isDetailPreparing
-                  ? '저장은 완료되었지만 공개 준비가 더 필요합니다'
+                  ? '✅ 저장은 완료되었지만 공개 준비가 더 필요합니다'
                   : '✅ 저장은 완료되었고 상세 공개 준비 상태로 반영됩니다',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/mentoring/model/use-mentor-registration-controller.ts` around
lines 1326 - 1332, The three success titles set via setWelcomeOnboarding({
mentorId, title: ... }) are inconsistent: only the third branch (when not
isApplyReady and not isDetailPreparing) includes the ✅ emoji; update the three
title strings for the ternary branches (the isApplyReady branch, the
isDetailPreparing branch, and the final branch) to be consistent by either
adding ✅ to the first two titles or removing ✅ from the third so all three
match; locate this logic around the setWelcomeOnboarding call in
use-mentor-registration-controller.ts and update the title strings accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/features/mentoring/ui/registration/mentor-career-entries-editor.tsx`:
- Around line 233-235: 현재 clearErrors('careerEntries') 호출이 배열 루트와 그 하위 모든
필드(careerEntries.*)의 오류를 전부 제거하여, 바로 앞 setValue(..., { shouldValidate: true })로
재검증된 다른 행의 오류까지 숨기고 검증 흐름을 망가뜨립니다; 이를 고치려면 clearErrors 호출을 범위를 좁혀서 현재 행의
endMonth와 (필요시) 해당 행의 관련 필드만 지우도록 변경하세요(예:
clearErrors([`careerEntries.${index}.endMonth`]) 대신 전체 루트를 지우지 않음), 관련 심볼:
clearErrors, setValue, careerEntries, index, nextIsCurrent를 찾아 위와 같이 대상 필드만
제거되도록 수정하세요.

---

Nitpick comments:
In `@src/features/mentoring/model/use-mentor-registration-controller.ts`:
- Around line 1326-1332: The three success titles set via setWelcomeOnboarding({
mentorId, title: ... }) are inconsistent: only the third branch (when not
isApplyReady and not isDetailPreparing) includes the ✅ emoji; update the three
title strings for the ternary branches (the isApplyReady branch, the
isDetailPreparing branch, and the final branch) to be consistent by either
adding ✅ to the first two titles or removing ✅ from the third so all three
match; locate this logic around the setWelcomeOnboarding call in
use-mentor-registration-controller.ts and update the title strings accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7bb6bf9b-fe3d-4960-bd38-7e6dde03a395

📥 Commits

Reviewing files that changed from the base of the PR and between b1c7b10 and e718d52.

📒 Files selected for processing (4)
  • src/features/mentoring/api/mentor-api.types.ts
  • src/features/mentoring/api/mentor-core-keyword-contract.ts
  • src/features/mentoring/model/use-mentor-registration-controller.ts
  • src/features/mentoring/ui/registration/mentor-career-entries-editor.tsx

Comment on lines +233 to +235
if (nextIsCurrent) {
clearErrors([`careerEntries.${index}.endMonth`, 'careerEntries']);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In react-hook-form, does clearErrors('careerEntries') also clear nested errors like careerEntries.0.description and careerEntries.0.endMonth, or only the root array error?

💡 Result:

In react-hook-form, calling clearErrors('careerEntries') clears both the root array error (if any) and all nested errors like careerEntries.0.description and careerEntries.0.endMonth. This is the expected behavior, as confirmed by the official documentation and GitHub issues. The official clearErrors documentation explicitly states: register("test.firstName", { required: true }) register("test.lastName", { required: true }) clearErrors("test") // will clear both errors from test.firstName and test.lastName clearErrors("test.firstName") // for clear single input error This demonstrates that clearing a parent field name removes all errors under that path, including nested ones. GitHub issue #8476 confirms this for field arrays: maintainer @bluebill1049 states "This is expected behavior" when clearErrors on a field array root clears nested field errors. They note there's no built-in way to clear only the root without affecting nested errors—you must specify exact nested paths. This behavior has been consistent across versions, with fixes ensuring clearErrors on a path clears the entire subtree (e.g., issues #2730, #2961).

Citations:


clearErrors('careerEntries')로 다른 행의 유효성 검사 오류까지 함께 제거됩니다.

clearErrors('careerEntries')는 배열 루트 오류뿐만 아니라 careerEntries.0.description, careerEntries.0.endMonth 같은 중첩 필드의 모든 오류를 함께 제거합니다. 바로 앞의 setValue(..., { shouldValidate: true })로 재계산된 다른 행의 유효성 검사 오류가 숨겨져서 검증 흐름이 불일치할 수 있습니다.

수정안
-    if (nextIsCurrent) {
-      clearErrors([`careerEntries.${index}.endMonth`, 'careerEntries']);
-    }
+    if (nextIsCurrent) {
+      clearErrors(`careerEntries.${index}.endMonth`);
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/mentoring/ui/registration/mentor-career-entries-editor.tsx`
around lines 233 - 235, 현재 clearErrors('careerEntries') 호출이 배열 루트와 그 하위 모든
필드(careerEntries.*)의 오류를 전부 제거하여, 바로 앞 setValue(..., { shouldValidate: true })로
재검증된 다른 행의 오류까지 숨기고 검증 흐름을 망가뜨립니다; 이를 고치려면 clearErrors 호출을 범위를 좁혀서 현재 행의
endMonth와 (필요시) 해당 행의 관련 필드만 지우도록 변경하세요(예:
clearErrors([`careerEntries.${index}.endMonth`]) 대신 전체 루트를 지우지 않음), 관련 심볼:
clearErrors, setValue, careerEntries, index, nextIsCurrent를 찾아 위와 같이 대상 필드만
제거되도록 수정하세요.

@Hyeonjun0527 Hyeonjun0527 merged commit 5dc412b into develop Mar 24, 2026
10 of 11 checks passed
@Hyeonjun0527 Hyeonjun0527 deleted the refactor/mentoring-registration-sqaush-2 branch March 24, 2026 07:02
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