Skip to content

[Feature/#228] AI 요약하기 API 연동#235

Merged
Seojegyeong merged 8 commits into
developfrom
feature/#228
May 27, 2026
Merged

[Feature/#228] AI 요약하기 API 연동#235
Seojegyeong merged 8 commits into
developfrom
feature/#228

Conversation

@Seojegyeong
Copy link
Copy Markdown
Collaborator

@Seojegyeong Seojegyeong commented May 26, 2026

🚨 관련 이슈

#228

✨ 변경사항

  • 🐞 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.)

✏️ 작업 내용

  1. AI 요약 API 연동

    • POST /api/ai/organizations/{orgId}/analysis 요청 → accessToken 발급
    • GET /api/ai/reports/{accessToken} 폴링으로 PENDING/SUCCESS/FAILED 처리
  2. AI 요약 UI/UX 개선

    • 카드 “펼치기”로 분석 요청 트리거, 로딩/에러/재시도 문구 일관화
    • 로딩 중 접은 경우 완료 후 자동 재확장 방지
    • 카드에 분석 기준 기간 표시, “오늘” 표현 제거 -> 기간 기반 표현으로 수정
  3. 분석 기간

    • AI 분석 기본 기간을 통합 대시보드 ROAS 동일 구간 내 말일 기준 최근 30일(한 달)로 설정
  4. PDF 저장/인쇄

    • 플랫폼별 PDF 문서 제목 메타 적용
  5. 플랫폼 타입/표기 통일

    • 대시보드/AI 플랫폼 식별자는 provider.ts로 통일(TProviderType, TAiAnalysisProvider, PROVIDER_TYPES)
    • UI 표기/차트 색상도 provider.ts로 이동
    • 중복 리스트(PLATFORM_PROVIDERS) 제거 → PROVIDER_TYPES만 사용

파일구조

src/
├─ api/
│  └─ dashboard/
│     └─ aiAnalysis.ts                      # AI 분석 요청(POST) + 결과 조회(폴링 GET)
│
├─ components/
│  └─ dashboard/
│       ├─ ai-report/
│       ├─ components/
│       │  ├─ DashboardAiSummarySection.tsx       # provider별 AI 요약 섹션
│       │  └─ AiSummaryCard.tsx                              # AI 요약 카드 UI
│       ├─ utils/
│       │  └─ aiReport.utils.ts              # AI 결과 → PDF 문서 모델 변환 + 텍스트 포맷 유틸
│       └─ print/
│          ├─ AiSummaryPrintReport.tsx       # 인쇄/PDF용 마크업
│          ├─ downloadAiSummaryPdf.ts       # iframe 인쇄 호출(PDF 저장)
│          └─ printAssets.ts                             # 인쇄용 로고/테마 스타일 생성
│   
│
├─ constants/
│  └─ dashboard/
│     └─ overviewMetricsRange.ts             # ROAS 기준 구간 + AI 분석 기본 기간(구간 내 최근 30일)
│
├─ hooks/
│  └─ dashboard/
│     └─ useAiAnalysisReport.ts              # POST→token→GET 폴링
│
├─ styles/
│  └─ aiReport.print.css                     # AI 요약 PDF/인쇄 전용 스타일
│
└─ types/
   └─ dashboard/
      ├─ provider.ts                          # 플랫폼 코드/타입 단일 출처 + UI 표기/차트 색 매핑
      ├─ aiAnalysis.ts                       # AI 분석 요청/응답 타입 + 상태(PENDING/SUCCESS/FAILED)
      ├─ overview.ts                         # 대시보드 공통 타입
      └─ platform.ts                         # 플랫폼 대시보드 API 응답 타입들

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

  • 기간은 클라이언트가 startDate와 endDate를 전달합니다. 현재 데이터 존재가 확실한 ROAS 구간 내 30일로 임시 적용했습니다.
  • 대시보드/AI 플랫폼 식별자(대문자 코드)와 ads 도메인의 소문자 UI 플랫폼(TPlatform)은 성격이 달라 유지. (대시보드는 TProviderType + PLATFORM_MAP 조합으로 통일함)
  • 공유하기 기능 제거로 AI 리포트 공유 API(PATCH /api/ai/reports/{accessToken}/share)는 기능 범위에서 제외

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

Summary by CodeRabbit

릴리스 노트

  • New Features

    • AI 기반 광고 성과 분석 기능 추가 (요청 및 리포트 조회)
    • 통합/플랫폼별 AI 분석 요약 카드 통합
  • Improvements

    • AI 분석 카드의 로딩/에러/빈 상태 처리 개선
    • 플랫폼 지원 변경: Kakao 제거, Meta 추가
    • 인쇄 리포트 포맷 최적화
  • Refactor

    • 플랫폼 타입 정의 표준화 및 공유 상수 기반으로 통일

@Seojegyeong Seojegyeong linked an issue May 26, 2026 that may be closed by this pull request
3 tasks
@Seojegyeong Seojegyeong self-assigned this May 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Warning

Review limit reached

@Seojegyeong, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 49 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 98c1907c-700f-42c3-9b94-c85bde6ebb68

📥 Commits

Reviewing files that changed from the base of the PR and between 5ec1645 and 271b844.

📒 Files selected for processing (6)
  • src/api/dashboard/aiAnalysis.ts
  • src/components/dashboard/platform/PlatformTrafficChart.tsx
  • src/components/dashboard/platform/SinglePlatformView.tsx
  • src/hooks/dashboard/useAiAnalysisReport.ts
  • src/styles/tokens.css
  • src/types/dashboard/provider.ts
📝 Walkthrough

Walkthrough

백엔드 AI 분석 API와 통합하는 새로운 타입 시스템 및 폴링 훅을 추가하고, AiSummaryCard를 실제 데이터 기반으로 재구성하며, 플랫폼 타입을 모든 대시보드 컴포넌트에서 일관되게 사용하도록 정렬합니다. 총 30개 파일에서 500줄 이상이 추가되어 AI 분석 기능과 플랫폼 타입 시스템이 통합됩니다.

Changes

AI 광고 성과 분석 기능

Layer / File(s) Summary
플랫폼 타입 시스템 기초
src/types/dashboard/provider.ts, src/types/dashboard/overview.ts, src/types/dashboard/platform.ts
새 provider.ts 모듈에 PROVIDER_TYPES 상수 기반 TProviderType을 정의하고, AI 분석용 TAiAnalysisProvider("ALL" 포함), PLATFORM_MAP/PLATFORM_CHART_COLORS 매핑을 중앙화합니다. 기존 분산된 정의를 통합하여 overview.ts/platform.ts의 타입 임포트를 정렬합니다.
AI 분석 API 및 데이터 타입
src/types/dashboard/aiAnalysis.ts, src/api/dashboard/aiAnalysis.ts
분석 요청/응답 타입(IAnalysisRequest, IAnalysisResponse, IReportStatusResponse)을 정의하고, requestAiAnalysis() 및 getAiReportByAccessToken() API 래퍼를 구현하여 백엔드 엔드포인트와 통신합니다.
AI 분석 날짜 범위 상수
src/constants/dashboard/overviewMetricsRange.ts
통합 대시보드 기본 날짜 구간(OVERVIEW_DAILY_METRICS_RANGE)과 AI 분석 30일 조회 범위 계산(getAiAnalysisDateRange), 기간 라벨 포맷팅(formatAiAnalysisPeriodLabel)을 제공합니다.
AI 분석 상태 관리 및 폴링 훅
src/hooks/dashboard/useAiAnalysisReport.ts
useAiAnalysisReport 훅은 분석 요청, 상태 폴링, 에러 처리를 통합 관리합니다. 요청 성공 시 accessToken을 받아 즉시 PENDING 상태를 폴링하고, 최대 대기 시간 초과 시 폴링을 중단하며, 다양한 실패 시나리오에서 적절한 에러 메시지를 반환합니다.
AiSummaryCard 재구성 및 출력 유틸
src/components/dashboard/ai-report/components/AiSummaryCard.tsx, src/components/dashboard/ai-report/utils/aiReport.utils.ts, src/components/dashboard/ai-report/print/AiSummaryPrintReport.tsx
AiSummaryCard를 IAiReportResponse 기반 정적 설정에서 IAnalysisResponse 기반 동적 로딩으로 전환하고, 로딩/에러/빈 상태별 렌더링을 추가합니다. toAiReportPrintDocument는 IAnalysisResponse 필드를 직접 매핑하여 PDF 문서를 작성합니다.
DashboardAiSummarySection 래퍼 컴포넌트
src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx
useAiAnalysisReport 훅과 AiSummaryCard를 연결하는 래퍼로, provider별 제목 생성, onExpand/onRetry 콜백 구현, 기간 라벨 표시를 담당합니다.
OverviewDashboard 및 타입 정리
src/pages/dashboard/overview/OverviewDashboard.tsx, src/pages/dashboard/overview/mock/aiReport.mock.ts, src/types/dashboard/aiReport.ts
OverviewDashboard에서 mock 데이터 기반 AiSummaryCard를 DashboardAiSummarySection(provider="ALL")으로 교체하고, 관련 mock과 타입 정의를 제거합니다.

플랫폼 타입 및 컴포넌트 정렬

Layer / File(s) Summary
플랫폼 조회 훅 타입 통합
src/hooks/dashboard/usePlatformMetrics.ts, src/hooks/dashboard/usePlatformBudget.ts, src/hooks/dashboard/usePlatformMetricFacts.ts, src/hooks/dashboard/useOverviewRoasRankings.ts, src/hooks/dashboard/usePlatformPerformance.ts
usePlatformMetrics/Budget/MetricFacts의 provider 파라미터 타입을 TPlatformProvider에서 TProviderType으로 변경하고, 런타임 캐스팅을 제거합니다. useOverviewRoasRankings와 usePlatformPerformance의 PROVIDERS를 PROVIDER_TYPES 기반으로 교체하고, 날짜 범위를 OVERVIEW_DAILY_METRICS_RANGE 상수로 통일합니다.
차트 및 테이블 컴포넌트 PLATFORM_MAP 정렬
src/components/dashboard/charts/PerformanceEfficiencyChart.tsx, src/components/dashboard/platform/AllPlatformTrafficChart.tsx, src/components/dashboard/platform/AllPlatformView.tsx, src/components/dashboard/platform/PlatformRoasTable.tsx, src/components/dashboard/platform/PlatformDetailCard.tsx, src/components/dashboard/platform/TopPerformanceList.tsx
import 경로를 @/types/dashboard/platform에서 @/types/dashboard/provider로 변경합니다. AllPlatformTrafficChart/View에서 하드코딩된 플랫폼 배열을 제거하고 PROVIDER_TYPES 순회 기반으로 PLATFORM_MAP/PLATFORM_CHART_COLORS를 사용합니다. PlatformRoasTable은 toProviderType 정규화와 PLATFORM_MAP 기반 표시명 조회를 도입하며, 폴백 로고 배지를 추가합니다.
SinglePlatformView 및 PlatformDashboard 리팩토링
src/components/dashboard/platform/SinglePlatformView.tsx, src/pages/dashboard/platform/PlatformDashboard.tsx
SinglePlatformView의 platform prop 타입을 string에서 TProviderType으로 좁혀 런타임 변환을 제거하고, DashboardAiSummarySection을 하단에 추가합니다. PlatformDashboard는 selectedPlatform을 TPlatformView로 타입화하고, 드롭다운을 PROVIDER_TYPES 기반으로 동적 생성하며, selectedPlatformLabel으로 헤더를 정렬합니다.
OverviewCampaignSnapshotCard 제공자 표시명
src/pages/dashboard/overview/sections/OverviewCampaignSnapshotCard.tsx
PLATFORM_MAP과 PROVIDER_TYPES를 @/types/dashboard/provider에서 import하고, providerDisplayName 계산 시 PROVIDER_TYPES 검증을 추가합니다.
랜딩 페이지 플랫폼 변경
src/components/landing/GuidePlatform.tsx, src/components/landing/LandingFeatures.tsx
GuidePlatform에서 KakaoWordmark를 제거하고 kakao 플랫폼 항목을 삭제합니다. LandingFeatures에서 KakaoLogo를 MetaLogo로 교체합니다.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • WhereYouAd/WhereYouAd-Frontend#228: 이 PR의 변경사항이 해당 이슈에서 요구한 AI 분석 API 통합(POST /api/ai/organizations/{orgId}/analysis, GET /api/ai/reports/{accessToken}), 관련 훅, mock 데이터 제거를 정확히 구현합니다.

Possibly related PRs

  • WhereYouAd/WhereYouAd-Frontend#158: PerformanceEfficiencyChart.tsx에서 PLATFORM_MAP import 소스 변경이 동일 컴포넌트의 플랫폼 대시보드 차트 작업과 직접 겹칩니다.
  • WhereYouAd/WhereYouAd-Frontend#175: SinglePlatformView.tsx의 platform prop 타입 변경 및 DashboardAiSummarySection 추가가 해당 PR의 SinglePlatformView/PlatformDashboard UI 리팩토링 작업과 직접 연결됩니다.
  • WhereYouAd/WhereYouAd-Frontend#215: SinglePlatformView/usePlatformMetrics/usePlatformBudget의 TProviderType 타입 통일 작업이 해당 PR의 플랫폼 대시보드 API 연결 작업과 동일 컴포넌트/훅에서 겹칩니다.

Suggested labels

✨ Feature, 📬 API, 🔨 Refactor

Suggested reviewers

  • YermIm
  • jjjsun
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% 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 PR 제목 '[Feature/#228] AI 요약하기 API 연동'은 변경사항의 주요 내용(AI 분석 API 연동)을 명확하고 간결하게 전달합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR 설명이 필요한 모든 섹션을 포함하고 있으며, 변경사항 유형, 관련 이슈, 작업 내용, 파일 구조 및 논의사항이 명확하게 기재되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/#228

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 and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

📚 Storybook 배포 완료

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/components/dashboard/platform/SinglePlatformView.tsx (1)

28-35: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

PLATFORM_LOGOSTProviderType 기준으로 강타입화해 주세요

지금 Record<string, ...>라서 provider 누락이 컴파일 타임에 잡히지 않습니다. platform이 이미 TProviderType이므로 동일 타입으로 맞추는 게 안전합니다.

수정 예시
-const PLATFORM_LOGOS: Record<
-  string,
-  { component: React.FC<React.SVGProps<SVGSVGElement>>; className: string }
-> = {
+const PLATFORM_LOGOS: Record<
+  TProviderType,
+  { component: React.FC<React.SVGProps<SVGSVGElement>>; className: string }
+> = {
   GOOGLE: { component: GoogleLogo, className: "h-10" },
   NAVER: { component: NaverLogo, className: "h-6 ml-2" },
   META: { component: MetaLogo, className: "h-6 ml-2" },
 };

Also applies to: 86-86

🤖 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/components/dashboard/platform/SinglePlatformView.tsx` around lines 28 -
35, PLATFORM_LOGOS is typed as Record<string,...> which hides missing providers;
change its type to Record<TProviderType, { component:
React.FC<React.SVGProps<SVGSVGElement>>; className: string }> by importing/using
TProviderType and replacing the Record<string,...> declaration in the
PLATFORM_LOGOS definition, then ensure the object includes an entry for every
TProviderType key (or switch to Partial<Record<TProviderType,...>> if some
providers are intentionally omitted); apply the same type change to the other
similar declaration referenced around the second occurrence (line ~86) so both
are strongly typed against TProviderType.
🧹 Nitpick comments (2)
src/hooks/dashboard/usePlatformMetricFacts.ts (1)

56-63: ⚡ Quick win

TProviderType 타입 출처를 provider.ts로 통일해 주세요.

이 훅만 @/types/dashboard/overviewTProviderType을 사용하면 타입 정의가 분기될 수 있습니다. 다른 대시보드 코드와 동일하게 @/types/dashboard/provider를 단일 출처로 맞추는 게 안전합니다.

🔧 제안 코드
-import type { TProviderType } from "`@/types/dashboard/overview`";
+import type { TProviderType } from "`@/types/dashboard/provider`";
🤖 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/hooks/dashboard/usePlatformMetricFacts.ts` around lines 56 - 63, The hook
usePlatformMetricFacts currently imports/uses TProviderType from a different
module; change its TProviderType import to match the rest of the dashboard code
by using the single source "`@/types/dashboard/provider`". Update the import in
src/hooks/dashboard/usePlatformMetricFacts.ts so the function
usePlatformMetricFacts and any type annotations referencing TProviderType point
to "`@/types/dashboard/provider`" instead of "`@/types/dashboard/overview`",
ensuring the provider type is unified across the dashboard codebase.
src/components/dashboard/ai-report/components/AiSummaryCard.tsx (1)

138-140: 💤 Low value

"—" 매직 스트링 비교 대신 명시적인 빈 배열 체크 권장

formatNumberedList가 반환하는 "—" 문자열과 직접 비교하는 방식은 유틸 함수 구현이 변경될 경우 깨질 수 있어요. data.cautionPoint를 직접 체크하는 방식이 더 안전합니다.

♻️ 제안하는 수정
-const cautionList = formatNumberedList(data.cautionPoint);
-const cautionContent =
-  cautionList === "—" ? "특별히 주의가 필요한 항목이 없습니다." : cautionList;
+const hasCautionItems = data.cautionPoint?.length > 0;
+const cautionContent = hasCautionItems
+  ? formatNumberedList(data.cautionPoint)
+  : "특별히 주의가 필요한 항목이 없습니다.";
🤖 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/components/dashboard/ai-report/components/AiSummaryCard.tsx` around lines
138 - 140, 현재 cautionContent가 formatNumberedList의 반환값과 매직 스트링 "—"를 비교하는 방식으로 빈
상태를 판별하고 있어 유틸 구현 변경 시 깨질 수 있습니다; 대신 data.cautionPoint 존재 여부와 배열 길이로 빈 배열을 체크하고,
비어있지 않을 때에만 formatNumberedList(data.cautionPoint)를 호출하여
cautionList/cautionContent를 설정하도록 변경하세요 (참조: formatNumberedList, cautionList,
cautionContent, data.cautionPoint).
🤖 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/api/dashboard/aiAnalysis.ts`:
- Around line 26-31: The getAiReportByAccessToken function injects accessToken
directly into the request path which can break if the token contains
URL-reserved characters; wrap the accessToken with encodeURIComponent before
building the URL passed to axiosInstance.get (the call in
getAiReportByAccessToken that requests `/api/ai/reports/${accessToken}`) so the
path parameter is safely encoded and the IReportStatusResponse retrieval
succeeds.

In `@src/components/dashboard/platform/SinglePlatformView.tsx`:
- Line 118: platformColor is set to a hardcoded hex fallback and
PLATFORM_THEME_COLORS uses hex values, violating theme-token rules; replace
direct hex usage by mapping platforms to theme tokens or token-based CSS class
names and ensure SinglePlatformView uses those tokens (e.g., use token keys from
tokens.css instead of "`#1877f2`", update PLATFORM_THEME_COLORS to return token
strings or class names, and change any chart option consumers of platformColor
to resolve the CSS token/class at render time so all chart colors come from
`@theme` tokens).

In `@src/constants/dashboard/overviewMetricsRange.ts`:
- Around line 2-5: The constant OVERVIEW_DAILY_METRICS_RANGE is hardcoded
causing stale queries; replace the static export with a runtime-calculated value
or injectable provider (e.g., export a function getOverviewDailyMetricsRange or
a factory) that computes startDate/endDate relative to current date (or reads a
server-provided range/ENV) and returns the same shape as the constant so callers
(ROAS/AI summary code) continue to work unchanged; update any imports to call
the function or use the injected value instead of relying on the compile-time
const.

In `@src/hooks/dashboard/useAiAnalysisReport.ts`:
- Around line 132-136: In the orgId missing branch inside useAiAnalysisReport
(the block that currently checks `if (!orgId) { setWorkspaceErrorShown(true);
toast.error(WORKSPACE_REQUIRED_MESSAGE); return; }`), call the hook's `reset()`
function first to clear previous `reportData`/`accessToken` state, then set
`setWorkspaceErrorShown(true)` and show the toast before returning; this ensures
stale analysis state is cleared when no workspace is selected.

In `@src/types/dashboard/provider.ts`:
- Around line 16-20: PLATFORM_CHART_COLORS currently contains hardcoded HEX
values; replace each hex with the corresponding `@theme` token from tokens.css
(use the theme token string values for GOOGLE, NAVER, META) so the
Record<TProviderType,string> maps to theme tokens instead of arbitrary colors;
update PLATFORM_CHART_COLORS in src/types/dashboard/provider.ts to reference the
exact `@theme` token names from tokens.css for each provider (preserve the object
shape and type, e.g., PLATFORM_CHART_COLORS.GOOGLE ->
"<`@theme-token-for-google`>") and ensure any consumer code expecting strings
still receives the token string.

---

Outside diff comments:
In `@src/components/dashboard/platform/SinglePlatformView.tsx`:
- Around line 28-35: PLATFORM_LOGOS is typed as Record<string,...> which hides
missing providers; change its type to Record<TProviderType, { component:
React.FC<React.SVGProps<SVGSVGElement>>; className: string }> by importing/using
TProviderType and replacing the Record<string,...> declaration in the
PLATFORM_LOGOS definition, then ensure the object includes an entry for every
TProviderType key (or switch to Partial<Record<TProviderType,...>> if some
providers are intentionally omitted); apply the same type change to the other
similar declaration referenced around the second occurrence (line ~86) so both
are strongly typed against TProviderType.

---

Nitpick comments:
In `@src/components/dashboard/ai-report/components/AiSummaryCard.tsx`:
- Around line 138-140: 현재 cautionContent가 formatNumberedList의 반환값과 매직 스트링 "—"를
비교하는 방식으로 빈 상태를 판별하고 있어 유틸 구현 변경 시 깨질 수 있습니다; 대신 data.cautionPoint 존재 여부와 배열 길이로
빈 배열을 체크하고, 비어있지 않을 때에만 formatNumberedList(data.cautionPoint)를 호출하여
cautionList/cautionContent를 설정하도록 변경하세요 (참조: formatNumberedList, cautionList,
cautionContent, data.cautionPoint).

In `@src/hooks/dashboard/usePlatformMetricFacts.ts`:
- Around line 56-63: The hook usePlatformMetricFacts currently imports/uses
TProviderType from a different module; change its TProviderType import to match
the rest of the dashboard code by using the single source
"`@/types/dashboard/provider`". Update the import in
src/hooks/dashboard/usePlatformMetricFacts.ts so the function
usePlatformMetricFacts and any type annotations referencing TProviderType point
to "`@/types/dashboard/provider`" instead of "`@/types/dashboard/overview`",
ensuring the provider type is unified across the dashboard codebase.
🪄 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: CHILL

Plan: Pro

Run ID: 04df15a2-bc7d-4a30-ab83-c41dee65f4f8

📥 Commits

Reviewing files that changed from the base of the PR and between d4d7b94 and 5ec1645.

📒 Files selected for processing (30)
  • src/api/dashboard/aiAnalysis.ts
  • src/components/dashboard/ai-report/components/AiSummaryCard.tsx
  • src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx
  • src/components/dashboard/ai-report/print/AiSummaryPrintReport.tsx
  • src/components/dashboard/ai-report/utils/aiReport.utils.ts
  • src/components/dashboard/charts/PerformanceEfficiencyChart.tsx
  • src/components/dashboard/platform/AllPlatformTrafficChart.tsx
  • src/components/dashboard/platform/AllPlatformView.tsx
  • src/components/dashboard/platform/PlatformDetailCard.tsx
  • src/components/dashboard/platform/PlatformRoasTable.tsx
  • src/components/dashboard/platform/SinglePlatformView.tsx
  • src/components/dashboard/platform/TopPerformanceList.tsx
  • src/components/landing/GuidePlatform.tsx
  • src/components/landing/LandingFeatures.tsx
  • src/constants/dashboard/overviewMetricsRange.ts
  • src/hooks/dashboard/useAiAnalysisReport.ts
  • src/hooks/dashboard/useOverviewRoasRankings.ts
  • src/hooks/dashboard/usePlatformBudget.ts
  • src/hooks/dashboard/usePlatformMetricFacts.ts
  • src/hooks/dashboard/usePlatformMetrics.ts
  • src/hooks/dashboard/usePlatformPerformance.ts
  • src/pages/dashboard/overview/OverviewDashboard.tsx
  • src/pages/dashboard/overview/mock/aiReport.mock.ts
  • src/pages/dashboard/overview/sections/OverviewCampaignSnapshotCard.tsx
  • src/pages/dashboard/platform/PlatformDashboard.tsx
  • src/types/dashboard/aiAnalysis.ts
  • src/types/dashboard/aiReport.ts
  • src/types/dashboard/overview.ts
  • src/types/dashboard/platform.ts
  • src/types/dashboard/provider.ts
💤 Files with no reviewable changes (4)
  • src/pages/dashboard/overview/mock/aiReport.mock.ts
  • src/types/dashboard/aiReport.ts
  • src/components/dashboard/ai-report/print/AiSummaryPrintReport.tsx
  • src/components/landing/GuidePlatform.tsx

Comment thread src/api/dashboard/aiAnalysis.ts Outdated
Comment thread src/components/dashboard/platform/SinglePlatformView.tsx Outdated
Comment thread src/constants/dashboard/overviewMetricsRange.ts
Comment thread src/hooks/dashboard/useAiAnalysisReport.ts
Comment thread src/types/dashboard/provider.ts
@Seojegyeong Seojegyeong added ✨ Feature 기능 개발 📬 API 서버 API 통신 labels May 26, 2026
@Seojegyeong Seojegyeong requested review from YermIm and jjjsun May 26, 2026 03:46
Copy link
Copy Markdown
Collaborator

@jjjsun jjjsun left a comment

Choose a reason for hiding this comment

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

P4: 확인했습니다!

Copy link
Copy Markdown
Collaborator

@YermIm YermIm left a comment

Choose a reason for hiding this comment

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

P4: 확인했습니다!!

@Seojegyeong Seojegyeong merged commit 3116933 into develop May 27, 2026
3 checks passed
@Seojegyeong Seojegyeong deleted the feature/#228 branch May 27, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API 서버 API 통신 ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [Feature] 통합 대시보드 - AI 요약하기 API 연동

3 participants