Skip to content

Conversation

@yuj2n
Copy link
Contributor

@yuj2n yuj2n commented Jun 22, 2025

📌 변경 사항 개요

헤더 및 대시보드 수정 페이지 리팩토링

✨ 요약

헤더 및 대시보드 수정 페이지 리팩토링

📝 상세 내용

♻️ refactor:

  • 대시보드 삭제 후 mydashboard로 이동 및 삭제 후 사이드 바 쿼리 갱신하여 삭제 반영
  • 대시보드 수정 페이지 헤더 반응형 수정
  • 경로가 mydashboard인 경우 관리 및 초대하기 버튼 미표시
  • 드롭다운 위치 뷰포트 기준 위치 적용을 위한 position 수정

🎨style:

  • 초대하기 버튼 반응형에 따른 위치 변경 적용
  • 페이지네이션 컴포넌트 반응형에 따른 스타일 수정
  • 반응형에 따른 사용자 정보 스타일 수정
  • 헤더 왼쪽 제목 부분 내 대시보드 경로인 경우를 위한 스타일 수정
  • dashboardId 타입 number형으로 변환 및 그에 따른 수정
  • mobile-sm 사이즈 추가
  • 대시보드 수정 페이지 반응형 적용
  • 구성원 수정 컴포넌트 페이지네이션 버튼 사라지도록 스타일 수정

🫧 modify: 대시보드 삭제 버튼 위치 조정

🔗 관련 이슈

🖼️ 스크린샷

✅ 체크리스트

  • 브랜치 네이밍 컨벤션을 준수했습니다
  • 커밋 컨벤션을 준수했습니다
  • 코드가 프로젝트의 스타일 가이드라인을 준수합니다

💡 참고 사항

Summary by CodeRabbit

  • 신규 기능

    • 대시보드 편집 페이지에 "뒤로가기" 버튼과 반응형 레이아웃이 추가되었습니다.
    • Tailwind에 500px 이하를 위한 'mobile-sm' 반응형 브레이크포인트가 추가되었습니다.
  • 버그 수정

    • 드롭다운 메뉴의 위치와 동작이 더욱 안정적으로 개선되었습니다.
    • 대시보드 삭제 시 사이드바 목록이 자동 갱신되며, 삭제 후 이동 경로가 변경되었습니다.
  • 스타일/레이아웃

    • 여러 컴포넌트의 레이아웃과 여백이 반응형으로 개선되어 모바일, 태블릿, 데스크톱에서 더 깔끔하게 표시됩니다.
    • 사용자 닉네임이 모든 화면 크기에서 항상 표시됩니다.
    • 초대 및 멤버 관리 UI가 모바일 환경에서 더 편리하게 동작합니다.
  • 리팩터

    • 일부 내부 데이터 타입이 문자열에서 숫자로 변경되어 데이터 일관성이 향상되었습니다.
    • 헤더 내 네비게이션 및 타이틀 표시 조건이 명확하게 정리되었습니다.
  • 문서화

    • 일부 공개 함수 시그니처가 숫자 타입으로 변경되어 일관성이 개선되었습니다.

@yuj2n yuj2n added this to the 2차 구현 기간 milestone Jun 22, 2025
@yuj2n yuj2n self-assigned this Jun 22, 2025
@yuj2n yuj2n added 🎨Style UI, 스타일 관련 수정 💄Modify 자잘한 수정 ♻️Refactor 리팩토링 labels Jun 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 22, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

대시보드 및 관련 컴포넌트의 레이아웃, 반응형 스타일, 버튼 위치, 타입 일관성, 드롭다운 위치 계산, 내비게이션 조건부 렌더링, Tailwind 브레이크포인트 추가 등 UI/UX 개선을 위한 다양한 변경이 이루어졌습니다. 일부 API 호출 파라미터의 타입도 문자열에서 숫자로 통일되었습니다.

Changes

파일/그룹 변경 요약
src/app/dashboard/[id]/edit/page.tsx, src/app/dashboard/[id]/layout.tsx 대시보드 편집 페이지 및 레이아웃의 패딩, 마진, max-width 등 반응형 스타일 및 내비게이션 UI 개선
src/app/features/dashboard/components/edit/EditInvitation.tsx, EditMember.tsx, PaginationHeader.tsx 초대/멤버 관리 UI의 반응형 구조 개선, 버튼 위치 조정, 타입 일관성(문자열→숫자), children prop 제거 등
src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx 삭제 성공 시 쿼리 무효화 및 리다이렉트 경로 변경(/dashboard/mydashboard)
src/app/shared/components/common/Dropdown/Dropdown.tsx 드롭다운 위치 계산 개선, useLayoutEffect 사용, fixed 포지션 적용, className prop 확장
src/app/shared/components/common/UserInfo.tsx 닉네임이 항상 노출되도록 tablet 숨김 클래스 제거
src/app/shared/components/common/header/Collaborator/CollaboratorList.tsx, LeftHeaderContent.tsx, RightHeaderNav.tsx 멤버 조회 파라미터 타입 일관성, 헤더 타이틀/아이콘 표시 조건 개선, 마이다시보드에서 네비 아이템 숨김 처리
src/app/shared/hooks/useMembers.ts fetchMembers 함수 파라미터 타입을 string→number로 변경
tailwind.config.ts mobile-sm(max-width: 500px) 브레이크포인트 추가

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EditPage
  participant DeleteDashboardButton
  participant ReactQuery
  participant Router

  User->>EditPage: 대시보드 편집 페이지 접근
  User->>DeleteDashboardButton: 대시보드 삭제 클릭
  DeleteDashboardButton->>ReactQuery: 대시보드 삭제 요청
  ReactQuery-->>DeleteDashboardButton: 삭제 성공
  DeleteDashboardButton->>ReactQuery: ['dashboards'] 쿼리 무효화
  DeleteDashboardButton->>Router: /mydashboard로 이동
Loading

Possibly related PRs

  • CoPlay-FE/coplan#104: 대시보드 편집 페이지 레이아웃 및 반응형 스타일 조정과 직접 관련된 변경이 포함되어 있습니다.
  • CoPlay-FE/coplan#75: 대시보드 편집 페이지와 서브 컴포넌트의 초기 UI 구조와 관련된 PR로, 이번 변경의 기반이 되는 코드와 연관성이 높습니다.
  • CoPlay-FE/coplan#117: 대시보드 편집 페이지 레이아웃, 삭제 버튼 동작, 반응형 스타일 변경과 동일한 내용이 포함되어 있습니다.

Suggested reviewers

  • Insung-Jo
  • LeeCh0129

Poem

🐇
레이아웃이 넓어지고,
버튼이 제자리를 찾았네!
드롭다운은 똑똑하게,
닉네임은 언제나 반짝.
숫자로 맞춘 멤버 ID,
모바일도 환하게!
코끼리도 토끼도,
모두가 편해진 대시보드 🎉

"""

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.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-22T15_59_10_247Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c391e6 and a525766.

📒 Files selected for processing (1)
  • tailwind.config.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 1

🔭 Outside diff range comments (1)
src/app/features/dashboard/components/edit/PaginationHeader.tsx (1)

12-12: children prop 정의와 사용 간 불일치가 있습니다.

타입 정의에서는 children?: React.ReactNode가 여전히 존재하지만, 컴포넌트 매개변수에서는 제거되었습니다. 일관성을 위해 타입 정의에서도 제거해야 합니다:

 type PaginationHeaderProps = {
   currentPage: number
   totalPages: number
   title: string
   onPrev: () => void
   onNext: () => void
-  children?: React.ReactNode
 }

Also applies to: 21-21

🧹 Nitpick comments (3)
src/app/features/dashboard/components/edit/EditMember.tsx (1)

27-27: 타입 변환에 대한 에러 처리를 고려해보세요.

Number(dashboardId)가 유효하지 않은 값일 경우 NaN을 반환할 수 있습니다. 더 안전한 변환을 위해 다음과 같이 개선할 수 있습니다:

-  const dashboardIdNum = Number(dashboardId)
+  const dashboardIdNum = dashboardId ? Number(dashboardId) : 0

또는 타입 가드를 사용하여 유효성을 검증할 수도 있습니다.

src/app/shared/components/common/header/Collaborator/CollaboratorList.tsx (1)

15-15: 타입 변환 일관성이 좋습니다.

다른 컴포넌트들과 동일한 패턴으로 dashboardId를 숫자로 변환하여 일관성을 유지했습니다. 하지만 EditMember.tsx와 동일하게 Number() 변환 시 유효성 검증을 고려해보세요.

src/app/shared/components/common/header/LeftHeaderContent.tsx (1)

11-20: 경로 상수 분리를 통한 유지보수성 개선 권장

경로 기반 조건부 로직이 올바르게 구현되었습니다. 하지만 하드코딩된 경로 문자열을 상수로 분리하면 유지보수성이 향상됩니다.

+const PATHS = {
+  MYPAGE: '/mypage',
+  MY_DASHBOARD: '/mydashboard',
+} as const
+
-  const isMypage = pathname === '/mypage'
-  const isMyDashboard = pathname === '/mydashboard'
+  const isMypage = pathname === PATHS.MYPAGE
+  const isMyDashboard = pathname === PATHS.MY_DASHBOARD
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0e34b7 and 6c391e6.

📒 Files selected for processing (13)
  • src/app/dashboard/[id]/edit/page.tsx (1 hunks)
  • src/app/dashboard/[id]/layout.tsx (1 hunks)
  • src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx (3 hunks)
  • src/app/features/dashboard/components/edit/EditInvitation.tsx (1 hunks)
  • src/app/features/dashboard/components/edit/EditMember.tsx (4 hunks)
  • src/app/features/dashboard/components/edit/PaginationHeader.tsx (1 hunks)
  • src/app/shared/components/common/Dropdown/Dropdown.tsx (2 hunks)
  • src/app/shared/components/common/UserInfo.tsx (1 hunks)
  • src/app/shared/components/common/header/Collaborator/CollaboratorList.tsx (1 hunks)
  • src/app/shared/components/common/header/LeftHeaderContent.tsx (1 hunks)
  • src/app/shared/components/common/header/RightHeaderNav.tsx (1 hunks)
  • src/app/shared/hooks/useMembers.ts (1 hunks)
  • tailwind.config.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/app/features/dashboard/components/edit/EditMember.tsx (1)
src/app/shared/hooks/useMembers.ts (1)
  • fetchMembers (17-26)
src/app/shared/components/common/header/Collaborator/CollaboratorList.tsx (1)
src/app/shared/hooks/useMembers.ts (2)
  • Member (6-13)
  • fetchMembers (17-26)
src/app/features/dashboard/components/edit/EditInvitation.tsx (1)
src/app/features/dashboard/components/edit/PaginationHeader.tsx (1)
  • PaginationHeader (15-57)
🔇 Additional comments (25)
src/app/shared/hooks/useMembers.ts (1)

17-17: 다음 스크립트로 fetchMembers 호출 부분을 다시 검색해 주세요:

#!/bin/bash
# 모든 파일에서 fetchMembers 호출 검색
rg -Hn "fetchMembers\(" -A 3 .
src/app/shared/components/common/UserInfo.tsx (1)

25-25: 접근성 개선 승인

tablet:hidden 클래스를 제거하여 사용자 닉네임이 모든 화면 크기에서 표시되도록 한 것은 좋은 UX 개선사항입니다. 사용자 정보의 일관된 가시성을 보장합니다.

src/app/dashboard/[id]/layout.tsx (1)

13-13: 반응형 레이아웃 개선 승인

명시적인 픽셀 값 사용과 반응형 패딩 설정이 우수합니다. 트랜지션 효과 추가로 부드러운 사용자 경험을 제공하며, 다양한 화면 크기에서 적절한 간격을 유지합니다.

src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx (2)

6-6: React Query 훅 추가 승인

useQueryClient 훅을 적절히 추가하여 쿼리 캐시 관리 기능을 구현했습니다.

Also applies to: 20-20


32-35: 쿼리 무효화 및 리디렉션 개선 승인

대시보드 삭제 후 사이드바 쿼리를 무효화하고 /mydashboard로 리디렉션하는 것은 훌륭한 UX 개선사항입니다. 사용자가 삭제된 대시보드 목록을 즉시 확인할 수 있고, 일관된 내비게이션 경험을 제공합니다.

src/app/shared/components/common/header/RightHeaderNav.tsx (2)

5-5: usePathname 훅 추가가 적절합니다.

usePathname 훅을 사용하여 현재 경로를 감지하고 조건부 렌더링을 구현한 방식이 올바릅니다.

Also applies to: 12-14


18-33: 조건부 렌더링 로직이 올바르게 구현되었습니다.

/mydashboard 페이지에서 "관리"와 "초대하기" 버튼을 숨기는 로직이 PR 목표와 일치하며, 구현이 정확합니다.

src/app/features/dashboard/components/edit/EditMember.tsx (3)

36-38: 타입 일관성이 올바르게 적용되었습니다.

queryKey, queryFn, enabled 속성에서 dashboardIdNum을 일관되게 사용하여 타입 안전성을 확보했습니다.


58-58: mutation invalidation도 일관되게 업데이트되었습니다.

쿼리 무효화에서도 동일한 숫자 타입의 dashboardIdNum을 사용하여 일관성을 유지했습니다.


67-67: 반응형 디자인을 위한 overflow-x-auto 추가가 적절합니다.

overflow-x-auto 클래스 추가로 콘텐츠가 넘칠 때 가로 스크롤이 가능하도록 하여 반응형 디자인을 개선했습니다.

src/app/shared/components/common/header/Collaborator/CollaboratorList.tsx (1)

22-24: React Query 설정이 올바르게 업데이트되었습니다.

queryKey, queryFn, enabled 속성 모두에서 숫자 타입의 dashboardIdNum을 일관되게 사용했습니다.

src/app/features/dashboard/components/edit/PaginationHeader.tsx (2)

23-23: 레이아웃 개선이 적절합니다.

max-w-500 제약과 mb-20 마진 조정으로 반응형 디자인을 개선했습니다.


27-27: 마진 변경이 균형 잡힌 레이아웃을 제공합니다.

mr-16에서 mx-32로 변경하여 좌우 대칭적인 여백을 제공하는 것이 더 균형 잡힌 디자인입니다.

src/app/dashboard/[id]/edit/page.tsx (4)

17-17: 반응형 패딩이 적절하게 구현되었습니다.

화면 크기에 따라 점진적으로 증가하는 패딩(px-4 sm:px-8 md:px-16)으로 다양한 디바이스에서 일관된 사용자 경험을 제공합니다.


19-26: 돌아가기 버튼 추가로 사용자 경험이 개선되었습니다.

뒤로가기 기능과 명확한 시각적 피드백을 제공하는 버튼이 적절히 구현되었습니다.


29-29: 반응형 최대 너비 제약이 잘 구현되었습니다.

mobile-sm:max-w-full sm:max-w-[460px] md:max-w-[500px] 설정으로 다양한 화면 크기에서 적절한 콘텐츠 너비를 제공합니다.


36-36: 삭제 버튼 영역 스타일링이 간소화되고 개선되었습니다.

불필요한 정렬 및 패딩 클래스를 제거하고 반응형 최대 너비를 적용하여 더 깔끔한 레이아웃을 제공합니다.

src/app/shared/components/common/header/LeftHeaderContent.tsx (2)

24-24: UI 일관성을 위한 좋은 개선

항상 헤더 컨테이너를 렌더링하도록 변경한 것은 UI 일관성을 위한 좋은 개선입니다. title 계산 로직이 적절한 fallback을 제공합니다.


26-35: 크라운 아이콘 표시 로직 개선

크라운 아이콘 표시 조건을 단일 변수로 통합하여 가독성이 향상되었습니다. 조건부 렌더링 로직이 명확하고 적절합니다.

src/app/features/dashboard/components/edit/EditInvitation.tsx (2)

98-118: 반응형 레이아웃 구현이 우수함

데스크탑과 모바일에서의 레이아웃 차이를 적절히 처리했습니다. flex 방향 변경과 조건부 표시/숨김 로직이 올바르게 구현되었습니다.


120-138: 모바일 UX 개선을 위한 적절한 구현

모바일 화면에서의 접근성을 위해 추가된 초대 버튼이 적절히 배치되었습니다. type="button" 속성으로 의도치 않은 form 제출을 방지한 것도 좋습니다.

src/app/shared/components/common/Dropdown/Dropdown.tsx (4)

1-1: useLayoutEffect 사용이 적절함

드롭다운 위치 계산과 같은 레이아웃 관련 작업에는 useLayoutEffect가 더 적합합니다. 동기적 업데이트로 깜빡임을 방지할 수 있습니다.


5-25: Props 구조 개선으로 확장성 향상

className prop 추가와 기본값 처리 방식 개선이 좋습니다. 컴포넌트의 재사용성과 커스터마이징 가능성이 향상되었습니다.


40-66: 위치 계산 로직 개선이 우수함

useLayoutEffect 사용과 passive: true 옵션 추가, fixed 포지셔닝에 맞춘 좌표 계산 개선이 모두 적절합니다. 성능과 정확성이 모두 향상되었습니다.


94-121: Fixed 포지셔닝과 className 병합 구현이 적절함

position: 'fixed' 변경으로 더 안정적인 드롭다운 위치 제공이 가능하며, className 병합 로직도 올바르게 구현되었습니다. 인라인 toggle 함수 처리도 적절합니다.

screens: {
mobile: { max: '375px' }, // 0 ~ 375px
tablet: { raw: '(min-width: 376px) and (max-width: 744px)' }, // 376 ~ 1919px
'mobile-sm': { max: '500px' }, // ✅ 0 ~ 500px
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

브레이크포인트 중복과 이모지 사용 검토 필요

새로운 mobile-sm 브레이크포인트(0-500px)가 기존 mobile(0-375px) 및 mobile-wide(0-683px) 브레이크포인트와 중복됩니다. 이로 인해 스타일 충돌이 발생할 수 있습니다. 또한 프로덕션 코드에서 이모지(✅) 사용을 재고해보세요.

-        'mobile-sm': { max: '500px' }, // ✅ 0 ~ 500px
+        'mobile-sm': { max: '500px' }, // 0 ~ 500px
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'mobile-sm': { max: '500px' }, // 0 ~ 500px
'mobile-sm': { max: '500px' }, // 0 ~ 500px
🤖 Prompt for AI Agents
In tailwind.config.ts at line 22, the new 'mobile-sm' breakpoint (0-500px)
overlaps with existing 'mobile' (0-375px) and 'mobile-wide' (0-683px)
breakpoints, which can cause style conflicts. Review and adjust or remove the
overlapping breakpoint to ensure distinct ranges. Also, remove the emoji from
the comment to keep production code clean.

@yuj2n yuj2n merged commit d0b11ee into develop Jun 22, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jun 23, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💄Modify 자잘한 수정 ♻️Refactor 리팩토링 🎨Style UI, 스타일 관련 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants