Skip to content

Comments

[FEAT] 프로필 수정 UX 조정#98

Open
Emithen wants to merge 2 commits intodevelopfrom
feat/#97/edit-profile-ux
Open

[FEAT] 프로필 수정 UX 조정#98
Emithen wants to merge 2 commits intodevelopfrom
feat/#97/edit-profile-ux

Conversation

@Emithen
Copy link
Collaborator

@Emithen Emithen commented Feb 11, 2026

📝 요약

  • 프로필 수정 UX 조정

✅ 작업 내용

  • 닉네임 변경을 하지 않아도 수정 가능
  • MBTI 수정 바텀시트가 현재 값을 기본값으로 보여줌

🧪 테스트 방법

📷 참고 자료 (스크린샷/링크/GIF 등)

🔬 관련 이슈

☝️ 참고 사항

  • 참고하세요~

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 프로필 편집 화면에서 기존 MBTI가 올바르게 초기화되어 표시되도록 개선
    • 닉네임 입력 시 불필요한 검증 호출을 방지해 반응성 및 성능 최적화

@vercel
Copy link
Contributor

vercel bot commented Feb 11, 2026

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

Project Deployment Actions Updated (UTC)
valan-se-web Ready Ready Preview, Comment Feb 11, 2026 9:18am
valanse-origin-repo Ready Ready Preview, Comment Feb 11, 2026 9:18am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

닉네임 검증 흐름에 조기 반환(빈 값 또는 기존 닉네임과 동일) 로직을 추가해 불필요한 검증 호출을 막고, MBTIBottomSheet에 선택적 mbti prop을 도입해 전달된 값으로 내부 상태를 초기화하도록 변경했습니다.

Changes

Cohort / File(s) Summary
닉네임 검증 로직
src/components/pages/my/edit/editPage.tsx
debouncedNickname이 빈 값이거나 myPageData.nickname과 동일하면 조기 반환하도록 가드 추가. validateNickname 호출 의존성에 debouncedNickname, myPageData 반영. 에러 메시지 분기(available/meaningful/clean) 및 일반 예외 처리 유지. MBTIBottomSheet 호출 시 mbti={mbti as MBTI} 전달로 public API 사용 변경.
MBTI 바텀시트 초기화
src/components/pages/onboarding/mbtiBottomSheet.tsx
mbti?: MBTI 선택적 prop 추가 및 인터페이스 확장. 전달된 mbti 배열이 있으면 내부 상태를 해당 요소들로 초기화하도록 변경(초기 console.log 추가). 기존 handleSelectMBTI, onClose, setMbti 동작은 유지.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 닉네임은 그대로 둬도 돼, 걱정 말고 가자
빈 칸 보이면 살짝 멈추고, 같으면 스킵하자
MBTI도 기억해 뒀다가 살포시 꺼내넣고
훌쩍 바뀐 흐름에 토끼도 깡총깡총 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 프로필 수정 UX 조정이라는 주요 변경사항을 명확하게 반영하고 있으며, 간결하고 의미 있는 표현을 사용하고 있습니다.
Linked Issues check ✅ Passed 닉네임 검증 로직 개선를 통해 닉네임 미변경 시에도 프로필 변경이 가능하도록 하여 이슈 #97의 요구사항을 완전히 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 닉네임 검증 로직 개선과 MBTI 기본값 표시라는 이슈 #97의 목표와 직접적으로 관련되어 있습니다.

✏️ 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 feat/#97/edit-profile-ux

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.

Copy link
Contributor

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
src/components/pages/my/edit/editPage.tsx (1)

136-145: ⚠️ Potential issue | 🟠 Major

updateProfileThunk dispatch 후 await 없이 즉시 페이지 이동합니다.

dispatch(updateProfileThunk(refinedForm))의 결과를 기다리지 않고 바로 router.push('/my')를 호출하면, /my 페이지에서 아직 업데이트되지 않은 이전 프로필 데이터가 표시될 수 있습니다.

🛠️ 제안된 수정
   const handleSubmit = async () => {
     const refinedForm = refineForm()
 
     if (nickNameMessage) {
       alert(nickNameMessage)
     } else {
-      dispatch(updateProfileThunk(refinedForm))
+      await dispatch(updateProfileThunk(refinedForm))
       router.push('/my')
     }
   }
🤖 Fix all issues with AI agents
In `@src/components/pages/my/edit/editPage.tsx`:
- Around line 70-100: The effect in useEffect that validates debouncedNickname
should include myPageData?.nickname in its dependency array and drop the
redundant debouncedNickname.length === 0 check; update the dependency list to
[debouncedNickname, myPageData?.nickname] so the compare debouncedNickname ===
myPageData?.nickname uses fresh data, and simplify the empty check to if
(!debouncedNickname) { setNickNameMessage(null); return; } while keeping the
existing validateNickname, checkNickname calls and setNickNameMessage branches
unchanged.
🧹 Nitpick comments (3)
src/components/pages/onboarding/mbtiBottomSheet.tsx (1)

14-14: 디버그용 console.log를 제거해 주세요.

프로덕션 코드에 디버그 로그가 남아 있습니다. 불필요한 콘솔 출력은 제거하는 것이 좋습니다.

🧹 제안된 수정
-  console.log('[MBTIBottomSheet] ', mbti?.[0])
src/components/pages/my/edit/editPage.tsx (2)

102-104: 디버그용 console.log를 제거해 주세요.

mbtiBottomSheet.tsx와 마찬가지로 프로덕션 코드에 디버그 로그가 남아 있습니다.

🧹 제안된 수정
   useEffect(() => {
-    console.log('전역 상태 nickname', myPageData?.nickname)
-    console.log('로컬 상태 nickname', nickname)
     if (myPageData) {

271-271: mbti as MBTI 타입 캐스팅 시 null 가능성에 주의하세요.

mbti 상태는 MBTI | null 타입인데, mbti as MBTI로 캐스팅하면 null일 때 타입 안전성이 깨집니다. 실제로는 myPageData 가드(Line 147)로 인해 null일 가능성이 낮지만, 방어적으로 처리하는 것이 좋습니다.

🛡️ 제안된 수정
-          mbti={mbti as MBTI}
+          mbti={mbti ?? undefined}

Copy link
Contributor

@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/pages/my/edit/editPage.tsx (1)

267-273: ⚠️ Potential issue | 🟡 Minor

mbti as MBTI 타입 단언 — mbtinull일 경우 안전하지 않을 수 있습니다

mbti 상태가 MBTI | null로 선언되어 있으므로(Line 62), 만약 myPageData.mbti가 비어 있는 경우 nullMBTI로 캐스팅되어 MBTIBottomSheet 내부에서 예기치 않은 동작이 발생할 수 있습니다.

🛡️ 제안: null 가드 추가
-      {mbtiBottomSheetOpen && (
+      {mbtiBottomSheetOpen && mbti && (
         <MBTIBottomSheet
           onClose={() => setMbtiBottomSheetOpen(false)}
           setMbti={setMbti}
-          mbti={mbti as MBTI}
+          mbti={mbti}
         />
       )}

const [selectedTF, setSelectedTF] = useState('')
const [selectedPJ, setSelectedPJ] = useState('')
const MBTIBottomSheet = ({ onClose, setMbti, mbti }: MBTIBottomSheetProps) => {
console.log('[MBTIBottomSheet] ', mbti?.[0])
Copy link
Collaborator

Choose a reason for hiding this comment

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

콘솔이 남아있읍니다

}, [debouncedNickname, myPageData])

useEffect(() => {
console.log('전역 상태 nickname', myPageData?.nickname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

요거좀 지워주세용

<MBTIBottomSheet
onClose={() => setMbtiBottomSheetOpen(false)}
setMbti={setMbti}
mbti={mbti as MBTI}
Copy link
Collaborator

Choose a reason for hiding this comment

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

타입 추론이 왜 안되었죵

} else if (!res.isClean) {
setNickNameMessage('욕설을 포함한 닉네임은 사용할 수 없습니다.')
} else {
setNickNameMessage(null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

지저분한데.. switch문..?

const [selectedEI, setSelectedEI] = useState(mbti?.[0] ?? '')
const [selectedNS, setSelectedNS] = useState(mbti?.[1] ?? '')
const [selectedTF, setSelectedTF] = useState(mbti?.[2] ?? '')
const [selectedPJ, setSelectedPJ] = useState(mbti?.[3] ?? '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

상태가 4개나 되네요
이러니 식은 어떤가요

const [mbtiState, setMbtiState] = useState({
  EI: mbti?.[0] ?? '',
  NS: mbti?.[1] ?? '',
  TF: mbti?.[2] ?? '',
  PJ: mbti?.[3] ?? '',
})

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.

[FEAT] 프로필 변경 UX 개선

2 participants