Skip to content

LineDotの到着予想分数表示の不具合を修正 - #6331

Merged
TinyKitten merged 3 commits into
devfrom
fix/estimated-minutes-display
Jul 2, 2026
Merged

TinyKitten merged 3 commits into
devfrom
fix/estimated-minutes-display

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

概要

変更の種類

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

変更内容

  • 到着予想分数(ETA)の基準時刻を、現在駅の到着時刻ではなく出発時刻に変更し、停車中に後続駅のETAがズレて表示される不具合を修正
  • 停車中の現在駅自身のLineDotにはETAを表示しないよう、計算結果によらず明示的に除外する処理を追加
  • LineDotの到着予想分数テキストについて、iOSでの文字間隔(letterSpacing)を調整
  • 上記のETA基準時刻拡張(departureCumulativeMinutes)に伴い、GraphQLの型定義(graphql.d.ts)・クエリ(queries.ts)を再生成

テスト

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

関連Issue

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

Summary by CodeRabbit

  • 新機能
    • 経路取得や駅ID一覧取得に対応し、より詳細なルート情報を扱えるようになりました。
  • 不具合修正
    • 到着予測で停車時間を考慮した表示に改善し、後続駅のETAずれを抑えました。
    • 現在駅が一覧に残ってしまう表示不整合を修正しました。
    • iOSでの時刻表示の文字間を調整し、見た目の違和感を軽減しました。

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

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: 00738309-05c9-44c6-a9ee-570fc58293b3

📥 Commits

Reviewing files that changed from the base of the PR and between ca5a9a3 and d0f4453.

📒 Files selected for processing (1)
  • src/hooks/useEstimateArrivalTimes.test.tsx
📝 Walkthrough

Walkthrough

到着予測時刻の基準計算にdepartureCumulativeMinutesを導入し、GraphQLスキーマにTrainRoute関連型やGetStationsByIds型を追加、対応クエリを拡張。useEstimateArrivalTimesのフィルタ条件を修正し、LineDotのletterSpacingをPlatform別に調整した。

Changes

到着予測基準時刻の修正

Layer / File(s) Summary
GraphQL型定義の拡張
src/@types/graphql.d.ts
departureCumulativeMinutesフィールド、TrainRouteResponse/TrainRouteSegment/QueryTrainRouteArgs型、GetStationsByIdsQuery関連型を新規追加。
クエリのフィールド追加
src/lib/graphql/queries.ts
ESTIMATE_ARRIVAL_TIMESクエリで各stopにdepartureCumulativeMinutesを取得するよう拡張。
基準時刻算出とフィルタ条件の変更
src/hooks/useEstimateArrivalTimes.ts
baseMinutesの算出をcumulativeMinutesからdepartureCumulativeMinutesに変更し、relativeStopsから現在駅のgroupIdを明示的に除外。
LineDot表示の微調整
src/components/LineBoard/shared/components/LineDot.tsx
estimatedMinutesTextのletterSpacingをPlatform.OSに応じてiosは0、それ以外は-1に変更。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Query as ESTIMATE_ARRIVAL_TIMES
  participant Hook as useEstimateArrivalTimes
  participant UI as LineDot

  Query->>Hook: routes.stops[].departureCumulativeMinutes
  Hook->>Hook: baseMinutesをdepartureCumulativeMinutesから算出
  Hook->>Hook: currentStation.groupIdをrelativeStopsから除外
  Hook->>UI: relativeStopsを提供してestimatedMinutesTextを表示
Loading

Possibly related PRs

  • TrainLCD/MobileApp#6320: useEstimateArrivalTimesの基準時刻算出とフィルタ条件の変更は、このPRで導入されたestimateArrivalTimesクエリとuseEstimateArrivalTimesフックの実装を直接拡張している。
  • TrainLCD/MobileApp#6321: useEstimateArrivalTimesの変更がestimatedRoute.stopsデータに影響し、このPRで実装されたLineDotによるLineBoard上の到着予測表示に直結する。

Poem

ぴょんと跳ねて 分数直す
出発時刻を 基準にすえて
現在駅は もう混ざらない 🐰
iOSの文字も すこし詰めて
トンネル抜けたら 型も増えたよ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 主要な変更であるLineDotの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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/estimated-minutes-display

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/useEstimateArrivalTimes.ts`:
- Around line 133-151: Add test coverage in useEstimateArrivalTimes.test.tsx for
the new base-minute logic in useEstimateArrivalTimes: verify that relative ETA
calculation uses departureCumulativeMinutes as the offset when the current
station is inside windowStops, and add a case where currentStation is not found
so baseMinutes falls back to 0. Also assert that the current station is still
excluded from relativeStops in both scenarios, especially when the fallback path
would otherwise leave a non-offset value visible.
🪄 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: 02cdbccb-7a48-4503-8308-152f7082e163

📥 Commits

Reviewing files that changed from the base of the PR and between 9e9feb5 and ca5a9a3.

📒 Files selected for processing (4)
  • src/@types/graphql.d.ts
  • src/components/LineBoard/shared/components/LineDot.tsx
  • src/hooks/useEstimateArrivalTimes.ts
  • src/lib/graphql/queries.ts

Comment thread src/hooks/useEstimateArrivalTimes.ts Resolved
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