オートモードの折り返し時にTTSの初回放送を再発火するよう変更#6408
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dhifdRFT6ZRWghyvrDFzk
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 45 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 (1)
📝 WalkthroughWalkthrough終点到達後の折り返し開始時に Changesシミュレーション折り返し音声制御
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant useSimulationMode
participant store
participant resetFirstSpeechAtom
participant TTS
useSimulationMode->>store: 現在値を取得
useSimulationMode->>store: 値を1増加
store->>resetFirstSpeechAtom: 更新を反映
resetFirstSpeechAtom->>TTS: 初回スピーチを再発火
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/hooks/useSimulationMode.test.tsx`:
- Around line 663-667: Update the store.get mock for resetFirstSpeechAtom in the
affected tests to return a nonzero current value such as 3, while continuing to
return the location object for locationAtom. Assert that the update sets the
value to 4 and verify the setter is called exactly once, covering both the
“current value + 1” behavior and duplicate updates.
🪄 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: 2cf5aeef-8ac6-4074-a2b9-c0208201679b
📒 Files selected for processing (2)
src/hooks/useSimulationMode.test.tsxsrc/hooks/useSimulationMode.ts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dhifdRFT6ZRWghyvrDFzk
概要
オートモードの折り返し(終点で約1分停車後に方面を逆転して折り返す挙動、#6403 で追加)に続く変更です。折り返して新しい行き先へ発車する際、TTS の初回放送(「この電車は〜行きです」)が改めて再生されるようにしました。
変更の種類
変更内容
src/hooks/useSimulationMode.ts: 終点での待機完了後に方面(selectedDirection/selectedBound)を逆転させるタイミングでresetFirstSpeechAtomをインクリメントするようにした。これによりuseTTS側でfirstSpeechがtrueに戻る。selectedBound)の変更と併せてfirstSpeechが再セットされるため、useTTSの抑止ロジック(suppressFirstSpeechUntilDepartureRef/computeSuppressionDecision)により終点停車中(arrived=true)は再生されず、折り返して発車した後(arrived=false)に初回放送が改めて再生される。src/hooks/useSimulationMode.test.tsx: 折り返し前はresetFirstSpeechが発火しないこと、折り返し時にresetFirstSpeechがインクリメントされること(初回放送の再発火)を検証するアサーションを追加。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることnpx jest src/hooks/useSimulationMode.test.tsx(25 件パス)、npm run typecheck、Biome lint を実行し、いずれも成功を確認。関連Issue
Refs #6403
スクリーンショット(任意)
🤖 Generated with Claude Code
https://claude.ai/code/session_012dhifdRFT6ZRWghyvrDFzk
Generated by Claude Code
Summary by CodeRabbit