[Feature/#296] 타임라인 성과 패널 차트 일/주/월 기간 연동 - #301
Conversation
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough타임라인 성과 패널이 선택한 일·주·월 기간에 맞춰 일별 트렌드를 슬라이스하고, 누락 날짜를 보정한 카테고리 차트와 기간 라벨을 표시하도록 변경됐다. metric 집계 로직도 공통 유틸리티로 통합됐다. Changes타임라인 일별 추이
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant TimelinePeriodSelector
participant TimelinePerformancePanel
participant sliceDailyTrendByPeriod
participant TimelineDailyTrendChart
participant buildTimelineChartSeries
TimelinePeriodSelector->>TimelinePerformancePanel: 기간 단위 또는 기간 이동 선택
TimelinePerformancePanel->>sliceDailyTrendByPeriod: viewUnit, periodIndex, dailyTrend 전달
sliceDailyTrendByPeriod-->>TimelinePerformancePanel: periodLabel, slicedTrend, rangeStart, rangeEnd 반환
TimelinePerformancePanel->>TimelineDailyTrendChart: 선택 기간 데이터 전달
TimelineDailyTrendChart->>buildTimelineChartSeries: filledRows와 metric 전달
buildTimelineChartSeries-->>TimelineDailyTrendChart: categories와 series 반환
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/timeline/sliceDailyTrendByPeriod.ts (1)
30-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
getClampedPeriodIsoRange가sliceDailyTrendByPeriod와 동일한 교집합 계산을 중복 수행합니다.
resolveVisiblePeriod+clampRangeToTimeline호출이 두 함수에서 그대로 반복됩니다. 이후 교집합 규칙이 바뀌면 한쪽만 수정하고 다른 쪽을 놓치는 드리프트 위험이 있습니다.sliceDailyTrendByPeriod가 반환하는visiblePeriod/클램프 결과를 재사용하거나, 공통 내부 헬퍼로 추출하는 편이 안전합니다.♻️ 리팩터링 제안
-export function getClampedPeriodIsoRange( - params: ISliceDailyTrendByPeriodParams, -): { startIso: string; endIso: string } | null { - const visible = resolveVisiblePeriod( - params.viewUnit, - params.periodIndex, - params.today, - ); - const clamped = clampRangeToTimeline( - visible, - params.timelineStartDate, - params.timelineEndDate, - ); - if (!clamped) return null; - return { - startIso: toIsoDate(clamped.start), - endIso: toIsoDate(clamped.end), - }; -} +export function getClampedPeriodIsoRange( + params: ISliceDailyTrendByPeriodParams, +): { startIso: string; endIso: string } | null { + const { visiblePeriod, rangeStart, rangeEnd } = sliceDailyTrendByPeriod(params); + const clamped = clampRangeToTimeline( + visiblePeriod, + params.timelineStartDate, + params.timelineEndDate, + ); + if (!clamped || !rangeStart || !rangeEnd) return null; + return { startIso: toIsoDate(clamped.start), endIso: toIsoDate(clamped.end) }; +}As per path instructions,
src/**는 "구조와 책임 분리" 관점에서 리뷰가 필요합니다.Also applies to: 98-116
🤖 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/utils/timeline/sliceDailyTrendByPeriod.ts` around lines 30 - 50, Remove the duplicated intersection calculation between getClampedPeriodIsoRange and sliceDailyTrendByPeriod by extracting the shared resolveVisiblePeriod and clampRangeToTimeline flow into one internal helper, or by reusing sliceDailyTrendByPeriod’s computed visible/clamped result. Update both callers to use that single source of truth while preserving the existing null and range behavior.Source: Path instructions
🤖 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.
Nitpick comments:
In `@src/utils/timeline/sliceDailyTrendByPeriod.ts`:
- Around line 30-50: Remove the duplicated intersection calculation between
getClampedPeriodIsoRange and sliceDailyTrendByPeriod by extracting the shared
resolveVisiblePeriod and clampRangeToTimeline flow into one internal helper, or
by reusing sliceDailyTrendByPeriod’s computed visible/clamped result. Update
both callers to use that single source of truth while preserving the existing
null and range behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3814fcce-eac0-440a-8ada-d218086b393a
📒 Files selected for processing (8)
src/components/timeline/TimelinePerformancePanel.tsxsrc/components/timeline/charts/TimelineDailyTrendChart.tsxsrc/components/timeline/charts/timelineDailyTrendChart.config.tssrc/utils/timeline/aggregateTimelineMetric.tssrc/utils/timeline/buildTimelineChartSeries.tssrc/utils/timeline/buildTimelineSummaryPanel.tssrc/utils/timeline/fillDailyTrendRange.tssrc/utils/timeline/sliceDailyTrendByPeriod.ts
|
P2: 메인 타임라인과 패널의 기간 표시가 달라서 맞추면 좋을 것 같습니다!
|
|
추가로 |
🚨 관련 이슈
Closed #296
✨ 변경사항
✏️ 작업 내용
TimelinePeriodSelector(일/주/월 + 이전/다음)와 일별 변화 추이 차트 연동CHART_PERIOD_LABELSmock 제거후,resolveVisiblePeriod기반으로 실제 기간 라벨 표시 되도록 구현sliceDailyTrendByPeriod로viewUnit과periodIndex에 맞춰서dailyTrendslice (타임라인 기간과 교집합)fillDailyTrendRange로 채우고, 없는 날은 null 처리해서 가짜 0 방지하도록 구현완료💻 작업 화면
😅 미완성 작업
N/A
📢 논의 사항 및 참고 사항
차트 기간 변화할때 KPI도 같이 수정하는 또다른 아이디어가 있는데, 이부분은 추가 사항이라 다른 기능구현 완료하고, 추가로 기능구현 가능할때 논의한번 해보면 좋을것같아요!
Summary by CodeRabbit
Summary by CodeRabbit