Skip to content

feat: (QA/4) 프로필 삭제 구현 - #437

Merged
bongtta merged 2 commits into
developfrom
feat/#436/delete-image
Jul 15, 2026
Merged

feat: (QA/4) 프로필 삭제 구현#437
bongtta merged 2 commits into
developfrom
feat/#436/delete-image

Conversation

@bongtta

@bongtta bongtta commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

#️⃣ Related Issue

Closes #436

☀️ New-insight

  • 프로필 이미지 선택 시 파일 선택창을 바로 노출하지 않고 바텀시트를 통해 이미지 변경 및 삭제 동작 분리
  • 기본 프로필 이미지와 사용자가 등록한 프로필 이미지를 구분하여 이미지 등록 시 POST, 기존 이미지 변경 시 PATCH 요청을 호출하도록 처리
  • 이미지 등록·수정·삭제 성공 후 사용자 정보 쿼리를 무효화하여 최신 프로필 이미지가 화면에 반영되도록 처리

💎 PR Point

프로필 이미지 바텀시트 추가

프로필 이미지를 클릭하면 바로 앨범이 열리지 않고 바텀시트 노출
앨범에서 선택을 누르면 바텀시트를 닫은 뒤 숨겨진 파일 input을 실행

이미지 상태에 따른 API 분기

기본 이미지 상태에서 이미지 등록: POST /v3/users/profile-image
등록된 이미지 변경: PATCH /v3/users/profile-image
등록된 이미지 삭제: DELETE /v3/users/profile-image

기본 이미지 삭제 예외 처리

기본 프로필 이미지 상태에서는 삭제할 사용자 이미지가 없기 때문에 삭제 API를 호출하지 않음
현재는 클릭 자체를 막아놓았고 추후 기획파트와 상의하여 ux 개선 예정

프로필 이미지 캐시 갱신

이미지 등록·수정·삭제 성공 후 프로필 이미지 상태를 업데이트하고, 사용자 정보 쿼리를 무효화하여 다른 화면에서도 변경된 이미지가 반영되도록 구현

📸 Screenshot

스크린샷 2026-07-16 오전 3 36 58

Summary by CodeRabbit

  • 새로운 기능
    • 프로필 이미지 편집 시 앨범에서 이미지를 선택하거나 기존 프로필 사진을 삭제할 수 있는 바텀시트를 추가했습니다.
    • 이미지 선택, 삭제, 닫기 동작을 지원합니다.
    • 삭제 가능 여부와 삭제 진행 상태에 따라 버튼을 자동으로 활성화하거나 비활성화합니다.
    • 이미지 업로드·변경·삭제가 완료되면 편집 화면이 최신 상태로 갱신됩니다.

@bongtta bongtta self-assigned this Jul 15, 2026
@bongtta
bongtta requested a review from heesunee as a code owner July 15, 2026 18:42
@bongtta bongtta added feat new feature 채은 labels Jul 15, 2026
@bongtta bongtta linked an issue Jul 15, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

프로필 이미지 편집 화면에 선택·삭제 액션을 제공하는 하단 시트를 추가하고, 업로드·패치·삭제 뮤테이션과 시트 상태 및 사용자 정보 쿼리 갱신을 연결합니다.

Changes

프로필 이미지 편집

Layer / File(s) Summary
프로필 이미지 하단 시트 UI
src/pages/edit-profile/components/profile-image-bottom-sheet.tsx
앨범 선택, 프로필 사진 삭제, 닫기 액션을 제공하며 삭제 가능 여부와 진행 상태에 따라 삭제 버튼을 비활성화합니다.
편집 화면 이미지 작업 연동
src/pages/edit-profile/edit-profile.tsx
하단 시트 상태를 관리하고 이미지 선택·삭제를 연결하며, 작업 성공 시 시트를 닫고 사용자 정보 쿼리를 무효화합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EditProfile
  participant ProfileImageBottomSheet
  participant ProfileImageMutation
  participant UserInfoQuery
  EditProfile->>ProfileImageBottomSheet: 이미지 액션 시트 열기
  ProfileImageBottomSheet->>EditProfile: 선택 또는 삭제 이벤트 전달
  EditProfile->>ProfileImageMutation: 이미지 업로드·패치·삭제 실행
  ProfileImageMutation-->>EditProfile: 작업 성공 결과 반환
  EditProfile->>UserInfoQuery: 사용자 정보 쿼리 무효화
  EditProfile->>ProfileImageBottomSheet: 시트 닫기
Loading

Possibly related PRs

Suggested reviewers: heesunee

Poem

당근처럼 둥근 사진 시트,
토끼가 살짝 열어 보네.
앨범을 고르고, 지우개도 톡,
끝나면 창은 살며시 닫혀.
새 얼굴 정보도 폴짝 갱신!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 프로필 이미지 삭제 기능 구현이라는 변경의 핵심을 간결하게 잘 요약합니다.
Linked Issues check ✅ Passed 연결 이슈 #436의 프로필 이미지 삭제 뷰 구현과 삭제 API 연결 요구를 모두 충족합니다.
Out of Scope Changes check ✅ Passed 바텀시트와 삭제 플로우 추가는 이슈 범위와 일치하며, 명확한 범위 외 변경은 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feat/#436/delete-image

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages.


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.

@github-actions

Copy link
Copy Markdown

MATEBALL-STORYBOOK
⚾ Storybook 배포가 완료되었습니다!

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

🧹 Nitpick comments (2)
src/pages/edit-profile/edit-profile.tsx (1)

51-73: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

불필요한 바텀시트 닫기 상태 업데이트를 제거하세요.

handleSelectProfileImage 내부에서 이미 setIsProfileImageSheetOpen(false)를 호출하여 바텀시트를 닫은 후 파일 선택 창을 띄우고 있습니다. 따라서 파일 업로드(POST) 및 수정(PATCH) 뮤테이션이 완료된 시점에는 바텀시트가 열려 있지 않으므로 onSuccess 콜백에서 상태를 다시 업데이트할 필요가 없습니다.

♻️ 수정 제안
   const postProfileImageMutation = useMutation({
     ...imageMutations.POST_PROFILE_IMAGE(),
     onSuccess: ({ profileImageUrl }) => {
       setProfileImageUrl(profileImageUrl);
-      setIsProfileImageSheetOpen(false);
 
       queryClient.invalidateQueries({
         queryKey: USER_KEY.INFO(),
       });
     },
   });
 
   const patchProfileImageMutation = useMutation({
     ...imageMutations.PATCH_PROFILE_IMAGE(),
     onSuccess: ({ profileImageUrl }) => {
       setProfileImageUrl(profileImageUrl);
-      setIsProfileImageSheetOpen(false);
 
       queryClient.invalidateQueries({
         queryKey: USER_KEY.INFO(),
       });
     },
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/edit-profile/edit-profile.tsx` around lines 51 - 73, Remove the
redundant setIsProfileImageSheetOpen(false) calls from the onSuccess callbacks
of postProfileImageMutation and patchProfileImageMutation, while preserving the
profile image update and USER_KEY.INFO invalidation behavior.
src/pages/edit-profile/components/profile-image-bottom-sheet.tsx (1)

25-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

버튼의 비활성화 상태 스타일링을 추가하고, 삭제 진행 중에는 앨범 선택을 제한하세요.

현재 disabled 속성이 적용되더라도 시각적 변화가 없어 사용자가 비활성화 상태임을 인지하기 어려울 수 있습니다. disabled:opacity-50 disabled:cursor-not-allowed 등의 유틸리티 클래스를 추가하여 비활성화 상태를 명확히 표시하는 것을 권장합니다.

또한, 삭제(API 통신)가 진행 중일 때 다른 액션(앨범에서 선택)이 실행되지 않도록 isDeleting 상태를 앨범 선택 버튼에도 연결해 주는 것이 안전합니다.

♻️ 수정 제안
           <button
             type="button"
-            className="body_16_m w-full cursor-pointer px-[2rem] py-[1.2rem] text-gray-900"
+            className="body_16_m w-full cursor-pointer px-[2rem] py-[1.2rem] text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"
             onClick={onSelectImage}
+            disabled={isDeleting}
           >
             앨범에서 선택
           </button>
 
           <div className="h-[0.1rem] bg-gray-300" />
 
           <button
             type="button"
-            className="body_16_m w-full cursor-pointer px-[2rem] py-[1.2rem] text-state-error"
+            className="body_16_m w-full cursor-pointer px-[2rem] py-[1.2rem] text-state-error disabled:opacity-50 disabled:cursor-not-allowed"
             onClick={onDeleteImage}
             disabled={!canDelete || isDeleting}
           >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/edit-profile/components/profile-image-bottom-sheet.tsx` around
lines 25 - 42, Update the album-selection and delete buttons in the profile
image bottom sheet to include disabled-state styling such as reduced opacity and
a not-allowed cursor. Bind isDeleting to the album-selection button’s disabled
state so onSelectImage cannot run while deletion is in progress, while
preserving the existing canDelete condition for the delete button.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/pages/edit-profile/components/profile-image-bottom-sheet.tsx`:
- Around line 25-42: Update the album-selection and delete buttons in the
profile image bottom sheet to include disabled-state styling such as reduced
opacity and a not-allowed cursor. Bind isDeleting to the album-selection
button’s disabled state so onSelectImage cannot run while deletion is in
progress, while preserving the existing canDelete condition for the delete
button.

In `@src/pages/edit-profile/edit-profile.tsx`:
- Around line 51-73: Remove the redundant setIsProfileImageSheetOpen(false)
calls from the onSuccess callbacks of postProfileImageMutation and
patchProfileImageMutation, while preserving the profile image update and
USER_KEY.INFO invalidation behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 53a11c18-7edd-4bf5-a8c5-edff22bbbc6a

📥 Commits

Reviewing files that changed from the base of the PR and between 687bd46 and cf0b048.

📒 Files selected for processing (2)
  • src/pages/edit-profile/components/profile-image-bottom-sheet.tsx
  • src/pages/edit-profile/edit-profile.tsx

@bongtta
bongtta merged commit e1c8eac into develop Jul 15, 2026
5 checks passed
@bongtta
bongtta deleted the feat/#436/delete-image branch July 15, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat new feature 채은

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 프로필 이미지 삭제 기능을 구현합니다.

1 participant