Skip to content

出発済み駅にLineDotの到着予想分数が残る不具合を修正 - #6324

Merged
TinyKitten merged 1 commit into
devfrom
fix/departed-station-eta-overlay
Jul 1, 2026
Merged

TinyKitten merged 1 commit into
devfrom
fix/departed-station-eta-overlay

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

概要

出発済みの駅にLineBoardの到着予想分数(ETA)オーバーレイが残ってしまう不具合を修正しました。

変更の種類

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

変更内容

  • useEstimateArrivalTimes でETAの基準駅(0分の起点)に使っていた useCurrentStation()(記録上の生の現在駅)を、LineBoard各コンポーネントの passed/グレーアウト判定と同じ useDisplayCurrentStation()(到着取りこぼし時に前方補正された表示用現在駅)に変更
  • 取りこぼし補正で表示上「出発済み」扱いになった駅について、ETA計算側の基準もそこまで進むようにし、LineDotに残留ETAが表示されないようにした
  • useEstimateArrivalTimes.test.tsx のモック対象を useCurrentStation から useDisplayCurrentStation に更新

テスト

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

関連Issue

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

Summary by CodeRabbit

  • Bug Fixes
    • 到着時刻の表示基準を、画面表示と同じ現在駅に合わせるよう改善しました。
    • これにより、環状線や一部の補正ケースで、出発済みの駅に ETA が残る不自然な表示を抑えました。

@TinyKitten TinyKitten self-assigned this Jul 1, 2026
@github-actions github-actions Bot added the react label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1e164dc8-99d0-449e-bad8-c95f4c048305

📥 Commits

Reviewing files that changed from the base of the PR and between 814cc49 and 41a8273.

📒 Files selected for processing (2)
  • src/hooks/useEstimateArrivalTimes.test.tsx
  • src/hooks/useEstimateArrivalTimes.ts

📝 Walkthrough

Walkthrough

useEstimateArrivalTimesフックにおける現在駅取得の依存元をuseCurrentStationからuseDisplayCurrentStationに変更し、LineBoardと同一の基準駅を参照するようにした。対応するテストファイルのモック対象と戻り値設定も同様に更新された。

Changes

基準駅取得ロジックの変更

Layer / File(s) Summary
実装: currentStation取得元の変更
src/hooks/useEstimateArrivalTimes.ts
useCurrentStationのimportを削除しuseDisplayCurrentStationを追加、baseMinutes算出に使うcurrentStationの取得元を切り替え、LineBoardと同一基準駅を使う旨のコメントを追加。
テスト: モック対象と戻り値設定の更新
src/hooks/useEstimateArrivalTimes.test.tsx
importとjest.mock対象をuseDisplayCurrentStationに変更し、mockUseDisplayCurrentStation参照を追加、beforeEachおよび各テストケース(相対時刻変換、除外条件、環状路線基準駅選択)でのモック戻り値設定を更新。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • TrainLCD/MobileApp#6141: 現在駅取得元をuseCurrentStationからuseDisplayCurrentStationへ切り替える同種の変更をLineBoard側で行っている。

Poem

ぴょんぴょん跳ねて駅を数える
表示の駅こそ真の基準
ズレてた時計もぴったり合わせ
ETAはもう出発済みに残らない
うさぎも安心、次の駅へ 🐰🚃

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 変更内容の中心である出発済み駅にETAが残る不具合修正を的確に要約しています。
Description check ✅ Passed 概要・変更内容・テストの各項目が埋まっており、テンプレート要件を概ね満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/departed-station-eta-overlay

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

@TinyKitten
TinyKitten merged commit 4fae650 into dev Jul 1, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the fix/departed-station-eta-overlay branch July 1, 2026 23:49
@TinyKitten TinyKitten mentioned this pull request Jul 1, 2026
4 of 9 tasks
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.

1 participant