Skip to content

Comments

[feature] 믹스패널 track 2차 추가 및 기타 작업 #283

Merged
seongwon030 merged 7 commits intodevelop/fefrom
feature/#280-mixpanel-tracking-v2-FE-68
Apr 5, 2025
Merged

[feature] 믹스패널 track 2차 추가 및 기타 작업 #283
seongwon030 merged 7 commits intodevelop/fefrom
feature/#280-mixpanel-tracking-v2-FE-68

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Apr 3, 2025

#️⃣연관된 이슈

ex) #280

📝작업 내용

1. hooks 폴더분리 83d3373

  • hooks/useAutoScroll -> hooks/InfoTabs/useAutoScroll
  • hooks/usePhotoNavigation -> hooks/PhotoList/usePhotoNavigation

2. 활동사진 스타일 통일 5a76c20

  • 활동사진 타이틀 스타일을 통일했습니다.
스크린샷 2025-04-03 22 54 07

3. distinct_id 추가 f175638

  • mixpanel 에서 distinct_id 추가하면 로그인없이도 사용자 개인을 추적해준다고 합니다.
  • 그래도 로그인이 없기에 완벽하지 않다고 해요.

4. track 추가

  • 활동사진 다음으로, 이전으로 버튼에 track 추가 8502b04
  • 검색창에서 검색 시 페이지 이름 track 8acb502
  • 검색 창 부분은 상세페이지에도 존재하기 때문에 일단 해 두었습니다.

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • 새로운 기능
    • 검색, 사진 탐색 및 탭 클릭 시 사용자 행동을 좀 더 정밀하게 추적하도록 개선되었습니다.
  • 스타일
    • 활동 사진 제목의 디자인이 업데이트되어 보다 일관되고 세련된 UI를 제공합니다.

@seongwon030 seongwon030 added ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링 💻 FE Frontend labels Apr 3, 2025
@seongwon030 seongwon030 requested review from Copilot and oesnuj April 3, 2025 13:57
@seongwon030 seongwon030 self-assigned this Apr 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Walkthrough

이 PR은 믹스패널 추적 기능에 추가 정보를 포함하도록 변경되었습니다. SearchBox에서는 검색 실행 시 기존 keyword 외에 현재 페이지 경로(page)를 함께 전달하며, usePhotoNavigation와 InfoTabs에서는 각각 사진 내비게이션 및 탭 클릭 이벤트에 대해 추적 호출이 추가되었습니다. 또한, mixpanel.track 호출 시 사용자 고유 식별자인 distinct_id가 포함되어 추적 데이터의 정밀도를 높였습니다. 추가로, import 경로 수정과 styled component 추가를 통해 코드 구조와 UI 스타일이 개선되었습니다.

Changes

파일 변경 요약
frontend/src/components/common/SearchBox/SearchBox.tsx, frontend/src/hooks/PhotoList/usePhotoNavigation.ts, frontend/src/hooks/useMixpanelTrack.ts, frontend/src/pages/ClubDetailPage/components/InfoTabs/InfoTabs.tsx 믹스패널 추적 기능 개선: 검색, 사진 내비게이션, 탭 클릭 이벤트 시 trackEvent 호출 시 추가 정보(page 및 distinct_id 포함) 전달
frontend/src/pages/ClubDetailPage/ClubDetailPage.tsx, frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.styles.ts, frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx 경로 수정 및 UI 개선: useAutoScroll 및 usePhotoNavigation의 import 경로 업데이트, PhotoList 제목을 styled component 사용으로 변경

Sequence Diagram(s)

sequenceDiagram
    participant 사용자 as 사용자
    participant SB as SearchBox 컴포넌트
    participant Tracker as useMixpanelTrack
    participant MP as Mixpanel SDK

    사용자->>SB: 검색 실행 (키워드 입력)
    SB->>Tracker: trackEvent({ keyword, page })
    Tracker->>MP: mixpanel.track("검색 실행", { keyword, page, distinct_id })
Loading
sequenceDiagram
    participant 사용자 as 사용자
    participant PN as usePhotoNavigation
    participant Tracker as useMixpanelTrack
    participant MP as Mixpanel SDK

    사용자->>PN: 다음/이전 사진 클릭
    PN->>Tracker: trackEvent({ action: "next" or "prev", index })
    Tracker->>MP: mixpanel.track("사진 내비게이션", { action, index, distinct_id })
Loading
sequenceDiagram
    participant 사용자 as 사용자
    participant IT as InfoTabs 컴포넌트
    participant Tracker as useMixpanelTrack
    participant MP as Mixpanel SDK

    사용자->>IT: 탭 클릭
    IT->>Tracker: trackEvent({ event: "Tab Clicked", tabName, tabIndex })
    Tracker->>MP: mixpanel.track("Tab Clicked", { tabName, tabIndex, distinct_id })
Loading

Assessment against linked issues

Objective Addressed Explanation
검색 이벤트에 페이지 경로 정보 추가 (FE-68)
사진 내비게이션 및 탭 클릭 이벤트 추적 추가 (FE-68)
트래킹 데이터에 distinct_id 포함 (FE-68)

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc88c6c and 8acb502.

📒 Files selected for processing (7)
  • frontend/src/components/common/SearchBox/SearchBox.tsx (1 hunks)
  • frontend/src/hooks/PhotoList/usePhotoNavigation.ts (3 hunks)
  • frontend/src/hooks/useMixpanelTrack.ts (1 hunks)
  • frontend/src/pages/ClubDetailPage/ClubDetailPage.tsx (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/InfoTabs/InfoTabs.tsx (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.styles.ts (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx (2 hunks)
🔇 Additional comments (11)
frontend/src/hooks/useMixpanelTrack.ts (1)

9-9: Mixpanel 추적에 사용자 식별자 추가 - 좋은 개선입니다!

distinct_id를 추가하여 로그인하지 않은 사용자도 개별적으로 추적할 수 있게 되었습니다. 이를 통해 사용자 행동 분석의 정확도와 일관성이 향상될 것입니다.

frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.styles.ts (1)

3-6: 활동 사진 제목을 위한 스타일 컴포넌트 추가 - 좋은 접근입니다!

PhotoListTitle 스타일 컴포넌트를 추가하여 앱 전체에서 활동 사진 제목의 스타일을 표준화하였습니다. 이는 디자인 일관성 측면에서 좋은 개선입니다.

frontend/src/pages/ClubDetailPage/ClubDetailPage.tsx (1)

15-15: 훅 경로 구조 개선 - 좋은 구조화입니다!

useAutoScroll 훅의 임포트 경로를 @/hooks/InfoTabs/useAutoScroll로 변경한 것은 관련 기능별로 코드를 구조화하여 유지보수성을 향상시키는 좋은 방법입니다.

frontend/src/pages/ClubDetailPage/components/InfoTabs/InfoTabs.tsx (1)

3-3: 탭 클릭 이벤트 추적 추가 - 효과적인 사용자 행동 분석 개선!

useMixpanelTrack 훅을 사용하여 탭 클릭 이벤트를 추적하는 기능을 추가했습니다. 추적 데이터에 탭 이름과 인덱스를 포함시켜 분석 가치를 높였습니다. 이는 사용자 행동을 이해하고 UI/UX를 개선하는 데 도움이 될 것입니다.

Also applies to: 9-9, 14-18

frontend/src/components/common/SearchBox/SearchBox.tsx (1)

21-24: Mixpanel 트래킹에 현재 페이지 경로 추가가 잘 이루어졌습니다.

검색 이벤트 트래킹 시 현재 페이지 경로(page: window.location.pathname)를 추가한 것은 좋은 개선입니다. 이를 통해 사용자가 어떤 페이지에서 검색을 시작했는지 파악할 수 있어 사용자 경험 분석에 더 많은 인사이트를 제공할 수 있습니다.

frontend/src/hooks/PhotoList/usePhotoNavigation.ts (4)

2-2: Mixpanel 트래킹 훅 임포트가 적절히 추가되었습니다.

Mixpanel 트래킹 기능을 위한 훅 임포트가 명확하게 추가되었습니다.


20-21: trackEvent 함수 초기화가 잘 이루어졌습니다.

useMixpanelTrack 훅을 사용하여 trackEvent 함수를 초기화한 것이 적절합니다.


40-40: '다음' 버튼 클릭 시 트래킹 이벤트 추가가 적절합니다.

다음 사진으로 이동할 때 'next' 액션과 해당 인덱스를 트래킹하는 것은 사용자 행동 분석에 유용합니다.


47-47: '이전' 버튼 클릭 시 트래킹 이벤트 추가가 적절합니다.

이전 사진으로 이동할 때 'prev' 액션과 해당 인덱스를 트래킹하는 것은 사용자 행동 분석에 유용합니다.

frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx (2)

4-4: 임포트 경로 변경이 적절히 이루어졌습니다.

usePhotoNavigation 훅의 임포트 경로가 @/hooks/usePhotoNavigation에서 @/hooks/PhotoList/usePhotoNavigation으로 변경된 것은 PR 목표에 맞게 폴더 구조를 더 명확하게 정리한 것입니다. 이렇게 함으로써 관련 훅들을 더 논리적인 그룹으로 정리하여 코드 구조가 개선되었습니다.


84-84: 스타일 컴포넌트로의 전환이 적절합니다.

기존의 기본 <h3> 태그 대신 <Styled.PhotoListTitle> 스타일 컴포넌트를 사용하도록 변경한 것은 PR의 목표인 "통일된 활동 사진 스타일"에 부합합니다. 이를 통해 애플리케이션 전반에 걸쳐 일관된 디자인을 유지할 수 있습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link

netlify bot commented Apr 3, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 8acb502
🔍 Latest deploy log https://app.netlify.com/sites/moadong/deploys/67ee93d69f88cf000881e52c
😎 Deploy Preview https://deploy-preview-283--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 57
Accessibility: 78
Best Practices: 92
SEO: 85
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reorganizes hook directory structures, updates UI styles for activity photos, and introduces additional Mixpanel tracking events throughout the ClubDetailPage.

  • Moved hooks (useAutoScroll, usePhotoNavigation) to more specific directories
  • Updated activity photo title styling using a new styled component
  • Added distinct_id and tracking events for Mixpanel in various navigation and search interactions

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx Updated import for usePhotoNavigation and replaced the h3 title with a styled component
frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.styles.ts Introduced the PhotoListTitle styled component for consistent styling
frontend/src/pages/ClubDetailPage/components/InfoTabs/InfoTabs.tsx Integrated Mixpanel tracking for tab clicks
frontend/src/pages/ClubDetailPage/ClubDetailPage.tsx Updated useAutoScroll import path
frontend/src/hooks/useMixpanelTrack.ts Added distinct_id to tracking events
frontend/src/hooks/PhotoList/usePhotoNavigation.ts Added Mixpanel tracking for photo navigation actions
frontend/src/components/common/SearchBox/SearchBox.tsx Updated search tracking event to include page pathname

@Moadong Moadong deleted a comment from coderabbitai bot Apr 3, 2025
@seongwon030 seongwon030 linked an issue Apr 3, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@oesnuj oesnuj left a comment

Choose a reason for hiding this comment

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

믹스패널 추가 수고하셨습니다!
이제 활동 사진 쪽 이벤트도 수집하네요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] FE-68 믹스패널 track 2차 추가 및 기타 작업

2 participants