Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough사이드바에서 카테고리 생성 항목의 표시 로직을 변경했다. 카테고리 최대 개수(10)를 도입하고, 현재 개수를 계산해 최대치 미만일 때만 생성 버튼을 렌더링한다. 외부 인터페이스 변경은 없으며 onClick 동작은 그대로 유지된다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as 사용자
participant SB as Sidebar
participant CL as CategoryList
participant UI as UI(Render)
User->>SB: 사이드바 열기
SB->>CL: 카테고리 목록 조회
CL-->>SB: categories (N개)
SB->>SB: categoryCount = N, canCreateMore = N < 10
alt canCreateMore = true
SB->>UI: 목록 + "CreateItem" 렌더
else canCreateMore = false
SB->>UI: 목록만 렌더(생성 버튼 숨김)
end
Note over UI: onClick 핸들러는 기존과 동일
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
|
✅ Storybook chromatic 배포 확인: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/client/src/shared/components/sidebar/Sidebar.tsx (1)
169-176: 한도 도달 시 버튼 숨김만으로는 피드백 부족 — 안내/비활성 상태 제공 제안생성 버튼이 사라지면 사용자가 이유를 알기 어렵습니다. 안내 문구(aria‑live 포함)나 비활성 상태 표시를 함께 제공하면 UX/a11y가 좋아집니다.
- {canCreateMore && ( - <CreateItem - onClick={() => { - setToastIsOpen(false); - openCreate(); - }} - /> - )} + {canCreateMore ? ( + <CreateItem + onClick={() => { + setToastIsOpen(false); + openCreate(); + }} + /> + ) : ( + <li + className="px-[0.8rem] py-[0.8rem] text-gray-500 body4-r" + aria-live="polite" + > + 카테고리는 최대 {MAX_CATEGORIES}개까지 생성할 수 있어요 + </li> + )}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/client/src/shared/components/sidebar/Sidebar.tsx(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-17T09:18:13.818Z
Learnt from: constantly-dev
PR: Pinback-Team/pinback-client#102
File: apps/extension/src/components/modalPop/ModalPop.tsx:166-172
Timestamp: 2025-07-17T09:18:13.818Z
Learning: In apps/extension/src/components/modalPop/ModalPop.tsx, the categories array should include "안 읽은 정보" (Unread Information) as the first default category that cannot be deleted. This default category is used consistently across the client-side dashboard and should be protected from deletion in the extension as well.
Applied to files:
apps/client/src/shared/components/sidebar/Sidebar.tsx
🧬 Code graph analysis (1)
apps/client/src/shared/components/sidebar/Sidebar.tsx (1)
apps/client/src/shared/components/sidebar/CreateItem.tsx (1)
CreateItem(9-27)
🔇 Additional comments (1)
apps/client/src/shared/components/sidebar/Sidebar.tsx (1)
116-118: 기본 카테고리 포함 시 off-by-one 가능성 — 한도 계산 검증/보정 필요파일: apps/client/src/shared/components/sidebar/Sidebar.tsx — 현재 MAX_CATEGORIES(=10)를 전체 categories.length로 비교하고 있어, 삭제 불가 기본 카테고리(예: "안 읽은 정보")가 포함되면 사용자가 생성할 수 있는 카테고리 수가 실질적으로 10보다 작아질 수 있음.
- 조치(우선): 사용자 생성 카테고리만 세도록 변경. 서버 스키마에 isDefault/is_system 등 플래그가 있으면 해당 필드로 필터링하고, 없으면 이름 비교('안 읽은 정보')를 임시 fallback으로 사용.
- 권장: MAX_CATEGORIES를 모듈 상단(또는 공용 상수 파일)으로 호이스팅해 재선언 방지.
제안 diff:
- const MAX_CATEGORIES = 10; - const categoryCount = categories?.categories?.length ?? 0; - const canCreateMore = categoryCount < MAX_CATEGORIES; + const MAX_CATEGORIES = 10; // 사용자 생성 가능 개수 기준 + const allCategories = categories?.categories ?? []; + const userCategories = allCategories.filter( + (c) => !('isDefault' in c && (c as any).isDefault) && c.name !== '안 읽은 정보' + ); + const canCreateMore = userCategories.length < MAX_CATEGORIES;참고: rg 검색이 일부 실패하여 repository 전반에서 isDefault 필드나 '안 읽은 정보' 하드코딩 존재 여부는 아직 확정되지 않음 — 서버 응답 타입 또는 categories 타입 정의 확인 필요.
📌 Related Issues
📄 Tasks
⭐ PR Point (To Reviewer)
📷 Screenshot
Summary by CodeRabbit