Skip to content

オートモードで終点到着後は1分停車してから方面を逆転して折り返すよう変更 - #6403

Merged
TinyKitten merged 1 commit into
devfrom
claude/auto-mode-endpoint-dwell-oj3zdm
Jul 12, 2026
Merged

TinyKitten merged 1 commit into
devfrom
claude/auto-mode-endpoint-dwell-oj3zdm

Conversation

@TinyKitten

Copy link
Copy Markdown
Member

概要

オートモードで終点に到着した際の挙動を変更しました。従来は終点到着直後に始発駅へ戻っていましたが、約1分間終点で停車したのち、方面(進行方向)を逆転させて折り返すようにしました。実際の折り返し運転に近い挙動になります。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • src/hooks/useSimulationMode.ts: 終点(次の停車セグメントが無い状態)到達時に即座に折り返さず、TERMINAL_DWELL_TICKS(1秒間隔 × 60 ≒ 約1分)ぶん終点で speed: 0 のまま停車させるようにした。
  • 待機完了後、selectedDirection(INBOUND ⇄ OUTBOUND)と selectedBound を逆転させ、終点始発の折り返し運転として継続させる。maybeRevsersedStations と trainRoute クエリはどちらも selectedDirection 由来のため、方向反転だけで駅順・行き先・残り駅表示などが折り返し方向へ切り替わる。
  • 方面逆転中は新方向の速度プロファイルが再生成されるまで終点で停車して待機する reversingRef ガードを追加し、旧方向のプロファイル/ジオメトリで step() して位置が飛ぶ問題を防止。
  • ループ線には折り返す終点が無いため、isLoopLine の場合は従来どおり先頭に戻って同一方向で周回を継続(リグレッション回避)。
  • src/hooks/useSimulationMode.test.tsx: 終点で即折り返さず停車を続けること、約1分後に方面(selectedDirection / selectedBound)が逆転すること、ループ線では逆転せず周回すること、を検証するテストを追加・更新。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

npx jest src/hooks/useSimulationMode.test.tsx(25 件パス)、npm run typecheck、Biome lint を実行し、いずれも成功を確認。関連スイート(useWrongDirectionDetector / useBounds / DevOverlay / trainSpeed)も回帰なし。

関連Issue

スクリーンショット(任意)


🤖 Generated with Claude Code

https://claude.ai/code/session_012dhifdRFT6ZRWghyvrDFzk


Generated by Claude Code

@github-actions github-actions Bot added the react label Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef10df1e-89b5-4d6b-aa34-b51e7a093a78

📥 Commits

Reviewing files that changed from the base of the PR and between ce43d15 and 3ab981c.

📒 Files selected for processing (2)
  • src/hooks/useSimulationMode.test.tsx
  • src/hooks/useSimulationMode.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/auto-mode-endpoint-dwell-oj3zdm

Comment @coderabbitai help to get the list of available commands.

@TinyKitten TinyKitten self-assigned this Jul 12, 2026
@TinyKitten
TinyKitten merged commit 151d7f4 into dev Jul 12, 2026
7 checks passed
@TinyKitten
TinyKitten deleted the claude/auto-mode-endpoint-dwell-oj3zdm branch July 12, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants