Conversation
hotfix: 웹뷰에서 노션 딥링크 작동안하는 이슈 수정
fix: TL배너 보이도록 테스트 유저 추가
hotfix: isTestUser 케이스에서 TL api 요청하도록 변경
hotfix: 웹뷰 노션스킴 확인을 위한 test 컴포넌트 렌더
main << dev
fix: 각 네이티브 앱이 변경한 userAgent를 기반으로 웹뷰 감지
fix: userAgent 케이스 모두 지우고 커스텀케이스만 남겨서 test
fix: notion deeplink 앱 test
fix: original Link 마지막 테스트
Summary by CodeRabbit릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughTeamLeaderCard 컴포넌트의 웹뷰 감지 로직을 단순화하고 Notion 딥링크 처리를 최적화했습니다. 웹뷰 감지 결과를 캐싱하고 SOPT 특화 접근 방식을 적용했으며, 테스트 사용자의 Notion URL을 업데이트했습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (3 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/members/main/TeamLeaderCard/index.tsx(1 hunks)src/pages/members/team-leaders.tsx(1 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
src/components/members/main/TeamLeaderCard/index.tsx
[error] 87-87: This hook is being called from a nested function, but all hooks must be called unconditionally from the top-level component.
For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level
(lint/correctness/useHookAtTopLevel)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-app / build
- GitHub Check: chromatic-deploy
🔇 Additional comments (2)
src/components/members/main/TeamLeaderCard/index.tsx (1)
63-71: SOPT 특화 웹뷰 감지 로직이 적절합니다.SOPT iOS/Android 앱에 특화된 웹뷰 감지 로직으로 단순화한 것이 적절하며, 웹뷰 환경에서 원본 URL로 리다이렉트하는 처리도 올바릅니다. Line 85의 TODO 코멘트처럼 앱팀과의 협력이 필요한 부분은 추후 개선하시면 됩니다.
Also applies to: 85-89
src/pages/members/team-leaders.tsx (1)
73-74: 테스트 사용자 URL 업데이트가 적절합니다.테스트 사용자의 Notion URL을 SOPT-makers 페이지로 업데이트한 것은 문제없습니다.
| function useDetectWebView() { | ||
| const userAgent = navigator.userAgent; | ||
|
|
||
| // iOS 웹뷰 감지 | ||
| const isIOS = /iPhone|iPad|iPod/.test(userAgent); | ||
| const isWebKit = /AppleWebKit/.test(userAgent); | ||
| const isSafari = /Safari/.test(userAgent) || /Version\/[\d.]+.*Safari/.test(userAgent); // Safari 또는 Version/{version}.Safari 패턴을 포함하지 않는 경우 | ||
| const isNotCriOS = !/CriOS/.test(userAgent); | ||
| const isNotFxiOS = !/FxiOS/.test(userAgent); | ||
| // SOPT-iOS 웹뷰 감지 | ||
| const isIOSWebView = /SOPT-iOS/.test(navigator.userAgent); | ||
|
|
||
| const isIOSWebView = isIOS && isWebKit && isNotCriOS && isNotFxiOS && !isSafari; | ||
|
|
||
| // Android 웹뷰 감지 | ||
| const isAndroid = /Android/.test(userAgent); | ||
| const isAndroidWebView = isAndroid && /wv/.test(userAgent); | ||
| // SOPT-Android 웹뷰 감지 방법: | ||
| // 2. User-Agent에 "wv"가 있으면 웹뷰 (기존 방법) | ||
| // 3. User-Agent가 정확히 "Chrome/56.0.0.0 Mobile"이면 앱에서 설정한 값이므로 웹뷰 | ||
| const hasWvInUserAgent = /wv/.test(userAgent); | ||
| const isChrome56Mobile = /Chrome\/56\.0\.0\.0 Mobile/.test(userAgent); | ||
| const isAndroidWebView = hasWvInUserAgent || isChrome56Mobile; | ||
|
|
||
| return { | ||
| isWebView: isIOSWebView || isAndroidWebView, | ||
| isIOSWebView, | ||
| isAndroidWebView, | ||
| isIOS, | ||
| isAndroid, | ||
| }; | ||
| } |
There was a problem hiding this comment.
함수 이름을 detectWebView로 변경하세요.
use로 시작하는 함수명은 React Hook 규칙을 따라야 하지만, 이 함수는 Hook을 사용하지 않고 중첩 함수 내부(line 83)에서 호출되므로 Rules of Hooks를 위반합니다. 정적 분석 도구가 정확하게 이를 감지했습니다.
다음 diff를 적용하여 함수명을 수정하세요:
- function useDetectWebView() {
+ function detectWebView() {
const userAgent = navigator.userAgent;
// SOPT-iOS 웹뷰 감지그리고 line 83에서 호출 부분도 수정하세요:
- const webViewInfo = useDetectWebView();
+ const webViewInfo = detectWebView();Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/components/members/main/TeamLeaderCard/index.tsx around lines 60 to 78,
the function useDetectWebView should be renamed to detectWebView because it does
not use React hooks and its current name starting with "use" violates Rules of
Hooks; rename the function to detectWebView and update its call site at line 83
accordingly (change useDetectWebView() to detectWebView()), keeping the
implementation and returned object identical so behavior remains the same.
|
🚀 프리뷰 배포 확인하기 🚀 |
No description provided.