Repository navigation
React Compilerを導入 - #6095
React Compilerを導入#6095
Conversation
📝 WalkthroughWalkthroughReact StrictMode環境下でのAlert.alert重複表示問題を解決するため、同一キーの表示抑止ユーティリティshowAlertWhilePresentingを新規実装。プロジェクト全体のAlert.alert呼び出しをこのユーティリティに置き換え統一。WalkthroughOverlayのPortal廃止と位置補正、React Compiler実験設定有効化、ガイドドキュメント追加も実施。 ChangesStrictMode下でのAlert表示統一
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/WalkthroughOverlay.tsx (1)
190-197: ⚡ Quick winアニメーションのクリーンアップを追加してください。
StrictMode 下では
useEffectが再実行されるため、前のアニメーションを停止しないと重複実行される可能性があります。♻️ 修正案
useEffect(() => { const targetY = calculateTooltipY(); - RNAnimated.timing(animatedY, { + const animation = RNAnimated.timing(animatedY, { toValue: targetY, duration: ANIMATION_DURATION, useNativeDriver: false, - }).start(); + }); + animation.start(); + return () => animation.stop(); }, [currentStepIndex, adjustedSpotlightArea?.y, screenHeight]);🤖 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 `@src/components/WalkthroughOverlay.tsx` around lines 190 - 197, The effect that animates animatedY (inside the WalkthroughOverlay component) can re-run under StrictMode and must stop previous animations; capture the RNAnimated.timing(...) return value into a variable (e.g., animation), call animation.start() as now, and return a cleanup function that calls animation.stop() (or animation.stopAnimation()) so previous animations are cancelled when the effect re-runs or component unmounts; keep the same dependency array ([currentStepIndex, adjustedSpotlightArea?.y, screenHeight]).
🤖 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.
Inline comments:
In `@src/screens/Main.tsx`:
- Around line 465-467: The current listener-only approach
(navigation.addListener('beforeRemove', resetMainState) inside the useEffect)
can miss cases where MainStack is removed by parent conditional rendering (e.g.
isUnderMaintenance / isInternetAvailable), so ensure resetMainState (from
useResetMainState.ts which resets navigationState and stationState) also runs on
component unmount and when those parent conditions change: update the useEffect
to return a cleanup that calls resetMainState (so it runs on unmount) and/or add
another effect that watches the parent condition flags (isUnderMaintenance,
isInternetAvailable) and invokes resetMainState when they transition to a state
that will unmount or replace the stack.
---
Nitpick comments:
In `@src/components/WalkthroughOverlay.tsx`:
- Around line 190-197: The effect that animates animatedY (inside the
WalkthroughOverlay component) can re-run under StrictMode and must stop previous
animations; capture the RNAnimated.timing(...) return value into a variable
(e.g., animation), call animation.start() as now, and return a cleanup function
that calls animation.stop() (or animation.stopAnimation()) so previous
animations are cancelled when the effect re-runs or component unmounts; keep the
same dependency array ([currentStepIndex, adjustedSpotlightArea?.y,
screenHeight]).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3e795657-8db9-405c-be11-69c28d8b21c3
📒 Files selected for processing (11)
AGENTS.mdapp.config.tssrc/components/WalkthroughOverlay.tsxsrc/hooks/useCheckStoreVersion.tssrc/hooks/useInitialNearbyStation.test.tsxsrc/hooks/useInitialNearbyStation.tssrc/index.tsxsrc/providers/DeepLinkProvider.tsxsrc/screens/Main.tsxsrc/utils/alertPresentation.test.tssrc/utils/alertPresentation.ts
概要
React Compiler を導入し、導入に伴って StrictMode 下で露出した副作用の不具合を修正します。
変更の種類
変更内容
app.config.tsで React Compiler を有効化しました。Main画面の状態リセットを mount cleanup ではなく navigation のbeforeRemoveに寄せ、StrictMode の開発時 cleanup で駅数が 0 になる問題を防ぎました。Alert.alertが StrictMode で二重表示されないよう、表示中キーで抑止するshowAlertWhilePresentingを追加しました。measureInWindow()由来の画面座標をオーバーレイのローカル座標へ補正し、スポットライト位置のずれを修正しました。AGENTS.mdに明文化しました。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること追加で以下の対象 Jest が通ることを確認しました。
npm test全体は未実行です。関連Issue
スクリーンショット(任意)