Repository navigation
JSスレッド駆動アニメーションのネイティブ化と検索結果の仮想化などパフォーマンス改善のフォローアップ - #6423
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
📝 WalkthroughWalkthroughスクロール位置の更新をネイティブAnimatedイベントへ移行し、検索結果をFlashListで表示するよう変更しました。駅データ取得を並列化し、ディープリンク初期処理とパッドアーチのアニメーション設定も更新しています。 Changesネイティブスクロール連携
検索結果リスト更新
路線選択データ取得
ランタイムフロー調整
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/screens/RouteSearchScreen.tsx (1)
507-511: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
handleScrollの参照をメモ化してください。現在はレンダーごとに
Animated.eventが再生成されます。ネイティブスクロール連携を安定させるため、useMemoなどで同一参照を維持してください。FlashList v2 でも props のメモ化が重視されています。(shopify.github.io)修正例
- const handleScroll = RNAnimated.event( - [{ nativeEvent: { contentOffset: { y: scrollY } } }], - { useNativeDriver: true } + const handleScroll = useMemo( + () => + RNAnimated.event( + [{ nativeEvent: { contentOffset: { y: scrollY } } }], + { useNativeDriver: true } + ), + [scrollY] );🤖 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/screens/RouteSearchScreen.tsx` around lines 507 - 511, メモ化されていない handleScroll の Animated.event 生成を更新し、レンダー間で同一参照を維持してください。RouteSearchScreen 内の handleScroll を useMemo など既存の React フックで包み、scrollY を依存値として適切に扱いながら useNativeDriver: true の動作は保持してください。
🤖 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/RouteSearchScreen.tsx`:
- Around line 449-463: 検索結果表示時にもウォークスルー計測対象が残るよう、検索結果セルを生成する renderCard 周辺の先頭要素に
searchResultsRef と onLayout を設定してください。ListEmptyComponent に依存せず、検索成功後に存在する先頭セルなどで
measureSearchResults() が実行され、routeSearchResults のスポットライトが更新される状態を維持してください。
---
Nitpick comments:
In `@src/screens/RouteSearchScreen.tsx`:
- Around line 507-511: メモ化されていない handleScroll の Animated.event
生成を更新し、レンダー間で同一参照を維持してください。RouteSearchScreen 内の handleScroll を useMemo など既存の
React フックで包み、scrollY を依存値として適切に扱いながら useNativeDriver: true の動作は保持してください。
🪄 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: 6d8b50fe-9a25-4882-bb58-3a3c487c719f
📒 Files selected for processing (14)
src/components/PadArch.tsxsrc/hooks/useLineSelection.tssrc/providers/DeepLinkProvider.tsxsrc/screens/AndroidSettings.tsxsrc/screens/AppSettings.tsxsrc/screens/BatterySettings.tsxsrc/screens/EnabledLanguagesSettings.tsxsrc/screens/ExperimentalSettings.tsxsrc/screens/Licenses.tsxsrc/screens/NotificationSettings.tsxsrc/screens/RouteSearchScreen.tsxsrc/screens/SelectLineScreen.tsxsrc/screens/TTSSettings.tsxsrc/screens/ThemeSettings.tsx
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <[email protected]>
概要
#6422 のプロファイリングで検出したがスコープ外として残していた改善項目のフォローアップです。JS スレッドを塞いでいたアニメーション・非仮想化リスト・直列フェッチ・ディープリンク処理の過剰なゲートを解消します。
変更の種類
変更内容
useLineSelection: 互いに独立した駅一覧と種別一覧のフェッチをPromise.allで並列化(Main.tsxの既存パターンに整合)。路線選択から方面モーダル表示までの待ち時間が RTT 1 本分短縮PadArch: 乗車中常時走るシェブロンの無限ループアニメーション(opacity / translateY)をuseNativeDriver: true化し、60fps の補間を JS スレッドから排除(height 補間のfillHeightは対象外のまま)scrollY.setValueを JS ハンドラからAnimated.event(..., { useNativeDriver: true })へ移行。Reanimated のAnimated.ScrollViewでは RN の AnimatedEvent がネイティブにアタッチされないことを確認したため、対象画面のスクロールコンポーネントを RN 本体のAnimated.ScrollView/Animated.FlatListに統一RouteSearchScreen: 件数無制限の検索結果を手動行チャンク +.map()の全件マウントからFlashList(numColumns対応・createAnimatedComponentラップでヘッダー連動もネイティブ駆動)へ移行。カード幅・余白は従来と同一になるよう列位置別 padding で再現。検索結果変化時のLinearTransitionレイアウトアニメーションは FlashList のリサイクルと両立しないため削除DeepLinkProvider: ゲート条件を「初期 URL の処理完了まで」に限定。従来は稼働中に受けたランタイムディープリンクの解決中もisLoadingでツリー全体が null になり、表示中の画面が消えてナビゲーション状態が破棄されていた調査のみ(変更なし):
useAndroidWearableの毎秒のメッセージ組み立ては Wear OS 端末の接続状態ゲートで止められるが、ネイティブ側 (NodeClient.connectedNodes+ リスナー) の実装と実機 Wear OS 端末での検証が必要なため今回は見送り。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることフルスイート 192 スイート / 2044 テスト全パス。
関連Issue
スクリーンショット(任意)
Summary by CodeRabbit