Feat: 사이드 프로젝트 대시보드 위젯(내업무, 스프린트요약, 벨로시티, 백로그) api연결 - #57
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthrough대시보드가 현재 사용자 ID와 워크스페이스 용도를 위젯에 전달하도록 확장되었습니다. 스프린트 요약, velocity, 백로그, 사용자 업무 위젯은 워크스페이스 조회 결과와 로딩·오류·빈 상태 UI를 사용합니다. Changes대시보드 컨텍스트 전달
스프린트 위젯 데이터 연동
백로그 위젯 데이터 연동
사용자 업무 위젯 데이터 연동
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant DashboardPage
participant DashboardView
participant DashboardGrid
participant SprintWidgets
participant TaskWidgets
DashboardPage->>DashboardPage: 대시보드 레이아웃과 currentUserId 조회
DashboardPage->>DashboardView: workspaceId, purpose, currentUserId 전달
DashboardView->>DashboardGrid: 위젯 컨텍스트 전달
DashboardGrid->>SprintWidgets: workspaceId로 스프린트 조회
DashboardGrid->>TaskWidgets: workspaceId와 currentUserId로 업무 조회
SprintWidgets->>SprintWidgets: velocity 및 현재 스프린트 계산
TaskWidgets->>TaskWidgets: currentUserId 기준 업무 필터링
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx (1)
154-231: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift
TeamMyTasks와SideMyTasks의 sm/list/lg 렌더링 구조가 대부분 중복됩니다.필드명(
pointvsdueDate)과 상태 매핑(TASK_STATUSvsTEAM_STATUS,in_progressvsin-progress)만 다를 뿐, 카드 레이아웃·카운트 표시·리스트 렌더링 구조가 거의 동일합니다. 두 도메인이 다르다는 주석(6-7행)은 훅 분기의 필요성은 설명하지만 JSX 렌더 로직 중복까지 정당화하지는 않습니다. 아이템 렌더 함수를 매개변수화하는 공통 컴포넌트로 추출하면 두 브랜치가 어긋날 위험을 줄일 수 있습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx` around lines 154 - 231, Extract the duplicated sm/list/lg card rendering shared by TeamMyTasks and SideMyTasks into a parameterized common component or item-render helper. Keep each branch’s data hook and domain-specific mappings configurable, including point versus dueDate, TASK_STATUS versus TEAM_STATUS, and in_progress versus in-progress, then have both components reuse the shared layout while preserving their existing messages and counts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/widgets/side-project/dashboard-backlog/ui/Backlog.tsx`:
- Around line 15-24: Backlog.tsx의 StateMessage 중복 구현을 제거하고, Velocity.tsx와
MyTasks.tsx에서 사용하는 공통 StateMessage 컴포넌트를 재사용하도록 import 및 렌더링을 정리하세요. 기존 message
전달 동작은 유지하고 위젯별 별도 정의는 남기지 마세요.
In `@src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx`:
- Around line 141-152: Move the TeamStatusStyle definition and TEAM_STATUS
constant from MyTasks into the team-task entities module at `@/entities/task`,
then import and reuse TEAM_STATUS in MyTasks. Preserve the existing
TeamTaskStatus mapping and styling values so other team-project widgets can
share the same entity-level constant.
- Around line 23-32: Remove the duplicated StateMessage implementation from
MyTasks.tsx and reuse the consolidated shared StateMessage component already
intended for Backlog.tsx and Velocity.tsx. Update the import or reference while
preserving the existing message rendering and WidgetCard layout.
In `@src/widgets/side-project/dashboard-sprint-summary/ui/SprintSummary.tsx`:
- Around line 15-21: 중복 정의된 StateMessage를 SprintSummary.tsx에서 제거하고,
Backlog.tsx·Velocity.tsx·MyTasks.tsx와 함께 재사용할 수 있도록 src/shared의 공용 UI 컴포넌트로
추출하세요. 각 위젯이 새 shared StateMessage를 import하도록 변경하되, WidgetCard 래핑 여부와 기존 메시지 표시
동작은 유지하세요.
In `@src/widgets/side-project/dashboard-velocity/ui/Velocity.tsx`:
- Around line 15-24: Velocity.tsx의 StateMessage 중복 구현을 제거하고 Backlog.tsx 및
MyTasks.tsx와 공유되는 공통 StateMessage 컴포넌트를 재사용하도록 변경하세요. 기존 WidgetCard, header, 메시지
표시 동작은 유지하고, 공통 컴포넌트의 import 경로를 연결하세요.
---
Outside diff comments:
In `@src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx`:
- Around line 154-231: Extract the duplicated sm/list/lg card rendering shared
by TeamMyTasks and SideMyTasks into a parameterized common component or
item-render helper. Keep each branch’s data hook and domain-specific mappings
configurable, including point versus dueDate, TASK_STATUS versus TEAM_STATUS,
and in_progress versus in-progress, then have both components reuse the shared
layout while preserving their existing messages and counts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7dc750f3-54f4-450d-bd31-3b413773f8ee
📒 Files selected for processing (11)
src/app/workspaces/[workspaceId]/dashboard/page.tsxsrc/entities/side-project/sprint/index.tssrc/entities/side-project/sprint/model/sprint.selectors.tssrc/shared/dashboard/model/widget.types.tssrc/views/dashboard/config/widget-catalog.tsxsrc/views/dashboard/ui/DashboardGrid.tsxsrc/views/dashboard/ui/DashboardView.tsxsrc/widgets/side-project/dashboard-backlog/ui/Backlog.tsxsrc/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsxsrc/widgets/side-project/dashboard-sprint-summary/ui/SprintSummary.tsxsrc/widgets/side-project/dashboard-velocity/ui/Velocity.tsx
Pull Request
작업 내용
tasks테이블을 워크스페이스 용도(purpose)로 분기해 side-project/team-project 각각의 "나에게 배정된" 업무를 표시WidgetRenderContext) 타입을 확장하고, 그 값을 RSC → View → Grid → 위젯으로 전달하는 배선 추가작업 결과
resolveCurrentSprint)해 배너/포인트 통계 표시selectVelocityMax)해 막대 잘림/납작함 방지변경 사항
Added
WidgetRenderContext타입 확장 (src/shared/dashboard/model/widget.types.ts){ workspaceId: string }하나만 존재purpose: WorkspacePurpose— 같은 위젯 id라도 워크스페이스 용도(템플릿)에 따라 데이터 소스를 분기하기 위한 값.template.types의WorkspacePurpose(side-project | team-project | store-operation)를 재사용해 타입 안정성 확보.currentUserId: string— "내 업무"처럼 로그인 사용자 본인 기준 필터가 필요한 위젯에 전달하기 위한 값.WidgetDefinition.render(size, context)의 두 번째 인자로, 카탈로그의 모든 위젯 렌더러가 공통으로 받는 값입니다. 필드 추가는 **가산적(additive)**이라 기존에{ workspaceId }만 구조분해하던 렌더러는 그대로 동작합니다.selectVelocityMax(points)셀렉터 — 벨로시티 Y축 최댓값을 실데이터에서 파생SideMyTasks/TeamMyTasks서브컴포넌트 분기Changed
purpose·currentUserId가 실제 위젯까지 흐르도록 각 레이어를 연결dashboard/page.tsx(RSC): 기존getDashboardLayout만 호출하던 것을Promise.all로getCurrentUserId()와 병렬 조회하도록 변경하고,currentUserId를DashboardView에 prop으로 주입. (서버에서 이미 존재하는getCurrentUserId()재사용 → client 훅 신설/추가 라운드트립 없음)DashboardView:currentUserIdprop 추가 수신 후, 기존에 내려주던workspaceId에 더해purpose·currentUserId를DashboardGrid로 전달. (purpose는 이전엔 위젯 필터 용도로만 쓰고 Grid엔 안 내려주고 있었음)DashboardGrid:purpose·currentUserIdprop 추가 수신, 위젯 렌더 호출을widget.render(size, { workspaceId })→widget.render(size, { workspaceId, purpose, currentUserId })로 변경.widget-catalog.tsx:my-tasks렌더러가purpose·currentUserId를 구조분해해MyTasks에 전달. (실데이터 전환된sprint-summary/velocity/backlog렌더러에는workspaceId주입, 시그니처 정렬을 위해 미사용 인자는_size로 표기)currentSprint(목) →useSprints+resolveCurrentSprintgetMockBacklogTasks→useBacklogTasksmockSprints→useSprints+selectVelocity, 상수VELOCITY_MAX의존 제거 후selectVelocityMax로 축 스케일getMockSprintTasks→ 같은tasks테이블을purpose로 분기purpose로 서브컴포넌트를 분리, 각 서브컴포넌트가 자기 도메인 훅만 호출useSprintTasks, team-project는useTasksByWorkspaceId를 사용하고 각각assigneeId === currentUserId로 필터TaskStatus표기 차이(in_progressvsin-progress)를 각 서브컴포넌트가 자기 값으로 처리Fixed
실행화면
테스트
리뷰 체크리스트
feature/*->develop, 배포 시develop또는release/*->main)Type/#issue-number/description형식을 따릅니다.console.log, 주석, 임시 코드를 제거했습니다.리뷰 요청사항
WidgetRenderContext확장 방식: 위젯 공통 컨텍스트에purpose·currentUserId를 추가한 설계가 적절한지 (모든 위젯이 받는 값이라 범용성 vs 특정 위젯 전용 값이 섞이는 문제)purpose분기 방식: 위젯 하나 안에서SideMyTasks/TeamMyTasks서브컴포넌트로 나눈 구조가 적절한지 (vs. 위젯 자체를 2개로 분리)관련 이슈
Closes #54
Summary by CodeRabbit