Skip to content

[Feature/#296] 타임라인 성과 패널 차트 일/주/월 기간 연동 - #301

Merged
jjjsun merged 11 commits into
developfrom
feature/#296
Jul 15, 2026
Merged

[Feature/#296] 타임라인 성과 패널 차트 일/주/월 기간 연동 #301
jjjsun merged 11 commits into
developfrom
feature/#296

Conversation

@jjjsun

@jjjsun jjjsun commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

Closed #296

✨ 변경사항

  • 🐞 BugFix Something isn't working
  • 💻 CrossBrowsing Browser compatibility
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (storybook, jest, etc.)

✏️ 작업 내용

  • 성과 패널 TimelinePeriodSelector (일/주/월 + 이전/다음)와 일별 변화 추이 차트 연동
  • CHART_PERIOD_LABELS mock 제거후, resolveVisiblePeriod 기반으로 실제 기간 라벨 표시 되도록 구현
  • sliceDailyTrendByPeriodviewUnitperiodIndex에 맞춰서 dailyTrend slice (타임라인 기간과 교집합)
  • 선택 구간 날짜를 fillDailyTrendRange로 채우고, 없는 날은 null 처리해서 가짜 0 방지하도록 구현완료
  • x축을 category 축으로 변경해서 날짜 라벨 중복 제거
  • DAY 단일 점 마커 표시되도록 수정
  • Y축과 차트간의 간격 조정

💻 작업 화면

image image image

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

차트 기간 변화할때 KPI도 같이 수정하는 또다른 아이디어가 있는데, 이부분은 추가 사항이라 다른 기능구현 완료하고, 추가로 기능구현 가능할때 논의한번 해보면 좋을것같아요!

💬 리뷰어 가이드 (P-Rules)
P1: 필수 반영 (Critical) - 버그 가능성, 컨벤션 위반. 해결 전 머지 불가.
P2: 적극 권장 (Recommended) - 더 나은 대안 제시. 가급적 반영 권장.
P3: 제안 (Suggestion) - 아이디어 공유. 반영 여부는 드라이버 자율.
P4: 단순 확인/칭찬 (Nit) - 사소한 오타, 칭찬 등 피드백.

Summary by CodeRabbit

Summary by CodeRabbit

  • 개선 사항
    • 일별 추이 차트가 선택한 표시 기간 기준으로 범위를 정확히 반영합니다.
    • 기간 내 누락 날짜를 자동으로 보강해 추세가 끊기지 않고 더 선명하게 보입니다.
    • 데이터가 1건이어도 마커가 표시되며, 데이터가 없을 땐 안내가 노출됩니다.
    • 클릭·전환·노출 및 ROAS가 선택 기간에 맞춰 집계됩니다.
    • 차트 축 라벨/툴팁 포맷이 정돈되고, 범위 선택에 따른 이전/다음 이동 상태가 반영됩니다.
    • 주간 표기가 “이번 주”로 표시되는 경우가 개선되었습니다.

@jjjsun
jjjsun requested review from Seojegyeong and YermIm July 13, 2026 14:43
@jjjsun jjjsun self-assigned this Jul 13, 2026
@jjjsun jjjsun added the ✨ Feature 기능 개발 label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jjjsun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e6406bb3-43d7-47ce-985a-bbe5c108ec23

📥 Commits

Reviewing files that changed from the base of the PR and between 4469081 and 2d0bbba.

📒 Files selected for processing (1)
  • src/utils/timeline/period.ts
📝 Walkthrough

Walkthrough

타임라인 성과 패널이 선택한 일·주·월 기간에 맞춰 일별 트렌드를 슬라이스하고, 누락 날짜를 보정한 카테고리 차트와 기간 라벨을 표시하도록 변경됐다. metric 집계 로직도 공통 유틸리티로 통합됐다.

Changes

타임라인 일별 추이

Layer / File(s) Summary
기간 계산과 일별 데이터 처리
src/utils/timeline/sliceDailyTrendByPeriod.ts, src/utils/timeline/aggregateTimelineMetric.ts, src/utils/timeline/fillDailyTrendRange.ts, src/utils/timeline/buildTimelineSummaryPanel.ts, src/utils/timeline/period.ts
표시 단위와 기간 인덱스로 기간을 계산·클램프하고, metric별 집계와 누락 날짜 행 생성을 추가했다. 기간 라벨 형식도 조정했다.
카테고리 차트 시리즈와 옵션 변환
src/utils/timeline/buildTimelineChartSeries.ts, src/components/timeline/charts/TimelineDailyTrendChart.tsx, src/components/timeline/charts/timelineDailyTrendChart.config.ts
일별 데이터를 카테고리와 숫자·null 시리즈로 변환하며, 카테고리 축·툴팁·단일 포인트 마커 옵션을 구성한다.
성과 패널과 기간 선택 연결
src/components/timeline/TimelinePerformancePanel.tsx, src/components/timeline/TimelinePeriodSelector.tsx
기간 선택 상태와 이동 경계를 관리하고, 슬라이스 결과와 이전·다음 버튼 비활성화 상태를 차트 및 선택기에 연결한다.

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 반환
Loading

Possibly related PRs

Suggested reviewers: yermim, seojegyeong

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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 제목이 타임라인 성과 패널의 일/주/월 기간 연동이라는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 관련 이슈, 변경사항, 작업 내용, 미완성 작업, 참고 사항과 스크린샷까지 대부분의 템플릿 항목을 잘 채웠습니다.
Linked Issues check ✅ Passed 기간 슬라이스, 실제 라벨 계산, 차트 시리즈 갱신, 주/월 집계 규칙이 모두 구현되어 이슈 #296 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 기간 라벨 정리와 주간 표기 통일 등은 목표 범위 안의 보조 변경으로 보이며 명확한 범위 외 변경은 보이지 않습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/#296

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.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

항목 링크
📖 Storybook https://69a147b60a56365d9e2185ef-kuwssbmgdm.chromatic.com/
🔍 Chromatic https://www.chromatic.com/build?appId=69a147b60a56365d9e2185ef&number=421

@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.

🧹 Nitpick comments (1)
src/utils/timeline/sliceDailyTrendByPeriod.ts (1)

30-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

getClampedPeriodIsoRangesliceDailyTrendByPeriod와 동일한 교집합 계산을 중복 수행합니다.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a0ef752 and 3889cb5.

📒 Files selected for processing (8)
  • src/components/timeline/TimelinePerformancePanel.tsx
  • src/components/timeline/charts/TimelineDailyTrendChart.tsx
  • src/components/timeline/charts/timelineDailyTrendChart.config.ts
  • src/utils/timeline/aggregateTimelineMetric.ts
  • src/utils/timeline/buildTimelineChartSeries.ts
  • src/utils/timeline/buildTimelineSummaryPanel.ts
  • src/utils/timeline/fillDailyTrendRange.ts
  • src/utils/timeline/sliceDailyTrendByPeriod.ts

@YermIm

YermIm commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

P2: 메인 타임라인과 패널의 기간 표시가 달라서 맞추면 좋을 것 같습니다!

  1. 메인 타임라인·성과 패널 모두 기간이 영어(6 July - 12 July)이고, 일/월만 한글입니다. 기간 표기를 한 형식으로 통일하면 좋을 것 같아요.

  2. 일별 변화 추이 필터에서 이번 주 라벨이 오늘로 나옵니다. 이번 주 또는 실제 기간 표시가 더 자연스러울 것 같습니다.

  3. 일별 변화 추이에서 타임라인의 시작일보다 과거로도 이동됩니다. 데이터가 없는 구간이 반복되니, 타임라인 기간 밖이면 이전 화살표를 disable해도 좋을 것 같아요.

@YermIm

YermIm commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

추가로 필터에서 데이터가 없는 날짜로 이동하면, 기간은 바뀌는데 차트에서는 이전 날짜가 그대로 남는 것처럼 보입니다. 데이터가 비어도 날짜가 갱신되어야 할 것 같아요!

@jjjsun
jjjsun merged commit 54e97a9 into develop Jul 15, 2026
3 checks passed
@jjjsun
jjjsun deleted the feature/#296 branch July 15, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [Feature] 타임라인 성과 패널 일/주/월 기간 연동

2 participants