Skip to content

[Feature/#308] 플랫폼 실시간 트래픽 이상 클릭 마커/버블 UI - #315

Merged
YermIm merged 3 commits into
developfrom
feature/#308
Jul 27, 2026
Merged

[Feature/#308] 플랫폼 실시간 트래픽 이상 클릭 마커/버블 UI#315
YermIm merged 3 commits into
developfrom
feature/#308

Conversation

@YermIm

@YermIm YermIm commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

close #308

✨ 변경사항

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

✏️ 작업 내용

단일 플랫폼 「실시간 트래픽 변화」 차트에 이상 클릭 탐지 UI를 연동했습니다.

  • useClickStreamsuspectDetailPlatformTrafficChart에 전달
  • hasSuspect일 때 빨간 마커 표시
    • timestamp가 있으면 해당 분에 매칭
    • 없으면 클릭수 최대 지점에 표시 (대략 위치)
  • hover/focus 시 버블로 campaignName / adName / message 표시
  • suspectDetail.timestamp를 optional로 수정

😅 미완성 작업

📢 논의 사항 및 참고 사항

  • 현재 관련 데이터가 없어 화면 검증을 못 했습니다. 나중에 다시 확인할 예정입니다.
  • timestamp가 없는 것 같아 클릭수 최대 지점에 대략 표시하였습니다.

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

Summary by CodeRabbit

  • 새로운 기능
    • 플랫폼 트래픽 차트에 이상 클릭 탐지 지점을 표시하고, 이상 상세 정보를 마커 위치 기준으로 제어합니다.
    • 마커 2개와 포커스 가능한 상세 버튼을 추가했으며, 마우스 오버/키보드 포커스 시 버블로 메시지 정보를 확인할 수 있습니다.
    • 이상 지점을 매칭하지 못하는 경우에도 최대 클릭 지점을 대체 표시합니다.
  • 버그 수정
    • 클릭 스트림 데이터의 타임스탬프가 없어도 차트 표시가 가능하도록 개선했습니다.
    • 차트 상태 변경 시 마커가 사라지면 위치 표시 상태도 정확히 갱신되도록 수정했습니다.

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

coderabbitai Bot commented Jul 26, 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: CHILL

Plan: Pro Plus

Run ID: 104694d3-689f-4b37-b2bd-469b2ba9cf96

📥 Commits

Reviewing files that changed from the base of the PR and between 194a7c4 and d1f924b.

📒 Files selected for processing (2)
  • src/components/dashboard/charts/useAnomalyMarkerPos.ts
  • src/components/dashboard/platform/PlatformTrafficChart.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/dashboard/platform/PlatformTrafficChart.tsx

📝 Walkthrough

Walkthrough

플랫폼 트래픽 차트가 클릭스트림의 이상 징후 정보를 받아 시계열 위치에 annotation과 마커를 표시하고, hover/focus 시 상세 버블을 보여주도록 확장되었습니다. 관련 타입과 화면 전달 경로도 함께 변경되었습니다.

Changes

플랫폼 이상 클릭 UI

Layer / File(s) Summary
이상 징후 데이터 계약 및 전달
src/types/dashboard/overview.ts, src/components/dashboard/platform/PlatformTrafficChart.tsx, src/components/dashboard/platform/SinglePlatformView.tsx
timestamp를 선택 필드로 변경하고, suspectDetail을 차트 props와 useClickStream 전달 경로에 추가했습니다.
이상 징후 좌표 계산 및 annotation
src/components/dashboard/platform/PlatformTrafficChart.tsx
이상 징후 timestamp를 시계열의 minute과 매칭하며, 매칭 실패 시 최대 클릭 지점을 fallback으로 사용해 Apex annotation을 생성합니다.
마커 및 상세 버블 상호작용
src/components/dashboard/charts/useAnomalyMarkerPos.ts, src/components/dashboard/platform/PlatformTrafficChart.tsx
차트 DOM 좌표를 기준으로 핑 마커와 포커스 가능한 버튼을 렌더링하고, hover/focus 상태에서 AnomalyBubble을 표시합니다. 마커가 사라지면 좌표 상태를 null로 초기화합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SinglePlatformView
  participant useClickStream
  participant PlatformTrafficChart
  participant ApexChart
  participant useAnomalyMarkerPos
  participant AnomalyBubble
  SinglePlatformView->>useClickStream: suspectDetail 수신
  SinglePlatformView->>PlatformTrafficChart: suspectDetail 전달
  PlatformTrafficChart->>PlatformTrafficChart: timestamp와 minute 매칭
  PlatformTrafficChart->>ApexChart: anomaly annotation 렌더링
  PlatformTrafficChart->>useAnomalyMarkerPos: 마커 DOM 좌표 조회
  useAnomalyMarkerPos-->>PlatformTrafficChart: 좌표 또는 null 반환
  PlatformTrafficChart->>AnomalyBubble: hover/focus 시 상세 정보 전달
Loading

Possibly related PRs

Suggested labels: 🐞 BugFix

Suggested reviewers: jjjsun, seojegyeong

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 플랫폼 실시간 트래픽 차트에 이상 클릭 마커/버블 UI를 추가한 변경과 잘 맞는 제목입니다.
Description check ✅ Passed 관련 이슈, 변경사항, 작업 내용, 참고 사항이 모두 포함되어 있어 템플릿을 전반적으로 충족합니다.
Linked Issues check ✅ Passed #308의 핵심 요구인 단일 플랫폼 차트의 이상 클릭 마커/버블 연동과 timestamp 대체 표시까지 반영되었습니다.
Out of Scope Changes check ✅ Passed 마커 상태 정리와 접근성 연결은 본 기능 구현을 보완하는 범위로 보이며, 눈에 띄는 무관한 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feature/#308

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 26, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

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

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

🧹 Nitpick comments (2)
src/components/dashboard/platform/PlatformTrafficChart.tsx (2)

175-180: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

차트 색상도 토큰 해석 경로로 전달해주세요.

var(--color-info-red)를 Apex 옵션에 직접 넣는 방식은 금지된 inline var(--*) 사용입니다. 프로젝트의 차트용 토큰 resolver/adapter를 통해 info-red 토큰 값을 전달해주세요. As per coding guidelines, “Forbidden: var(--*) inline hex, arbitrary bg-[#...]” 규칙을 적용해야 합니다.

🤖 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/PlatformTrafficChart.tsx` around lines 175
- 180, Update the marker styling in PlatformTrafficChart so fillColor and
strokeColor use the project’s chart token resolver/adapter with the info-red
token, rather than passing var(--color-info-red) directly to Apex options.
Preserve the existing marker size and stroke width.

Source: Coding guidelines


35-41: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

버블 props 타입을 명명된 타입으로 분리해주세요.

익명 객체 대신 파일 상단에 IAnomalyBubbleProps를 선언해 컴포넌트 props 규칙을 맞춰주세요. As per coding guidelines, “component props use I*Props” 규칙을 적용해야 합니다.

🤖 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/PlatformTrafficChart.tsx` around lines 35 -
41, PlatformTrafficChart의 버블 컴포넌트 props에 사용된 익명 객체 타입을 파일 상단의 명명된
IAnomalyBubbleProps 인터페이스로 분리하세요. x, y, message, campaignName, adName 필드를 동일하게
정의하고 해당 컴포넌트 선언에서 새 타입을 참조하세요.

Source: Coding guidelines

🤖 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/components/dashboard/platform/PlatformTrafficChart.tsx`:
- Around line 298-315: Update the anomaly detail button and AnomalyBubble in
PlatformTrafficChart so the button references the bubble through
aria-describedby, and the bubble exposes a unique matching id with
role="tooltip". Preserve the existing campaignName, adName, and message content
while ensuring the id is unique for each rendered anomaly.
- Around line 288-318: Update useAnomalyMarkerPos to call setMarkerPos(null)
when no current anomaly marker is found, clearing stale coordinates after
hasSuspect becomes false. In PlatformTrafficChart, require the current anomaly
state and valid markerPos before rendering the ping indicators, focus button,
and AnomalyBubble.
- Around line 117-127: Update the timestamp-to-minute matching logic in
PlatformTrafficChart and the corresponding TrafficChart implementation to use
the same explicit timezone basis as the server-provided timeSeriesData.minute
keys. Prefer UTC accessors such as getUTCFullYear, getUTCMonth, getUTCDate,
getUTCHours, and getUTCMinutes, or reuse a server-provided minute key, ensuring
both charts produce identical keys for values such as ISO timestamps with a Z
suffix.

---

Nitpick comments:
In `@src/components/dashboard/platform/PlatformTrafficChart.tsx`:
- Around line 175-180: Update the marker styling in PlatformTrafficChart so
fillColor and strokeColor use the project’s chart token resolver/adapter with
the info-red token, rather than passing var(--color-info-red) directly to Apex
options. Preserve the existing marker size and stroke width.
- Around line 35-41: PlatformTrafficChart의 버블 컴포넌트 props에 사용된 익명 객체 타입을 파일 상단의
명명된 IAnomalyBubbleProps 인터페이스로 분리하세요. x, y, message, campaignName, adName 필드를
동일하게 정의하고 해당 컴포넌트 선언에서 새 타입을 참조하세요.
🪄 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 Plus

Run ID: e455d547-2531-4f18-be23-948ca554168d

📥 Commits

Reviewing files that changed from the base of the PR and between f8e2342 and 194a7c4.

📒 Files selected for processing (3)
  • src/components/dashboard/platform/PlatformTrafficChart.tsx
  • src/components/dashboard/platform/SinglePlatformView.tsx
  • src/types/dashboard/overview.ts

Comment thread src/components/dashboard/platform/PlatformTrafficChart.tsx
Comment thread src/components/dashboard/platform/PlatformTrafficChart.tsx Outdated
Comment thread src/components/dashboard/platform/PlatformTrafficChart.tsx Outdated

@jjjsun jjjsun 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: 확인했습니다!

@YermIm
YermIm merged commit c613839 into develop Jul 27, 2026
3 checks passed
@YermIm
YermIm deleted the feature/#308 branch July 27, 2026 14:48
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] 플랫폼 대시보드 이상 클릭 탐지 마커/버블 UI

2 participants