feat: 네이티브 바텀탭 제거 → 단일 웹뷰 셸 + 앱 버전 브릿지#21
Conversation
- (tabs) 탭 레이아웃 및 구독/메뉴 네이티브 화면 제거, app/index.tsx로 홈 웹뷰 단일 호스트 - _layout Stack/anchor를 index로, 상세/웹뷰 back 폴백을 /로 변경 - home-webview-screen에 REQUEST_APP_VERSION→APP_VERSION 핸들러 추가 - ui/subscribe 제거(웹이 대체)
Walkthrough앱 루트 라우팅 앵커를 변경사항라우팅 구조 및 웹뷰/홈 변경
Sequence DiagramsequenceDiagram
participant WebView as WebView (웹 컨텐츠)
participant Home as HomeWebViewScreen
participant Router as Router
participant Back as BackHandler
WebView->>Home: postMessage(type: NAVIGATE_BACK / REQUEST_APP_VERSION)
Home->>Home: if NAVIGATE_BACK -> webViewRef.current.goBack()
Home->>WebView: if REQUEST_APP_VERSION -> postMessage(APP_VERSION)
Back->>Home: hardwareBackPress -> check canGoBackRef
Home->>WebView: canGoBack ? webViewRef.current.goBack() : Router.push('/')
예상 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~20 minutes 관련 PR
추천 리뷰어
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
- NAVIGATE_BACK 메시지 수신 시 webView.goBack() (상세 '<' 버튼) - Android 하드웨어 백: 웹뷰 히스토리 있으면 goBack, 없으면 종료 - iOS 엣지 스와이프 백 제스처 활성화 (allowsBackForwardNavigationGestures)
Resolve conflicts:
- ui/home/home-webview-screen.tsx: keep both canGoBackRef (Android back) and
loadFailedRef (preload failure tracking); wire onNavigationStateChange together
with the new handleError for onError/onHttpError
- app/(tabs)/_layout.tsx, app/(tabs)/more.tsx, ui/subscribe/{components/empty-state,subscribe-screen}.tsx:
keep deletions (native tabs/subscribe removed in favor of single webview shell)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
onShouldStartLoadWithRequest로 moadong.com 외부 URL 탐색을 가로채 /webview/[slug] 화면으로 push — 개인정보처리방침(노션) 등 외부 링크에 네이티브 헤더와 뒤로가기 버튼이 표시됨 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- handleShouldStartLoadWithRequest: iOS는 navigationType === 'click'인
경우(사용자 탭)만 외부 URL로 인터셉트. 초기 로드·서버 리다이렉트('other')는
통과시켜 스플래시 중 잘못된 화면 전환 방지
- handleMessage NAVIGATE_WEBVIEW: loaded 상태 guard 추가, 첫 로드 완료 전
웹 페이지의 navigation 메시지 무시
- _layout.tsx: initialPathnameRef로 초기 경로 캡처, preload 중 pathname 변경에
무관하게 homeWebViewPreloadSettled 조건 유지
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui/home/home-webview-screen.tsx (1)
92-102:⚠️ Potential issue | 🔴 Critical | ⚡ Quick win
handleMessagedependency array에loaded추가 필요.Line 92에서
loaded상태를 참조하지만, Line 119의handleMessage콜백 dependency array에loaded가 누락되었습니다. 이는 React hooks exhaustive-deps 규칙을 위반하며, stale closure로 인해loaded값이 오래된 값으로 고정될 수 있습니다.🔧 수정 제안
}, - [subscribedClubIds, toggleSubscribe, sendMessage, sendSubscribeState, router], + [subscribedClubIds, toggleSubscribe, sendMessage, sendSubscribeState, router, loaded], );Line 119의 dependency array에
loaded를 추가하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ui/home/home-webview-screen.tsx` around lines 92 - 102, The handleMessage callback references the loaded state but its hook dependency array does not include loaded, which can cause a stale closure; update the useCallback (or wherever handleMessage is defined) to include loaded in its dependency array so handleMessage always sees the current loaded value—look for the handleMessage function and the dependency array near its definition and add loaded alongside existing dependencies (e.g., router and payload-related dependencies).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@ui/home/home-webview-screen.tsx`:
- Around line 92-102: The handleMessage callback references the loaded state but
its hook dependency array does not include loaded, which can cause a stale
closure; update the useCallback (or wherever handleMessage is defined) to
include loaded in its dependency array so handleMessage always sees the current
loaded value—look for the handleMessage function and the dependency array near
its definition and add loaded alongside existing dependencies (e.g., router and
payload-related dependencies).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3c543bf-90ba-41b4-995c-f504f2039b9b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
app/_layout.tsxui/home/home-webview-screen.tsx
요약
홍보·알림 위치 ABCD 실험의 선결 조건인 웹 셸 이관의 RN 측 작업. 네이티브 바텀 탭바를 제거하고 홈 웹뷰를 단일 풀스크린 호스트로 만든다. 바텀 네비게이션(홈/구독/메뉴)은 이제 웹이 렌더한다.
변경
app/(tabs)탭 레이아웃 및 네이티브구독/메뉴화면 제거 →app/index.tsx가 홈 웹뷰 단일 호스트app/_layout.tsxStack/anchor를(tabs)→index로, 동아리 상세·웹뷰 back 폴백을/로ui/home/home-webview-screen.tsx에REQUEST_APP_VERSION → APP_VERSION핸들러 추가 (웹 메뉴 페이지 앱 버전 표시용)ui/home/home-webview-screen.tsx상세 뒤로가기 처리 추가 (단일 웹뷰 셸이 상세까지 인-웹뷰로 품게 되어 필요):NAVIGATE_BACK메시지 →webView.goBack()(상세<버튼)goBack, 없으면 기본 동작(종료)allowsBackForwardNavigationGestures)ui/subscribe/*제거 (웹이 대체)관련
검증
<버튼·Android 하드웨어 백·iOS 엣지 스와이프)Summary by CodeRabbit
New Features
Refactor
Bug Fixes