-
Notifications
You must be signed in to change notification settings - Fork 2
♻️Refactor: 헤더 및 대시보드 수정 페이지 리팩토링 #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. """ Walkthrough대시보드 및 관련 컴포넌트의 레이아웃, 반응형 스타일, 버튼 위치, 타입 일관성, 드롭다운 위치 계산, 내비게이션 조건부 렌더링, Tailwind 브레이크포인트 추가 등 UI/UX 개선을 위한 다양한 변경이 이루어졌습니다. 일부 API 호출 파라미터의 타입도 문자열에서 숫자로 통일되었습니다. Changes
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로 이동
Possibly related PRs
Suggested reviewers
Poem
""" 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
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📒 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 구조 개선으로 확장성 향상
classNameprop 추가와 기본값 처리 방식 개선이 좋습니다. 컴포넌트의 재사용성과 커스터마이징 가능성이 향상되었습니다.
40-66: 위치 계산 로직 개선이 우수함
useLayoutEffect사용과passive: true옵션 추가,fixed포지셔닝에 맞춘 좌표 계산 개선이 모두 적절합니다. 성능과 정확성이 모두 향상되었습니다.
94-121: Fixed 포지셔닝과 className 병합 구현이 적절함
position: 'fixed'변경으로 더 안정적인 드롭다운 위치 제공이 가능하며,className병합 로직도 올바르게 구현되었습니다. 인라인 toggle 함수 처리도 적절합니다.
tailwind.config.ts
Outdated
| screens: { | ||
| mobile: { max: '375px' }, // 0 ~ 375px | ||
| tablet: { raw: '(min-width: 376px) and (max-width: 744px)' }, // 376 ~ 1919px | ||
| 'mobile-sm': { max: '500px' }, // ✅ 0 ~ 500px |
There was a problem hiding this comment.
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.
| '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.
📌 변경 사항 개요
헤더 및 대시보드 수정 페이지 리팩토링
✨ 요약
헤더 및 대시보드 수정 페이지 리팩토링
📝 상세 내용
♻️ refactor:
🎨style:
🫧 modify: 대시보드 삭제 버튼 위치 조정
🔗 관련 이슈
🖼️ 스크린샷
✅ 체크리스트
💡 참고 사항
Summary by CodeRabbit
신규 기능
버그 수정
스타일/레이아웃
리팩터
문서화