[feature] 카카오톡 공유 및 web share api로 변경#1083
Conversation
- url, introDescription만 공유
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| 코호트 / 파일(s) | 변경 요약 |
|---|---|
초기화 변경 frontend/src/index.tsx |
initializeKakaoSDK 임포트 및 호출 제거; initializeMixpanel()·initializeSentry() 호출 유지. |
공유 기능 리팩토링 frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx |
Kakao SDK 및 Kakao 전용 공유 흐름 제거. RN WebView 감지 후 postMessage로 SHARE 페이로드 전송(트랙: native_share), 모바일에서 navigator.share 사용 시 web_share, 미지원 시 클립보드 복사 및 clipboard 트래킹으로 분기. 공유 URL/제목 통합 생성, aria-label·alt 텍스트 일반화. |
Sequence Diagram(s)
sequenceDiagram
participant User as 사용자
participant UI as ShareButton(Component)
participant RN as ReactNativeWebView
participant WebAPI as WebShareAPI
participant Clipboard as 클립보드
participant Analytics as Analytics
User->>UI: 공유 버튼 클릭
UI->>UI: isInAppWebView 확인
alt RN WebView 존재
UI->>RN: postMessage({ type: "SHARE", url, title })
RN->>Analytics: track("native_share", { clubName })
else RN WebView 미존재
UI->>WebAPI: navigator.share(shareData)?
alt Web Share 지원
WebAPI-->>UI: 공유 성공/취소
UI->>Analytics: track("web_share", { clubName })
else Web Share 미지원
UI->>Clipboard: navigator.clipboard.writeText(url)
Clipboard-->>UI: 복사 성공/실패
UI->>Analytics: track("clipboard", { clubName })
end
end
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
- MOA-542: KakaoTalk 기반에서 링크/Web Share 방식으로 전환하려는 목표와 일치합니다.
- moadong issue 1082: Kakao 기반 공유를 링크/Web Share로 전환하는 변경과 직접 관련됩니다.
Possibly related PRs
- PR 979: ShareButton의 공유 메시지/페이로드 변경 이력이 있어 충돌 가능성이 높습니다.
- PR 589: Kakao SDK 초기화 및 Kakao 기반 공유를 다룬 PR로 초기화 관련 충돌 소지가 있습니다.
- PR 795: 동일 컴포넌트의 스타일/아이콘 변경 이력으로 병합 시 UI 조정 필요성이 있습니다.
Suggested labels
🔨 Refactor
Suggested reviewers
- oesnuj
- lepitaaar
- SeongHoonC
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | 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 | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | PR 제목이 주요 변경사항을 명확히 반영하고 있습니다: 카카오톡 공유 제거 및 Web Share API로의 전환이 코드 변경의 핵심입니다. |
| Linked Issues check | ✅ Passed | 코드 변경사항이 MOA-542의 모든 주요 요구사항을 충족합니다: 카카오톡 공유 제거, Web Share API 적용, 클립보드 폴백, RN WebView 지원, 이벤트 추적 세분화가 모두 구현되었습니다. |
| Out of Scope Changes check | ✅ Passed | 모든 변경사항이 MOA-542의 요구사항 범위 내에 있으며, 카카오톡 SDK 초기화 제거 및 공유 방식 변경은 직접적으로 관련된 필수 변경입니다. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx`:
- Around line 22-50: handleShare currently swallows all navigator.share errors;
extract the clipboard write + alert + tracking logic into a helper (e.g.,
copyLinkToClipboard) and call it as a fallback when navigator.share throws an
error that is NOT a user-cancel AbortError (check with err instanceof
DOMException && err.name === 'AbortError'); also guard clipboard use with
navigator.clipboard existence and preserve the existing
USER_EVENT.SHARE_BUTTON_CLICKED tracking (method: 'clipboard') when fallback
succeeds, and show the same failure alert when clipboard is unavailable or
writeText fails.
frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx
Show resolved
Hide resolved
- React Native WebView 환경 감지 시 `postMessage`를 통한 네이티브 공유 통신 로직 추가 - RN 환경에서 공유 시 URL이 텍스트에 포함되도록 페이로드 구성 (웹뷰 호환성 개선) - 믹스패널 이벤트 트래킹에 `native_share` 메서드 케이스 추가
- 공유 미리보기를 위한 동아리 로고(`image`) 데이터 페이로드에 추가
This reverts commit e9b3a70.
This reverts commit 06d2163.
- Web Share API에서 url 필드 제거하고 text에 URL 포함 - 모바일 웹/데스크탑/앱 모든 환경에서 "메시지 + URL" 순서로 통일 - 카카오톡 등 일부 플랫폼에서 URL만 공유되던 문제 해결
suhyun113
left a comment
There was a problem hiding this comment.
모바일에서 공유 버튼이 카카오톡 로그인 때문에 불편했는데 훨씬 편해졌네요!!
데스크탑에서 현재는 브라우저가 OS의 기본 공유 창을 띄우게 되던데, 불편해보여서 나중에 공유 모달을 직접 구현해도 좋을 것 같아여
수고하셨습니다ㅏ
frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx
Outdated
Show resolved
Hide resolved
frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx`:
- Around line 61-67: The clipboard copy currently uses shareData.text (which
contains message+URL); change it to copy only the URL string (e.g., use
shareData.url or construct the share URL from clubDetail) inside the ShareButton
component so navigator.clipboard.writeText(...) writes only the plain URL;
update any surrounding variables in the ShareButton/handleShare function to
reference the URL-only value (leave trackEvent(USER_EVENT.SHARE_BUTTON_CLICKED,
...) unchanged except the method field if needed).
frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx
Show resolved
Hide resolved
- Web Share API 실패 시 클립보드 복사로 폴백 처리
#️⃣연관된 이슈
📝작업 내용
문제
카카오톡 공유하기 기능은 로그인이 필요해 사용성이 좋지 않았습니다.
해결
카카오톡 공유하기 기능을 제거하고,
web share api로 URL을 복사 붙여넣기 할 수 있게 수정했습니다.형식:
지금 모아동에서 한누리 동아리를 확인해보세요! https://www.moadong.com/club/6873be489033815c43911937웹뷰 브리징
RN PR
Clipboard Fallback 처리Mixpanel 트래킹 세분화공유 방식에 따라 이벤트를 구분하여 추적하도록 개선했습니다.
추가 변경사항
navigator.share가 window에서 제대로 동작하지 않았습니다.그래서 데스크탑에서는 URL 복사만 하고, 모바일 뷰에서는 web share api를 사용하도록 했습니다.
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
개선
리팩토링
✏️ Tip: You can customize this high-level summary in your review settings.