Skip to content

[feature] 공유하기 웹뷰 브리지 복구#1110

Merged
oesnuj merged 4 commits intodevelop-fefrom
feature/#1109-webview-share-bridge-MOA-570
Jan 25, 2026
Merged

[feature] 공유하기 웹뷰 브리지 복구#1110
oesnuj merged 4 commits intodevelop-fefrom
feature/#1109-webview-share-bridge-MOA-570

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Jan 25, 2026

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

브리지작업을 안하면 안드로이드 앱에서 윈도우로 인식하기에 클립보드 복사가 됩니다. 그래서 브리지를 다시 복구했습니다.

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

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

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

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

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

🫡 참고사항

Summary by CodeRabbit

  • 개선 사항
    • 모바일 앱 내 웹뷰(RN WebView)에서의 공유가 네이티브 메시지로 안전하게 처리되도록 추가 경로가 도입되었습니다.
    • RN WebView 환경에서는 브라우저 공유 API 경로를 우회하여 네이티브 공유 경로를 우선 사용합니다.
    • RN WebView에서의 공유는 별도 방식으로 이벤트가 추적됩니다.
    • 데스크톱 및 일반 모바일 웹 공유, 클립보드 대체 경로 등 기존 동작은 유지됩니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 25, 2026

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

Project Deployment Review Updated (UTC)
moadong Ready Ready Preview, Comment Jan 25, 2026 10:53am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Warning

Rate limit exceeded

@oesnuj has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

Walkthrough

RN WebView 감지 로직(isRNWebView)을 추가하고, RN WebView 환경에서는 SHARE 메시지를 네이티브로 전송하는 requestShare 경로를 사용하도록 ShareButton 공유 흐름을 분기했습니다. Web Share API 및 클립보드 추적은 비-RN 환경에서 그대로 유지됩니다.

Changes

Cohort / File(s) Summary
Share 버튼 변경
frontend/src/pages/ClubDetailPage/components/ShareButton/ShareButton.tsx
RN WebView 감지(isInAppWebViewisRNWebView) 추가. RN WebView일 때 requestShare/SHARE 페이로드 전송 및 rn_webview_share 이벤트로 추적하도록 분기; Web Share 경로에 !isRNWebView 가드 추가.
WebView 브리지 확장
frontend/src/utils/webviewBridge.ts
WebViewMessageSHARE 변형 추가 및 { title, text, url } 페이로드를 보내는 requestShare 신규 export 함수 추가 (postMessageToApp 사용).

Sequence Diagram(s)

sequenceDiagram
  participant Web as Web 페이지
  participant Bridge as window.ReactNativeWebView
  participant Native as 네이티브 앱
  participant Analytics as Analytics

  Web->>Web: 사용자 클릭 (공유)
  alt isRNWebView
    Web->>Bridge: postMessage({ type: "SHARE", payload: { title, text, url } })
    Bridge->>Native: 네이티브로 전달 (공유 처리)
    Web->>Analytics: trackEvent("rn_webview_share", { method: "rn_webview_share" })
  else not RN WebView
    Web->>Web: navigator.share(...) 또는 클립보드 복사
    Web->>Analytics: trackEvent("share", { method: "web_share" / "clipboard" })
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • MOA-570 — WebView 공유 요청 postMessage 추가: RN WebView에서 postMessage로 공유 요청을 보내는 목표와 일치함.
  • [feature] MOA-570 WebView 공유 요청 postMessage 추가 #1109 — WebView postMessage 기반 공유 경로 추가: 동일한 SHARE 메시지 및 requestShare helper 관련 작업과 일치함.

Possibly related PRs

Suggested reviewers

  • suhyun113
  • lepitaaar
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 웹뷰 브리지 공유 기능 복구라는 주요 변경 사항을 명확하게 요약하고 있으며, 실제 코드 변경 내용과 일치합니다.
Linked Issues check ✅ Passed PR 변경 사항이 MOA-570 이슈의 WebView 공유 요청 postMessage 추가 목표를 충족합니다. webviewBridge.ts에 SHARE 메시지 타입과 requestShare 함수가 추가되었으며, ShareButton에서 이를 활용한 공유 로직이 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 WebView 공유 브리지 기능 구현과 관련되어 있으며, 링크된 이슈의 범위 내에 있습니다. 외부 범위 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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.

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.

다시 부활 좋습니다 ㅋㅋ 🔥

Comment on lines 28 to 39
const rnWebView = (window as any).ReactNativeWebView;

if (isRNWebView && rnWebView?.postMessage) {
const sharePayload = {
title: clubDetail.name,
text: `지금 모아동에서 ${clubDetail.name} 동아리를 확인해보세요!\n${url}`,
url,
};

rnWebView.postMessage(
JSON.stringify({ type: 'SHARE', payload: sharePayload }),
);
Copy link
Member

@oesnuj oesnuj Jan 25, 2026

Choose a reason for hiding this comment

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

여기에 안만들고 src/utils/webviewBridge.ts에 WebView 액션용 헬퍼 함수를 만들어서 꺼내쓰면 됩니당

거기에 postMessage 로직도 구현되어 있어서 인자만 넣고 호출해 쓰면 돼요

이유: ShareButton에 파편화되어 있던 React Native 통신 로직을 공통 유틸리티인 webviewBridge.ts로 통합하여, 통신 규격을 한곳에서 관리하고 컴포넌트의 책임을 단순화하기 위함.
Copy link
Collaborator

@suhyun113 suhyun113 left a comment

Choose a reason for hiding this comment

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

빠른 수정 좋아요~

@oesnuj oesnuj merged commit 9d5ec62 into develop-fe Jan 25, 2026
3 checks passed
@oesnuj oesnuj deleted the feature/#1109-webview-share-bridge-MOA-570 branch January 25, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments