-
Notifications
You must be signed in to change notification settings - Fork 1
[25.02.09] Hotfix - 배포 전 전체 코드 정리, 핫픽스 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough이번 PR은 총 세 가지 주요 변경사항을 포함합니다. 첫째, Velog 서비스를 위한 환경 변수 NEXT_PUBLIC_VELOG_URL이 .env.sample 파일에 추가되었습니다. 둘째, readme.md 파일에 Docker 이미지 및 리소스 정리를 위한 새로운 명령어 섹션이 추가되었습니다. 셋째, 이벤트 추적 방식이 개선되어 여러 컴포넌트에서 trackUserEvent 호출 시 하드코딩된 문자열 대신 MessageEnum 열거형을 참조하도록 업데이트되었으며, trackUtil.tsx 함수의 파라미터 타입도 확장되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant U as 사용자
participant C as 컴포넌트
participant T as trackUserEvent
participant S as 서버
U->>C: 사용자 이벤트 (클릭 등)
C->>T: 이벤트 트래킹 호출 (MessageEnum 전달)
T->>S: POST 요청 전송 (eventType 결정 후)
S-->>T: 응답 반환
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/utils/trackUtil.tsx (1)
11-19
: MessageEnum에 대한 문서화가 필요합니다.각 이벤트 타입에 대한 설명과 숫자값이 선택된 이유를 주석으로 추가하면 좋겠습니다.
예시:
export const MessageEnum = { + // 사용자 인증 관련 이벤트 (10-19) LOGIN: 11, // 로그인 시도 NAVIGATE: 12, // 페이지 이동 LOGOUT: 13, // 로그아웃 + // 메인 페이지 상호작용 이벤트 (20-29) SECTION_INTERACT_MAIN: 21, // 메인 섹션 상호작용 SORT_INTERACT_MAIN: 22, // 메인 정렬 상호작용 REFRESH_INTERACT_MAIN: 23, // 메인 새로고침 + // 게시판 상호작용 이벤트 (30-39) SORT_INTERACT_BOARD: 31, // 게시판 정렬 상호작용 } as const;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
.env.sample
(1 hunks)readme.md
(1 hunks)src/app/(with-tracker)/(auth-required)/leaderboards/Content.tsx
(2 hunks)src/app/(with-tracker)/(auth-required)/main/Content.tsx
(4 hunks)src/app/(with-tracker)/(login)/Content.tsx
(2 hunks)src/components/auth-required/header/Section.tsx
(2 hunks)src/components/auth-required/header/index.tsx
(2 hunks)src/components/auth-required/main/Section/index.tsx
(2 hunks)src/components/auth-required/main/Summary/index.tsx
(2 hunks)src/utils/trackUtil.tsx
(1 hunks)
🔇 Additional comments (11)
src/app/(with-tracker)/(auth-required)/leaderboards/Content.tsx (1)
6-6
: 이벤트 추적 메커니즘 개선이 잘 적용되었습니다!문자열 리터럴 대신 MessageEnum을 사용하여 타입 안정성과 유지보수성이 향상되었습니다.
Also applies to: 29-29
src/utils/trackUtil.tsx (1)
24-30
: 이벤트 타입 처리 로직이 잘 구현되었습니다.number 타입도 허용하도록 개선되어 유연성이 향상되었습니다. 타입 안정성도 잘 유지되고 있습니다.
src/components/auth-required/header/Section.tsx (1)
5-5
: 이벤트 추적 개선이 일관성 있게 적용되었습니다.MessageEnum을 사용한 네비게이션 이벤트 추적이 잘 구현되었습니다.
Also applies to: 51-51
src/components/auth-required/main/Summary/index.tsx (1)
6-6
: 이벤트 추적 개선이 잘 적용되었습니다.섹션 상호작용 이벤트 추적이 MessageEnum을 사용하여 일관성 있게 구현되었습니다.
Also applies to: 41-41
src/app/(with-tracker)/(login)/Content.tsx (1)
10-10
: 이벤트 추적 개선이 잘 적용되었습니다!하드코딩된 문자열 대신 MessageEnum을 사용하여 이벤트 추적의 일관성과 유지보수성이 향상되었습니다.
Also applies to: 25-25
src/components/auth-required/main/Section/index.tsx (1)
9-9
: 이벤트 추적 로직이 잘 개선되었습니다!MessageEnum을 사용하여 섹션 상호작용 이벤트를 추적하는 방식으로 잘 변경되었습니다.
Also applies to: 24-24
src/app/(with-tracker)/(auth-required)/main/Content.tsx (2)
17-17
: 이벤트 추적 표준화가 잘 적용되었습니다!정렬 및 새로고침 이벤트에 대해 MessageEnum을 일관되게 적용하여 코드 품질이 향상되었습니다.
Also applies to: 85-85, 99-99
69-76
: 비활성화된 버튼의 onClick 핸들러 검토 필요버튼이 disabled 상태일 때는 onClick 이벤트가 발생하지 않으므로, 현재 이벤트 추적이 동작하지 않을 수 있습니다.
다음 두 가지 방안 중 하나를 선택하여 수정하는 것을 고려해보세요:
- 버튼이 활성화될 때만 이벤트를 추적하고 싶다면 현재 구현을 유지
- 비활성화 상태에서도 이벤트를 추적하고 싶다면 다음과 같이 수정:
-<Button - size="SMALL" - disabled - onClick={() => - trackUserEvent(MessageEnum.REFRESH_INTERACT_MAIN) - } -> +<div onClick={() => trackUserEvent(MessageEnum.REFRESH_INTERACT_MAIN)}> + <Button + size="SMALL" + disabled + > + 새로고침 + </Button> +</div>✅ Verification successful
비활성화 버튼 클릭 이벤트 추적 검토 결과
- HTML 표준에 따르면 disabled 속성이 적용된 버튼은 클릭 시 onClick 이벤트를 발생시키지 않습니다.
- 만약 버튼 활성 상태일 때만 이벤트 추적이 의도라면 현재 구현이 올바릅니다.
- 반대로, 비활성화 상태에서도 이벤트 추적이 필요하다면 버튼을 감싸는 부모 요소(div 등)에 onClick 핸들러를 부여하는 방식으로 수정하는 것을 고려해보세요.
src/components/auth-required/header/index.tsx (1)
11-11
: 로그아웃 이벤트 추적이 잘 개선되었습니다!MessageEnum을 사용하여 로그아웃 이벤트 추적의 일관성이 향상되었습니다.
Also applies to: 117-117
.env.sample (1)
4-4
: 환경 변수 추가 확인: 추가된 NEXT_PUBLIC_VELOG_URL 변수는 velog 서비스를 위한 URL("https://velog.io")을 올바르게 설정하고 있습니다. 다른 환경 변수들과의 일관성을 유지하는지 다시 한 번 검토해 주세요.readme.md (1)
41-49
: 도커 정리 명령어 섹션 추가: 새로 추가된 "docker 관련, 이미지 정리" 섹션은 사용하지 않는 도커 이미지, 볼륨, 캐시, 컨테이너를 정리하는 명령어들을 명확하게 안내하고 있습니다. 문서의 가독성도 높아 사용자들이 쉽게 따라할 수 있을 것 같습니다.
Summary by CodeRabbit