Skip to content

Refactor(client): ProfilePopupPortal 컴포넌트 추가 및 변경#225

Merged
jjangminii merged 1 commit intodevelopfrom
222-refactor-level-zindex-edit
Dec 22, 2025
Merged

Refactor(client): ProfilePopupPortal 컴포넌트 추가 및 변경#225
jjangminii merged 1 commit intodevelopfrom
222-refactor-level-zindex-edit

Conversation

@jjangminii
Copy link
Collaborator

@jjangminii jjangminii commented Dec 22, 2025

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

  • ProfilePopupPortal 컴포넌트 추가 및 변경

⭐ PR Point (To Reviewer)

fixed로만 해결하려했었는데 쌓임맥락에서 문제가 발생해 포탈로 변경했습니다

📷 Screenshot

image

Summary by CodeRabbit

릴리스 노트

스타일

  • 프로필 팝업 컴포넌트의 형식이 정리되고 불필요한 속성이 제거되었습니다.

리팩토링

  • 프로필 팝업의 렌더링 구조가 개선되어 더욱 안정적인 동작을 제공합니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@jjangminii jjangminii linked an issue Dec 22, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Dec 22, 2025

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

Project Deployment Review Updated (UTC)
pinback-client-client Ready Ready Preview, Comment Dec 22, 2025 2:57am
pinback-client-landing Ready Ready Preview, Comment Dec 22, 2025 2:57am

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

개요

ProfilePopup 컴포넌트를 React Portal을 사용하여 document.body로 렌더링하는 ProfilePopupPortal 래퍼 컴포넌트를 추가하고, Sidebar에서 이를 사용하도록 변경했습니다. 기존 ProfilePopup은 형식 정리를 수행했습니다.

변경 사항

집합 / 파일 요약
ProfilePopup 정리
apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
이펙트 훅의 조건부 이벤트 리스너 첨부 시 중괄호 추가 및 빈 className 속성 제거
Portal 래퍼 추가
apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx
createPortal을 사용하여 document.body로 ProfilePopup을 렌더링하는 새로운 Portal 컴포넌트 추가. SSR 안전성 보장
Sidebar 통합
apps/client/src/shared/components/sidebar/Sidebar.tsx
ProfilePopup 임포트를 ProfilePopupPortal로 변경하고 동일한 props로 컴포넌트 사용

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~10 분

  • ProfilePopupPortal: SSR 안전성 검증 및 Portal 사용 패턴 확인 필요
  • Sidebar: 임포트 변경이 올바르게 적용되었는지 props 일관성 확인

관련 PR

제안 레이블

🛠️ Feature, frontend

제안 리뷰어

  • jllee000
  • constantly-dev

🐰 포탈의 문을 열고,
팝업이 종당 떠올라,
DOM 나무 위로 떠다니며,
Sidebar에서 속삭이고,
매끈한 리마인더가 흐르네! 🌙✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 링크된 이슈 #25는 progress bar 구현에 관한 것으로 ProfilePopupPortal 추가와 무관하며, 실제 관련 이슈인 #222가 제대로 링크되지 않았습니다. 이슈 #222에 대한 명확한 요구사항을 확인하고 PR 설명에서 관련 이슈를 올바르게 링크해야 합니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 모든 변경사항은 ProfilePopupPortal 컴포넌트 추가 및 Sidebar에서의 사용으로 범위 내에 있습니다.
Title check ✅ Passed PR 제목이 변경사항의 주요 목적을 명확하게 설명하고 있습니다. ProfilePopupPortal 컴포넌트 추가 및 변경이라는 핵심 내용이 잘 드러나 있습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으나, 관련 이슈가 불완전하고(#222만 명시), Tasks와 PR Point 섹션이 최소한으로만 작성되어 있습니다.
✨ 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 222-refactor-level-zindex-edit

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.

@jjangminii jjangminii changed the title refactor: ProfilePopupPortal 컴포넌트 추가 및 Sidebar에서 사용하도록 변경 refactor: ProfilePopupPortal 컴포넌트 추가 및 변경 Dec 22, 2025
@github-actions
Copy link

✅ Storybook chromatic 배포 확인:
🐿️ storybook

@jjangminii jjangminii changed the title refactor: ProfilePopupPortal 컴포넌트 추가 및 변경 refactor(client): ProfilePopupPortal 컴포넌트 추가 및 변경 Dec 22, 2025
@constantly-dev constantly-dev changed the title refactor(client): ProfilePopupPortal 컴포넌트 추가 및 변경 Refactor(client): ProfilePopupPortal 컴포넌트 추가 및 변경 Dec 22, 2025
Comment on lines +23 to +28
return createPortal(
<ProfilePopup
open={open}
onClose={onClose}
profileImage={profileImage}
email={email}
Copy link
Collaborator

Choose a reason for hiding this comment

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

아예 포탈로 처리해서 해결하셨군요! 굿굿 확인했습니다 :)

Copy link

@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: 0

🧹 Nitpick comments (2)
apps/client/src/shared/components/profilePopup/ProfilePopup.tsx (1)

49-49: Portal 사용 시 하드코딩된 위치값 검토 권장

pl-[19rem] pt-[7rem]와 같은 하드코딩된 위치값이 사용되고 있습니다. 이제 document.body에 Portal로 렌더링되므로, 이러한 고정 오프셋이 다양한 화면 크기나 레이아웃 변경에 취약할 수 있습니다.

향후 더 유연한 위치 지정 방식(예: 앵커 기반 위치 계산 또는 CSS 변수)을 고려해보시기 바랍니다.

apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx (1)

4-11: Props 타입 중복 제거 고려

ProfilePopupPortalPropsProfilePopup.tsxProfilePopupProps와 동일한 구조를 가지고 있습니다. DRY 원칙을 위해 공통 타입을 추출하거나 ProfilePopupProps를 export하여 재사용하는 것을 고려해보시기 바랍니다.

🔎 제안하는 리팩토링

ProfilePopup.tsx에서 타입을 export:

-interface ProfilePopupProps {
+export interface ProfilePopupProps {
   open: boolean;
   onClose: () => void;
   profileImage: string | null;
   email: string;
   name: string;
   remindTime?: string;
 }

ProfilePopupPortal.tsx에서 재사용:

 import { createPortal } from 'react-dom';
-import ProfilePopup from './ProfilePopup';
+import ProfilePopup, { type ProfilePopupProps } from './ProfilePopup';

-interface ProfilePopupPortalProps {
-  open: boolean;
-  onClose: () => void;
-  profileImage: string | null;
-  email: string;
-  name: string;
-  remindTime?: string;
-}
-
 export default function ProfilePopupPortal({
   open,
   onClose,
   profileImage,
   email,
   name,
   remindTime,
-}: ProfilePopupPortalProps) {
+}: ProfilePopupProps) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11b299e and d0a77b3.

📒 Files selected for processing (3)
  • apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
  • apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx
  • apps/client/src/shared/components/sidebar/Sidebar.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-15T20:00:13.756Z
Learnt from: constantly-dev
Repo: Pinback-Team/pinback-client PR: 80
File: apps/client/src/shared/components/ui/modalPop/ModalPop.tsx:36-41
Timestamp: 2025-07-15T20:00:13.756Z
Learning: In apps/client/src/shared/components/ui/modalPop/ModalPop.tsx, the InfoBox component uses hardcoded values for title, location, and icon URL as temporary test data. These should be replaced with dynamic data from props when implementing actual functionality and should be marked with TODO comments for future changes.

Applied to files:

  • apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
🧬 Code graph analysis (2)
apps/client/src/shared/components/sidebar/Sidebar.tsx (1)
apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx (1)
  • ProfilePopupPortal (13-34)
apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx (1)
apps/client/src/shared/components/profilePopup/ProfilePopup.tsx (1)
  • ProfilePopup (16-83)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: storybook
🔇 Additional comments (4)
apps/client/src/shared/components/profilePopup/ProfilePopup.tsx (2)

34-36: 코드 변경사항 승인

이펙트 내에서 조건부로 이벤트 리스너를 추가하는 로직을 중괄호로 감싼 포맷팅 변경입니다. 동작에는 영향이 없으며 가독성이 개선되었습니다.


71-71: 좋은 정리입니다

className 속성을 제거하여 불필요한 코드가 제거되었습니다.

apps/client/src/shared/components/sidebar/Sidebar.tsx (1)

25-25: Portal 전환이 올바르게 구현되었습니다

ProfilePopup에서 ProfilePopupPortal로의 전환이 정확하게 이루어졌습니다. 모든 필수 props가 올바르게 전달되고 있으며, Portal을 사용함으로써 z-index 스택 컨텍스트 문제를 방지할 수 있습니다.

Also applies to: 250-257

apps/client/src/shared/components/profilePopup/ProfilePopupPortal.tsx (1)

1-34: Portal 구현이 올바르게 작성되었습니다

React Portal을 사용하여 ProfilePopupdocument.body에 렌더링하는 표준 패턴이 정확하게 구현되었습니다. SSR 가드도 적절하게 추가되어 서버 사이드 렌더링 환경에서도 안전하게 동작합니다.

React 19.1.1과의 호환성도 확인되었습니다.

Copy link
Member

@constantly-dev constantly-dev left a comment

Choose a reason for hiding this comment

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

굿입니다~ 스프린트 작업 끝나면 12월 말중에 같이 모달 다시 개선해봅시다!

@jjangminii jjangminii merged commit bfab970 into develop Dec 22, 2025
11 checks passed
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.

[refactor] 레벨페이지 z인덱스 정리

3 participants