Repository navigation
高頻度atom購読の隔離で位置更新ごとの全画面再レンダーを解消 - #6422
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]>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 34 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough高頻度 atom の狭い派生購読を追加し、MainScreen と PermittedLayout の副作用フックを renderless effects コンポーネントへ分離した。PiP の状態購読と各表示分岐での副作用ホストのマウントも更新した。 Changes状態購読と副作用ホスト
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…and-render-stability
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/components/Permitted.tsx`:
- Around line 84-98: Move useWrongDirectionDetectorEffect out of
PermittedLayoutEffects and into the appropriate FxAppleWatchInner and
FxAndroidWearableInner sibling components, so the high-frequency subscription is
isolated from the wearable host and does not trigger both wearable subtrees to
rerender. Preserve platform-specific mounting and keep the detector behavior
active only within the relevant wearable component.
In `@src/screens/Main.tsx`:
- Around line 188-212: MainScreenEffects currently mounts the Android-only
FxAndroidPictureInPicture on every platform, causing useAndroidPictureInPicture
to run on iOS. Update MainScreenEffects to conditionally mount
FxAndroidPictureInPicture only on Android, while preserving the other effects
unchanged.
🪄 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: 7f352996-53fe-41b1-9b39-22a16bee1a47
📒 Files selected for processing (5)
AGENTS.mddocs/state-management.mdsrc/components/Permitted.tsxsrc/screens/Main.tsxsrc/store/atoms/pictureInPicture.ts
Co-Authored-By: Claude Fable 5 <[email protected]>
Fixes Applied SuccessfullyFixed 2 file(s) based on 2 CodeRabbit feedback item(s). Files modified:
Commit: The latest autofix changes are on the |
高頻度atom購読の隔離(#6422)でライブアクティビティ更新フックをiOS限定でマウントするようにした際、 同じフックから呼んでいるAndroidのライブアップデート(Android 16以降)も止まっていた。 通知先を持つプラットフォームでのみマウントする条件へ変更する。 Claude-Session: https://claude.ai/code/session_01XHQB1iKjHbZLmPDKysVpnt Co-authored-by: Claude <[email protected]>
概要
走行中の Main 画面が位置更新(毎秒)のたびに画面全体で再レンダーされていた問題を、実機プロファイルに基づいて解消しました。実機計測(moto g05・オートモード走行、dev ビルド)でレンダー時間合計 259→167ms/秒(−36%)、最大コミット時間 558→234ms(−58%)を確認しています。#6421(未使用スタイル削除・ListFooter/Toast 切り出し)の続きです。
変更の種類
変更内容
locationAtomなど高頻度更新 atom を購読する返り値なしの副作用フックを、MainScreen/PermittedLayout本体からレンダーレスのFx*コンポーネント群(MainScreenEffects/PermittedLayoutEffects)へ隔離し、毎秒の位置更新で約 40 フックの画面全体が再実行されるのを解消(1 フック = 1 コンポーネントに分割してあるのは、React DevTools でフック単位の再レンダーコストを計測可能にするため)pictureInPictureAtomにenabled/activeの narrow 派生 atom を追加し、毎秒書き換わるactivityState(progressを含む)への購読巻き込みを解消useTTS(計測時 51ms/秒の浪費 → ゼロ)、Android でのuseUpdateLiveActivities(iOS 専用機能の派生計算 → ゼロ)、OS 別のウェアラブル連携(useAppleWatch/useAndroidWearable)AGENTS.md/docs/state-management.mdに上記の規約(レンダーレス副作用ホスト・narrow 派生 atom 購読・条件マウントゲート)を追記テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること上記に加えて、実機(moto g05)でオートモード走行・関連画面(乗車画面 E231/SAIKYO テーマ・Privacy・路線選択・テーマ設定・自動アナウンス・表示言語・ライセンス)の巡回とランタイムエラーが無いことを確認し、React DevTools のコミット計測で before/after を比較済み(変更関連の Jest 36 スイート 406 テストもパス)。
関連Issue
スクリーンショット(任意)