Skip to content

ナンバリング関係のバグを修正 - #5617

Merged
TinyKitten merged 3 commits into
devfrom
fix/numbering
Mar 19, 2026
Merged

TinyKitten merged 3 commits into
devfrom
fix/numbering

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Mar 19, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • バグ修正

    • 駅番号データをラインマーク生成に統合し、駅番号変更時に表示が正しく更新されるよう改善
    • 乗換表示の空欄扱いとフォールバック挙動を調整
  • 改善

    • 駅番号アイコンがサイズ指定に対応し、端末ごとの表示品質を向上
    • 一部遅延計算の依存関係を見直し、表示の安定性を向上
  • スタイル

    • 駅番号・ライン表示のタイポグラフィ調整で表示の一貫性を改善

@github-actions github-actions Bot added the react label Mar 19, 2026
@coderabbitai

coderabbitai Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

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: 9b4db3d1-a554-4d80-bfd0-c65cca6f38f5

📥 Commits

Reviewing files that changed from the base of the PR and between 6d6608d and b4fd449.

📒 Files selected for processing (2)
  • src/components/NumberingIconMonochromeRound.tsx
  • src/components/Transfers.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/NumberingIconMonochromeRound.tsx

📝 Walkthrough

Walkthrough

複数のコンポーネントが getLineMarkFunc / getLineMark 呼び出しに stationNumbers 引数を追加し、これに合わせて useGetLineMark のシグネチャと内部ロジックを変更しました。番号表示コンポーネントのサイズ・表示ロジックといくつかの依存配列も調整されています。

Changes

Cohort / File(s) Summary
Hook updates
src/hooks/useGetLineMark.ts, src/hooks/useCurrentStation.ts
useGetLineMark が stationNumbers?: Maybe<StationNumber[]> を受け取るように変更。sign/signShape 等を stationNumbers[0..2] から決定するように変更。useCurrentStation の undefined ハンドリングをより慣用的に修正。
Line mark propagation
src/components/CommonCard.tsx, src/components/HeaderJRWest.tsx, src/components/PadLineMarks.tsx, src/components/PresetCard.tsx, src/components/Transfers.tsx, src/components/TransfersYamanote.tsx, src/components/TransferLineMark.tsx
getLineMarkFunc / getLineMark の呼び出しに stationNumbers を追加。依存配列を拡張して stationNumbers の変化で再計算されるように。TransferLineMark は stationNumber 表示ロジックを useMemo にまとめて変更。
LineBoardWest refactor & tests
src/components/LineBoardWest.tsx, src/components/LineBoardWest.test.tsx
useGetLineMark の使用と line に依存するロジックを除去。useStationNumberingData の引数を簡素化し依存配列を縮小。テストのモック/アサーションを調整。
Yamanote / pad components
src/components/LineBoardYamanotePad.tsx, src/components/PadLineMarks.tsx
useStationNumberIndexFunc を削除し、stationNumbers を直接渡して第1要素から番号/色を取得するように簡素化。Pad の line-mark 呼び出しに stationNumbers を追加。
Numbering icon changes
src/components/NumberingIcon.tsx, src/components/NumberingIconMonochromeRound.tsx, src/components/NumberingIconRoundHorizontal.tsx, src/components/NumberingIconReversedRoundHorizontal.tsx
NumberingIcon が size を転送。NumberingIconMonochromeRound に size? を追加し、サイズ別スタイルと表示テキストルール(SMALL はハイフン前のみなど)を導入。いくつかのタイポグラフィサイズ調整とスタイル統合を実施。
Transfer rendering adjustments
src/components/Transfers.tsx, src/components/TransfersYamanote.tsx
空シンボル分岐のデフォルトを削除し、renderTransferLine 内で station が falsy の早期 return を除去。getLineMarkFunc に line?.station?.stationNumbers を明示渡しに変更。
Type/literal tightening
src/lineSymbolImage.ts
LINE_SYMBOL_IMAGE_WITH_COLOR / LINE_SYMBOL_IMAGE_GRAYSCALE に as const satisfies Record<...> を追加して型制約を厳格化。

Sequence Diagram(s)

(該当なし)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

react

Poem

🐰 駅番号を抱えてぴょんと跳び、
線の印は新しい道へ、
フックは広がり、アイコンは縮み、
コンポーネントが手を取り合えば、
小さな変更で景色が変わるよ 🚆

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは「ナンバリング関係のバグを修正」で、変更内容全体を適切に表しています。多数のコンポーネントとフックが駅番号データ(stationNumbers)の処理方法を改善するために更新されており、これはナンバリング機能に関連する修正です。タイトルは主な変更内容を簡潔かつ明確に示しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/numbering
📝 Coding Plan
  • Generate coding plan for human review comments

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

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/NumberingIconMonochromeRound.tsx`:
- Around line 12-25: NumberingIconMonochromeRound's smallRoot/mediumRoot lack
the white background and black border and numOnly returns numOnlyStationNumber
before size logic causing non-dash values to render large in a small circle;
update the smallRoot and mediumRoot style objects to include backgroundColor:
'white', borderWidth: 1 and borderColor: 'black' (and ensure borderRadius
remains correct), and change the numOnly logic inside
NumberingIconMonochromeRound so that either (A) size-based handling runs before
returning numOnlyStationNumber or (B) numOnlyStationNumber is only returned when
the value contains a '-' (fallback to the normal numeric rendering for other
values); this will preserve correct sizing for SMALL/MEDIUM when PresetCard
passes SMALL.

In `@src/components/Transfers.tsx`:
- Around line 141-144: The line mark is using station.stationNumbers while other
places use the transfer line's station numbers, causing misalignment when the
transfer is to a different station; update the getLineMarkFunc call in
Transfers.tsx (the const lineMark assignment) to pass stationNumbers taken from
the transfer line's station object (use line.station?.stationNumbers, falling
back to station.stationNumbers if needed) so the left/right marks stay
consistent with line.station.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf0d5864-9a4b-4700-8254-8ef49d8b90b1

📥 Commits

Reviewing files that changed from the base of the PR and between f244e59 and 6d6608d.

📒 Files selected for processing (17)
  • src/components/CommonCard.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/LineBoardWest.test.tsx
  • src/components/LineBoardWest.tsx
  • src/components/LineBoardYamanotePad.tsx
  • src/components/NumberingIcon.tsx
  • src/components/NumberingIconMonochromeRound.tsx
  • src/components/NumberingIconReversedRoundHorizontal.tsx
  • src/components/NumberingIconRoundHorizontal.tsx
  • src/components/PadLineMarks.tsx
  • src/components/PresetCard.tsx
  • src/components/TransferLineMark.tsx
  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
  • src/hooks/useCurrentStation.ts
  • src/hooks/useGetLineMark.ts
  • src/lineSymbolImage.ts
💤 Files with no reviewable changes (1)
  • src/components/LineBoardWest.test.tsx

Comment thread src/components/Transfers.tsx Resolved
@TinyKitten TinyKitten self-assigned this Mar 19, 2026
@TinyKitten
TinyKitten merged commit b1063ab into dev Mar 19, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/numbering branch March 19, 2026 08:15
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