Skip to content

ETA実装LineBoardの最後尾ドット右隣に残り分数の単位(分/min./분)を表示#6428

Merged
TinyKitten merged 6 commits into
devfrom
claude/lineboard-eta-minute-display-ledre1
Jul 16, 2026
Merged

ETA実装LineBoardの最後尾ドット右隣に残り分数の単位(分/min./분)を表示#6428
TinyKitten merged 6 commits into
devfrom
claude/lineboard-eta-minute-display-ledre1

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 16, 2026

Copy link
Copy Markdown
Member

概要

ETA(残り分数)を実装しているLineBoardで、最後尾の駅ドットの右隣に単位ラベルを表示するようにした。単位はヘッダーの言語Stateに追従し、日本語・かな・中国語では「分」、英語では「min.」、韓国語では「분」を表示する。

変更の種類

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

変更内容

  • 共有コンポーネント EstimatedMinutesUnitLabel を新設。ヘッダー言語Stateから単位文字列(分 / min. / 분)を導出するderived atomを購読し、単位が実際に変わったときだけ再レンダーされるようにした
  • 共有 LineDotisLast プロパティを追加し、最後尾セルかつETA数字表示中のみドット右隣へ単位ラベルを描画(LineBoardEast / LineBoardSaikyo / LineBoardToei / LineBoardJRKyushu が対象)
  • 独自ドット実装の LineBoardE231 / LineBoardJO にも同条件で単位ラベルを追加
  • ラベルは白太字+黒縁取り(textShadow)で路線色バー上でも判読できるようにし、ドットとの間隔をタブレット24px / スマホ16pxに設定
  • 単体テストを追加・更新(言語Stateごとの表記、最後尾ドットのみに表示されること)

補足: LineBoardYamanotePad(PadArch)もETAを実装しているが、アーチ状レイアウトでドット右隣に駅名が配置されており衝突するため今回は対象外とした。小田急テーマ(LineBoardEastの isOdakyu)はETA自体が対象外のため表示されない。

テスト

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

関連Issue

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

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

coderabbitai Bot commented Jul 16, 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: 42 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: 0543b6c4-c251-48da-ac02-488a903b8197

📥 Commits

Reviewing files that changed from the base of the PR and between f9b0406 and 9f7f669.

📒 Files selected for processing (4)
  • src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx
  • src/components/LineBoard/shared/components/LineDot.tsx
  • src/components/LineBoardE231.tsx
  • src/components/LineBoardJO.tsx
📝 Walkthrough

Walkthrough

ETA表示に言語別の単位ラベルを追加し、終端駅かつETAが存在する場合だけ表示するよう各LineBoardとLineDotを更新しました。日本語・英語・韓国語などの表示と、終端駅判定のテストも追加しています。

Changes

ETA単位ラベル表示

Layer / File(s) Summary
単位ラベルの実装
src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.tsx, src/components/LineBoard/shared/components/index.ts, src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx
ヘッダー状態に応じて「分」「min.」「분」を表示するコンポーネントを追加し、各言語状態をテストしています。
LineDotの終端駅表示
src/components/LineBoard/shared/components/LineDot.tsx, src/components/LineBoard/shared/components/LineDot.test.tsx
isLast とETAの有無に基づき、終端駅だけに単位ラベルを表示します。
E231・JOの終端駅接続
src/components/LineBoardE231.tsx, src/components/LineBoardE231.test.tsx, src/components/LineBoardJO.tsx, src/components/LineBoardJO.test.tsx
E231とJOで終端駅のETA単位ラベルを配置し、表示条件をテストしています。
各LineBoardの終端駅情報伝達
src/components/LineBoardEast.tsx, src/components/LineBoardEast.test.tsx, src/components/LineBoardJRKyushu.tsx, src/components/LineBoardJRKyushu.test.tsx, src/components/LineBoardSaikyo.tsx, src/components/LineBoardToei.tsx
各LineBoardが終端駅の判定結果をLineDotへ渡すよう更新しています。

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

Sequence Diagram(s)

sequenceDiagram
  participant LineBoard
  participant LineDot
  participant headerStateAtom
  participant EstimatedMinutesUnitLabel
  LineBoard->>LineDot: 駅情報、ETA、isLastを渡す
  LineDot->>EstimatedMinutesUnitLabel: 終端駅のETA単位を描画
  EstimatedMinutesUnitLabel->>headerStateAtom: 言語状態を購読
  headerStateAtom-->>EstimatedMinutesUnitLabel: 分 / min. / 분を返却
Loading

Possibly related PRs

  • TrainLCD/MobileApp#6321: LineDotのETAオーバーレイ表示に関する変更が重なっています。
  • TrainLCD/MobileApp#6350: estimatedMinutesの受け渡し元を変更しており、今回の表示条件に関係します。
  • TrainLCD/MobileApp#6353: ETAオーバーレイとEstimatedMinutesBadge周辺の表示変更が関連しています。

Poem

ぴょんと終点、ETAを見つけ
「分」のしるしをそっと添える
英語なら min. に変わり
韓国語なら 분 になる
駅の列にも月明かり
うさぎは満足、耳ぴょこり 🐇

🚥 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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/lineboard-eta-minute-display-ledre1

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/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx`:
- Around line 22-50: EstimatedMinutesUnitLabel のテストスイートに afterEach
フックを追加し、各テスト終了後に jest.clearAllMocks() を呼び出してモックの呼び出し履歴をリセットしてください。
🪄 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: acba4eb3-0d69-46b3-bfb1-54fee7f1b540

📥 Commits

Reviewing files that changed from the base of the PR and between 8251d6d and f9b0406.

📒 Files selected for processing (15)
  • src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx
  • src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.tsx
  • src/components/LineBoard/shared/components/LineDot.test.tsx
  • src/components/LineBoard/shared/components/LineDot.tsx
  • src/components/LineBoard/shared/components/index.ts
  • src/components/LineBoardE231.test.tsx
  • src/components/LineBoardE231.tsx
  • src/components/LineBoardEast.test.tsx
  • src/components/LineBoardEast.tsx
  • src/components/LineBoardJO.test.tsx
  • src/components/LineBoardJO.tsx
  • src/components/LineBoardJRKyushu.test.tsx
  • src/components/LineBoardJRKyushu.tsx
  • src/components/LineBoardSaikyo.tsx
  • src/components/LineBoardToei.tsx

@TinyKitten
TinyKitten merged commit 2907656 into dev Jul 16, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the claude/lineboard-eta-minute-display-ledre1 branch July 16, 2026 12:04
This was referenced Jul 16, 2026
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