dashboard 양 옆 공백, 홈 버튼 수정#6
Conversation
📝 WalkthroughWalkthrough백오피스 대시보드 레이아웃에서 내부 패딩이 제거되었습니다. 사이드바는 “홈” 메뉴를 목록에 추가하고, 아이템 공통 onClick → path 매핑으로 라우팅을 일원화했습니다. 별도 홈 아이콘 클릭 로직을 제거했습니다. 런타임 로직 변경은 사이드바 클릭 처리 방식에 국한됩니다. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant SB as DashboardSidebar
participant R as Router
U->>SB: 클릭(메뉴 라벨)
SB->>SB: onMenuClick(라벨)
SB->>R: router.push(menuToPath[라벨]) (경로 존재 시)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/app/(backoffice)/backoffice/layout.tsx (1)
45-45: 메인 패딩 제거 의도 충족 — flex 컨텍스트에서는 min-w-0 추가 권장좌우 여백 제거 목적은 충족되었습니다. 다만 사이드바와 같은 flex 컨테이너 내에서 긴 제목/테이블이 포함될 때 수평 오버플로우를 방지하려면 메인 영역에 min-w-0을 부여하는 것이 안전합니다.
적용 제안(diff):
- <main className="bg-white flex-1 overflow-y-auto">{children}</main> + <main className="bg-white flex-1 overflow-y-auto min-w-0">{children}</main>src/components/backoffice/DashboardSidebar.tsx (1)
14-20: 레이블-경로의 이중 정의를 단일 소스로 통일 권장현재 menus 배열과 menuToPath 맵 모두에 레이블을 중복 정의하고 있어, 추후 레이블/경로 변경 시 불일치 위험이 있습니다. 단일 소스에서 파생하는 구조로 정리하는 것을 권장합니다.
간단한 방법 1: menuToPath에서 menus를 파생
// 권장: menuToPath를 단일 소스로 두고, 아래처럼 파생 const menuToPath: Record<string, string> = { "홈": "/backoffice/dashboard", "경매": "/backoffice/auction", "상품": "/backoffice/products", "고객": "/backoffice/customers", "권한": "/backoffice/roles", "설정": "/backoffice/settings", } const menus = Object.keys(menuToPath)대안 2: 객체 배열로 단일화(라벨 변경/번역시 안전, 안정적인 key 사용 가능)
const items = [ { id: "home", label: "홈", path: "/backoffice/dashboard" }, { id: "auction", label: "경매", path: "/backoffice/auction" }, { id: "products", label: "상품", path: "/backoffice/products" }, { id: "customers", label: "고객", path: "/backoffice/customers" }, { id: "roles", label: "권한", path: "/backoffice/roles" }, { id: "settings", label: "설정", path: "/backoffice/settings" }, ] as const {items.map(({ id, label, path }) => ( <div key={id} onClick={() => router.push(path)}> <span>{label}</span> </div> ))}참고로 레이블을 key로 사용하는 현재 구조는 i18n(번역) 도입 시 취약할 수 있으니, id 기반 key를 권장합니다.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
src/app/(backoffice)/backoffice/dashboard/page.tsx(1 hunks)src/app/(backoffice)/backoffice/layout.tsx(1 hunks)src/components/backoffice/DashboardSidebar.tsx(2 hunks)
🔇 Additional comments (3)
src/app/(backoffice)/backoffice/dashboard/page.tsx (1)
7-7: 대시보드 wrapper 좌우 패딩 제거 — OK상위 레이아웃의 패딩 제거와 일관적이며, 내부 섹션들이 자체 여백(ml-4, px-4 등)을 가지고 있어 가독성도 유지됩니다. 의도대로 좌우 공백이 사라지는 변경으로 보입니다.
src/components/backoffice/DashboardSidebar.tsx (2)
12-12: 메뉴에 ‘홈’ 추가 — 레이아웃의 기본 active 값(“홈”)과 일치, 내비게이션 동작 일관화레이아웃의 초기 상태와 맞물려 초기 활성 메뉴가 자연스럽게 표시됩니다. 기존 아이템과 동일한 처리 흐름으로 통합된 점도 좋습니다.
24-24: 의미 있는 코드 변화 없음빈 줄 변경으로 보이며 별도 조치 불필요합니다.
📌 변경 사항 개요
backoffice/dashboard 홈 버튼 색상 변경, UI 양 옆 공백 제거
Summary by CodeRabbit