Skip to content

Feat: 사이드 프로젝트 대시보드 위젯(내업무, 스프린트요약, 벨로시티, 백로그) api연결 - #57

Merged
Kwon812 merged 4 commits into
developfrom
feat/#54/side-project-dashboard-widget
Jul 15, 2026
Merged

Feat: 사이드 프로젝트 대시보드 위젯(내업무, 스프린트요약, 벨로시티, 백로그) api연결#57
Kwon812 merged 4 commits into
developfrom
feat/#54/side-project-dashboard-widget

Conversation

@Kwon812

@Kwon812 Kwon812 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Pull Request

작업 내용

  • 사이드 프로젝트 대시보드 위젯(스프린트 요약 · 백로그 · 벨로시티 · 내 업무)을 목 데이터에서 Supabase 실데이터로 전환
  • 내 업무 위젯을 팀플(team-project) 템플릿까지 함께 처리 — 같은 tasks 테이블을 워크스페이스 용도(purpose)로 분기해 side-project/team-project 각각의 "나에게 배정된" 업무를 표시
  • 위 두 가지를 지원하기 위해 위젯 렌더 컨텍스트(WidgetRenderContext) 타입을 확장하고, 그 값을 RSC → View → Grid → 위젯으로 전달하는 배선 추가

작업 결과

  • 스프린트 요약: 진행 중 스프린트를 데이터에서 판정(resolveCurrentSprint)해 배너/포인트 통계 표시
  • 백로그: 스프린트 미편입 업무를 실데이터로 조회해 표시
  • 벨로시티: 스프린트별 계획/완료 포인트를 막대로 표시, Y축 최댓값을 데이터에서 파생(selectVelocityMax)해 막대 잘림/납작함 방지
  • 내 업무: 로그인 사용자에게 배정된 업무만 필터링
  • side-project → 현재 스프린트에 편입된 내 업무(포인트/상태)
  • team-project → 워크스페이스 보드의 내 업무(마감일/상태)
  • 모든 위젯에 로딩 / 에러 / 빈 상태 처리 추가

변경 사항

Added

  • WidgetRenderContext 타입 확장 (src/shared/dashboard/model/widget.types.ts)
  • 기존: { workspaceId: string } 하나만 존재
  • 추가 필드 2개:
    • purpose: WorkspacePurpose — 같은 위젯 id라도 워크스페이스 용도(템플릿)에 따라 데이터 소스를 분기하기 위한 값. template.typesWorkspacePurpose(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.allgetCurrentUserId()와 병렬 조회하도록 변경하고, currentUserIdDashboardView에 prop으로 주입. (서버에서 이미 존재하는 getCurrentUserId() 재사용 → client 훅 신설/추가 라운드트립 없음)
  • DashboardView: currentUserId prop 추가 수신 후, 기존에 내려주던 workspaceId에 더해 purpose · currentUserIdDashboardGrid로 전달. (purpose는 이전엔 위젯 필터 용도로만 쓰고 Grid엔 안 내려주고 있었음)
  • DashboardGrid: purpose · currentUserId prop 추가 수신, 위젯 렌더 호출을 widget.render(size, { workspaceId })widget.render(size, { workspaceId, purpose, currentUserId })로 변경.
  • widget-catalog.tsx: my-tasks 렌더러가 purpose · currentUserId를 구조분해해 MyTasks에 전달. (실데이터 전환된 sprint-summary/velocity/backlog 렌더러에는 workspaceId 주입, 시그니처 정렬을 위해 미사용 인자는 _size로 표기)
  • SprintSummary: currentSprint(목) → useSprints + resolveCurrentSprint
  • Backlog: getMockBacklogTasksuseBacklogTasks
  • Velocity: mockSprintsuseSprints + selectVelocity, 상수 VELOCITY_MAX 의존 제거 후 selectVelocityMax로 축 스케일
  • MyTasks: getMockSprintTasks → 같은 tasks 테이블을 purpose로 분기
  • React 훅 규칙(조건부 호출 불가)을 지키기 위해 하나의 위젯에서 purpose서브컴포넌트를 분리, 각 서브컴포넌트가 자기 도메인 훅만 호출
  • side-project는 useSprintTasks, team-project는 useTasksByWorkspaceId를 사용하고 각각 assigneeId === currentUserId로 필터
  • 두 슬라이스의 TaskStatus 표기 차이(in_progress vs in-progress)를 각 서브컴포넌트가 자기 값으로 처리

Fixed

실행화면

스크린샷 2026-07-14 오후 5 27 08

테스트

  • 로컬 실행 확인
  • 주요 시나리오 확인 (side-project / team-project 각각 내 업무 위젯)
  • 영향 범위 확인

리뷰 체크리스트

  • PR base branch가 올바릅니다. (feature/* -> develop, 배포 시 develop 또는 release/* -> main)
  • 브랜치명이 Type/#issue-number/description 형식을 따릅니다.
  • 커밋 메시지가 컨벤션을 따릅니다.
  • 불필요한 console.log, 주석, 임시 코드를 제거했습니다.
  • 타입 에러와 린트 에러를 확인했습니다.
  • CodeRabbit 1차 리뷰를 확인했습니다.
  • CodeRabbit 리뷰 반영 후 Discord에 공유했습니다.
  • 최소 1명 이상의 approve 후 merge합니다.

리뷰 요청사항

  • WidgetRenderContext 확장 방식: 위젯 공통 컨텍스트에 purpose · currentUserId를 추가한 설계가 적절한지 (모든 위젯이 받는 값이라 범용성 vs 특정 위젯 전용 값이 섞이는 문제)
  • 내 업무 위젯의 purpose 분기 방식: 위젯 하나 안에서 SideMyTasks/TeamMyTasks 서브컴포넌트로 나눈 구조가 적절한지 (vs. 위젯 자체를 2개로 분리)

관련 이슈

Closes #54

Summary by CodeRabbit

  • 새 기능
    • 대시보드 위젯이 워크스페이스 목적과 로그인 사용자 정보를 기반으로 개인화되어 표시됩니다.
    • 스프린트 요약/내 작업/백로그/벨로시티 위젯이 실제 데이터 조회로 전환됩니다.
    • 위젯의 로딩·오류·빈 상태를 위한 공통 메시지 표시 UI가 도입됩니다.
  • 개선 사항
    • 벨로시티 차트의 축 최대값과 막대 높이가 데이터 범위에 맞게 자동 조정됩니다.
    • 내 작업 위젯은 프로젝트 유형에 따라 상태 카운트와 목록(마감일 등) 표시가 달라집니다.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5a4e0a31-8371-4799-bff4-89acf457f52c

📥 Commits

Reviewing files that changed from the base of the PR and between 295ee1d and 166be3f.

📒 Files selected for processing (6)
  • src/entities/task/index.ts
  • src/entities/task/model/task.types.ts
  • src/shared/dashboard/ui/widget-state-message.tsx
  • src/widgets/side-project/dashboard-backlog/ui/Backlog.tsx
  • src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx
  • src/widgets/side-project/dashboard-velocity/ui/Velocity.tsx

📝 Walkthrough

Walkthrough

대시보드가 현재 사용자 ID와 워크스페이스 용도를 위젯에 전달하도록 확장되었습니다. 스프린트 요약, velocity, 백로그, 사용자 업무 위젯은 워크스페이스 조회 결과와 로딩·오류·빈 상태 UI를 사용합니다.

Changes

대시보드 컨텍스트 전달

Layer / File(s) Summary
렌더 컨텍스트 및 위젯 연결
src/app/workspaces/.../dashboard/page.tsx, src/shared/dashboard/model/widget.types.ts, src/views/dashboard/...
getCurrentUserId와 대시보드 레이아웃을 병렬 조회하고, workspaceId, purpose, currentUserId를 위젯 렌더러에 전달합니다.

스프린트 위젯 데이터 연동

Layer / File(s) Summary
스프린트 요약 및 velocity 계산
src/entities/side-project/sprint/..., src/widgets/side-project/dashboard-sprint-summary/..., src/widgets/side-project/dashboard-velocity/...
스프린트 데이터를 조회해 현재 스프린트와 velocity 포인트를 계산하고, 동적 Y축 최대값 및 상태 메시지를 적용합니다.

백로그 위젯 데이터 연동

Layer / File(s) Summary
워크스페이스 백로그 조회
src/widgets/side-project/dashboard-backlog/ui/Backlog.tsx, src/shared/dashboard/ui/widget-state-message.tsx
workspaceId로 백로그 작업을 조회하고 로딩·오류·빈 상태를 공통 메시지 컴포넌트로 렌더링합니다.

사용자 업무 위젯 데이터 연동

Layer / File(s) Summary
purpose별 내 업무 조회 및 렌더링
src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx, src/entities/task/...
side-project와 team-project를 분기하고, 현재 사용자 업무를 필터링해 상태별 카운트와 업무 목록을 렌더링합니다.

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 기준 업무 필터링
Loading

Possibly related PRs

  • TeampleRun/syncly#18: 대시보드 레이아웃과 위젯 렌더링 컨텍스트의 기존 흐름과 직접 연결됩니다.
  • TeampleRun/syncly#44: sprint.selectors.ts의 velocity 선택자 확장과 직접 연결됩니다.
  • TeampleRun/syncly#52: 워크스페이스 업무 조회 훅과 현재 사용자 기준 필터링에 직접 연결됩니다.

Suggested reviewers: seongjinss555, wjswlgh96, 0011810

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 사이드 프로젝트 대시보드 위젯들의 API 연동이라는 핵심 변경을 잘 요약합니다.
Description check ✅ Passed 템플릿의 주요 섹션을 모두 포함하고 있으며 작업 내용, 결과, 변경 사항, 테스트, 리뷰 요청이 충분히 정리돼 있습니다.
Linked Issues check ✅ Passed 직접 링크된 #54의 스프린트 요약과 벨로시티 API 연동 요구를 충족하며 관련 추가 위젯 변경도 포함됩니다.
Out of Scope Changes check ✅ Passed 컨텍스트 전달과 내 업무/백로그/상태 메시지 변경은 모두 대시보드 위젯 API 연동을 지원하는 범위 안에 있습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#54/side-project-dashboard-widget

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

TeamMyTasksSideMyTasks의 sm/list/lg 렌더링 구조가 대부분 중복됩니다.

필드명(point vs dueDate)과 상태 매핑(TASK_STATUS vs TEAM_STATUS, in_progress vs in-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

📥 Commits

Reviewing files that changed from the base of the PR and between 01d1666 and 295ee1d.

📒 Files selected for processing (11)
  • src/app/workspaces/[workspaceId]/dashboard/page.tsx
  • src/entities/side-project/sprint/index.ts
  • src/entities/side-project/sprint/model/sprint.selectors.ts
  • src/shared/dashboard/model/widget.types.ts
  • src/views/dashboard/config/widget-catalog.tsx
  • src/views/dashboard/ui/DashboardGrid.tsx
  • src/views/dashboard/ui/DashboardView.tsx
  • src/widgets/side-project/dashboard-backlog/ui/Backlog.tsx
  • src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx
  • src/widgets/side-project/dashboard-sprint-summary/ui/SprintSummary.tsx
  • src/widgets/side-project/dashboard-velocity/ui/Velocity.tsx

Comment thread src/widgets/side-project/dashboard-backlog/ui/Backlog.tsx Outdated
Comment thread src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx Outdated
Comment thread src/widgets/side-project/dashboard-my-tasks/ui/MyTasks.tsx Outdated
Comment thread src/widgets/side-project/dashboard-velocity/ui/Velocity.tsx Outdated

@seongjinss555 seongjinss555 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다~

@Kwon812
Kwon812 merged commit 767cd25 into develop Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 사이드프로젝트 대시보드 위젯 api연동

2 participants