Skip to content

[Refactor/#208] 대시보드 - 플랫폼 변경(KAKAO -> META) - #217

Merged
Seojegyeong merged 2 commits into
developfrom
refactor/#208
May 16, 2026
Merged

Seojegyeong merged 2 commits into
developfrom
refactor/#208

Conversation

@Seojegyeong

@Seojegyeong Seojegyeong commented May 16, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

#208

✨ 변경사항

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

✏️ 작업 내용

  • 통합 대시보드 플랫폼 비교 카드 내 카카오 제거 후 메타로 변경

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

N/A

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

Summary by CodeRabbit

변경사항

  • 새로운 기능
    • 지원하는 광고 플랫폼을 Kakao에서 Meta로 변경했습니다.
    • ROAS 대시보드에서 Meta 플랫폼의 성과 지표를 조회하고 분석할 수 있습니다.

Review Change Stack

@Seojegyeong Seojegyeong linked an issue May 16, 2026 that may be closed by this pull request
@Seojegyeong Seojegyeong self-assigned this May 16, 2026
@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
where-you-ad Ready Ready Preview, Comment May 16, 2026 9:32am

@Seojegyeong
Seojegyeong requested review from YermIm and jjjsun May 16, 2026 09:25
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

이 PR은 광고 대시보드에서 지원하는 광고 플랫폼을 Kakao에서 Meta로 교체하는 변경입니다. 타입 정의, 데이터 조회 훅, UI 컴포넌트 전반에 걸쳐 일관되게 provider 상수와 매핑을 업데이트합니다.

Changes

Kakao에서 Meta로의 플랫폼 교체

Layer / File(s) Summary
제공자 타입 정의
src/types/dashboard/overview.ts
TProviderType 유니온에서 KAKAO를 제거하고 META를 추가하여, 전체 시스템의 타입 계약을 업데이트합니다.
ROAS 랭킹 조회 및 메트릭 매핑
src/hooks/dashboard/useOverviewRoasRankings.ts
PROVIDERS 배열을 [GOOGLE, NAVER, KAKAO]에서 [GOOGLE, NAVER, META]로 변경하고, 병렬 API 조회와 메트릭맵 구성 로직을 함께 업데이트합니다.
PlatformRoasTable 로고 및 표시명 매핑
src/components/dashboard/platform/PlatformRoasTable.tsx
Meta 로고 컴포넌트를 임포트하고, platformLogoMapproviderDisplayMap의 매핑을 Kakao에서 Meta로 교체합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • WhereYouAd/WhereYouAd-Frontend#214: 이 PR의 타입, 훅, UI 컴포넌트 변경(KAKAO→META 교체)이 해당 플랫폼 교체 요구사항을 직접 구현합니다.

Possibly related PRs

  • WhereYouAd/WhereYouAd-Frontend#204: 두 PR 모두 ROAS 관련 제공자 타입과 useOverviewRoasRankings 로직을 다루므로 직접적인 연관이 있습니다.
  • WhereYouAd/WhereYouAd-Frontend#129: 이 PR의 ROAS 랭킹 흐름(PROVIDERS 리스트, TProviderType, PlatformRoasTable 매핑)은 해당 PR에서 도입된 것과 동일한 영역을 업데이트합니다.
  • WhereYouAd/WhereYouAd-Frontend#96: 양쪽 PR 모두 PlatformRoasTable의 플랫폼/로고 매핑 로직을 수정하므로 코드 레벨에서 겹칩니다.

Suggested labels

🔨 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 0.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
Description check ✅ Passed PR 설명에 관련 이슈(#208), 변경 유형(Refactor 체크), 작업 내용이 명시되어 있습니다. 템플릿의 필수 항목들이 충분히 작성되었습니다.
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.
Title check ✅ Passed PR 제목이 변경의 핵심을 명확하게 반영하고 있습니다. 플랫폼 변경(KAKAO -> META)이라는 주요 내용을 간결하게 표현했으며, 제목만으로도 이 PR의 목적을 쉽게 파악할 수 있습니다.

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

✨ 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 refactor/#208

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.

@Seojegyeong Seojegyeong added the 🔨 Refactor 코드 리팩토링 label May 16, 2026
@github-actions

github-actions Bot commented May 16, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

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

@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: 2

🧹 Nitpick comments (1)
src/components/dashboard/platform/PlatformRoasTable.tsx (1)

11-15: ⚡ Quick win

로고 매핑은 표시명 말고 provider 코드 기준으로 묶는 게 안전해요.

지금 구조는 displayName 문자열이 바뀌면(Meta메타 같은 i18n) 로고 키 매칭이 같이 깨질 수 있습니다. GOOGLE | NAVER | META 코드 기준으로 바로 매핑하면 안정성이 올라갑니다.

제안 diff
+import type { TProviderType } from "`@/types/dashboard/overview`";
 import type { IPlatformRankingItem } from "`@/types/dashboard/overview`";

-const platformLogoMap = {
-  Google: <GoogleLogo className="h-7 w-auto" />,
+const platformLogoMap: Record<TProviderType, JSX.Element> = {
+  GOOGLE: <GoogleLogo className="h-7 w-auto" />,
   NAVER: <NaverLogo className="h-7 w-auto" />,
-  Meta: <MetaLogo className="h-7 w-auto" />,
+  META: <MetaLogo className="h-7 w-auto" />,
 };
-
-type TPlatformName = keyof typeof platformLogoMap;

 const providerDisplayMap: Record<string, string> = {
   GOOGLE: "Google",
   NAVER: "NAVER",
   META: "Meta",
 };

 function getPlatformLogo(provider: string) {
-  const name = getDisplayName(provider);
-  if (name in platformLogoMap) {
-    return platformLogoMap[name as TPlatformName];
+  const normalized = provider.toUpperCase() as TProviderType;
+  if (normalized in platformLogoMap) {
+    return platformLogoMap[normalized];
   }
+  const name = getDisplayName(provider);
   return (
     <span className="flex h-7 w-7 items-center justify-center rounded-full bg-surface-300 font-caption text-text-muted">
       {name[0]}
     </span>
   );
 }

As per coding guidelines, src/**에서는 "타입 안정성: TypeScript 타입의 명확성 확인. any 사용 지양, 제네릭 활용 검토."를 우선 확인해야 합니다.

Also applies to: 19-33

🤖 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/PlatformRoasTable.tsx` around lines 11 -
15, platformLogoMap currently keys off display names which breaks if i18n
changes; update the mapping to use provider codes (e.g., GOOGLE, NAVER, META)
and make it type-safe by introducing a ProviderCode union or enum and declaring
platformLogoMap as Record<ProviderCode, JSX.Element>. Replace any access that
used displayName (in PlatformRoasTable) to use the provider code field (e.g.,
row.provider or row.providerCode) when looking up the logo, and avoid any use of
any by typing the provider field and the map explicitly.
🤖 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/hooks/dashboard/useOverviewRoasRankings.ts`:
- Around line 21-25: The call to getRoasRankings inside useOverviewRoasRankings
is using hardcoded dates ("2026-01-22" to "2026-03-22"), which breaks data
freshness; change it to use dynamic dates or passed-in query params instead:
update useOverviewRoasRankings to accept startDate/endDate (or compute them from
today and a configurable window), format them as YYYY-MM-DD, and pass those
values to getRoasRankings(orgId!, { startDate, endDate }) so the hook queries
the correct period rather than a fixed range.

In `@src/types/dashboard/overview.ts`:
- Line 2: TProviderType이 도메인 타입으로 정의됐지만 IBudgetsResponse.providerType와
IRoasRanking.provider가 여전히 string이라 타입 안전성이 약하니, 해당 필드들의 타입을 string에서
TProviderType으로 변경하세요; 파일 내에서 TProviderType을 임포트하거나 같은 파일에서 재사용하고,
IBudgetsResponse 및 IRoasRanking 타입 선언을 찾아 providerType / provider 필드의 타입을
TProviderType으로 교체한 뒤 전체 컴파일을 통과하는지 확인해 주세요.

---

Nitpick comments:
In `@src/components/dashboard/platform/PlatformRoasTable.tsx`:
- Around line 11-15: platformLogoMap currently keys off display names which
breaks if i18n changes; update the mapping to use provider codes (e.g., GOOGLE,
NAVER, META) and make it type-safe by introducing a ProviderCode union or enum
and declaring platformLogoMap as Record<ProviderCode, JSX.Element>. Replace any
access that used displayName (in PlatformRoasTable) to use the provider code
field (e.g., row.provider or row.providerCode) when looking up the logo, and
avoid any use of any by typing the provider field and the map explicitly.
🪄 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: 1616a3be-658a-425e-b32c-49f3db0235a8

📥 Commits

Reviewing files that changed from the base of the PR and between 8a016b9 and ec80495.

📒 Files selected for processing (3)
  • src/components/dashboard/platform/PlatformRoasTable.tsx
  • src/hooks/dashboard/useOverviewRoasRankings.ts
  • src/types/dashboard/overview.ts

Comment thread src/hooks/dashboard/useOverviewRoasRankings.ts
Comment thread src/types/dashboard/overview.ts
@Seojegyeong Seojegyeong changed the title [Refactor/#208] kakao -> meta 플랫폼 카드 변경 [Refactor/#208] 대시보드 - 플랫폼 변경(KAKAO -> META) May 16, 2026

@YermIm YermIm left a comment

Copy link
Copy Markdown
Collaborator

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 8117b58 into develop May 16, 2026
4 checks passed
@Seojegyeong
Seojegyeong deleted the refactor/#208 branch May 16, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

♻️ [Refactor] 통합 대시보드_플랫폼 변경

2 participants