Repository navigation
逆走通知設定がOFFのときは検知ロジック自体を停止してCPU消費とatom書き込みを完全に止める - #5957
Merged
TinyKitten merged 1 commit intoMay 12, 2026
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 Walkthrough概要
変更内容間違った方向検出の機能フラグ統合
🎯 2 (Simple) | ⏱️ ~12 分
🚥 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
逆走通知設定が OFF のときも検知ロジック (
useWrongDirectionDetectorEffect) が常時動いていたため、位置情報更新のたびにgetDistance計算と atom 書き込みが発生していた。OFF のときは検知ロジック自体を完全停止し、CPU 消費とバッテリー消費を最小化する。変更の種類
変更内容
useWrongDirectionDetectorEffectの早期 return 条件にwrongDirectionNotifyEnabled === falseを追加。OFF のときresetDetectionState()で atom を初期値に戻し、getDistance計算と atom 書き込みを完全停止する。notifyStateatom を依存に追加し、wrongDirectionNotifyEnabledを useEffect の依存配列に含めることで、ON ⇄ OFF の切り替え時にリセットが反映されるようにした。useWarningInfoのコードは一切触らない。OFF 時はisWrongDirection/isLoopLineWrongDirectionが常にfalseで渡るので、useWarningInfoの逆走警告分岐 (useWarningInfo.ts:131-142) を素通りするだけで、他の警告(offline / badAccuracy / autoMode / longPressNotice 等)は従来通り表示される。useWrongDirectionDetector.test.tsx): OFF 時に検知が動かないこと、判定中に ON → OFF へ切り替えるとリセットされること。回帰リスクと緩和
テスト
npm run lintが通ることnpm testが通ること(useWrongDirectionDetector.test.tsx6 件全パス)npm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit
リリースノート
新機能
テスト