Skip to content

縦画面向けのナンバリング改修 - #4892

Merged
TinyKitten merged 3 commits into
devfrom
feature/numbering-layout
Jan 2, 2026
Merged

TinyKitten merged 3 commits into
devfrom
feature/numbering-layout

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jan 2, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • バグ修正

    • 英語の線名が存在しない場合に空の要素が表示されていた問題を修正しました。
    • iOSでのスペーシング表示を改善しました。
  • 新機能

    • カード表示に駅情報のコンテキストを追加し、利便性を向上させました。
    • バス路線の表示ロジックを強化しました。
  • スタイル

    • テキストカラーと記号スタイルを調整しました。

✏️ Tip: You can customize this high-level summary in your review settings.

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

coderabbitai Bot commented Jan 2, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

概要

複数のコンポーネントに targetStation プロップを追加・伝播し、バス路線の表示ロジック、条件付きレンダリング、スタイル調整を実装。CommonCard、TransferLineMark、Transfers 関連コンポーネントを更新。

変更内容

コホート / ファイル(s) 変更の概要
CommonCard コンポーネント更新
src/components/CommonCard.tsx
TransportType と MARK_SHAPE を新規インポート。targetStation プロップを受け入れ。バス判定ロジック (isBus) を追加。マークなし時に TransferLineMark を条件付きレンダリング。
転送マーク処理
src/components/TransferLineMark.tsx
TransportType をインポート。isBus フラグとバスシンボル計算ロジックを追加。バス路線時はバスシンボルを駅番号として使用。
numbering icon スタイル調整
src/components/NumberingIcon*.tsx
NumberingIconOdakyu.tsx: lineSymbol の marginTop を -4 から 8 (iOS) に変更。NumberingIconSquare.tsx: lineSymbol と stationNumber に色 #231e1f を追加。
targetStation プロップ伝播
src/components/StationSearchModal.tsx, src/components/TrainTypeListModal.tsx, src/screens/RouteSearchScreen.tsx, src/screens/SelectLineScreen.tsx
CommonCard 使用箇所で targetStation={item} または targetStation={line.station ?? undefined} を追加。
条件付きレンダリング
src/components/Transfers.tsx, src/components/TransfersYamanote.tsx
line.nameRoman が存在する場合のみ Typography 要素をレンダリング。存在しない場合は何もレンダリングしない。

推定レビュー工数

🎯 2 (Simple) | ⏱️ ~12分

関連する可能性のある PR

ポエム

🐇 ウサギが跳ねる、プロップの道
targetStation 添えて、駅から駅へ
バスのシンボル、条件で輝く
スタイル整えて、デザイン深まる
小さな変化が、大きな流れ ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRのタイトルは「縦画面向けのナンバリング改修」で、変更内容とよく関連しています。複数のコンポーネントでナンバリング表示とレイアウトの調整が行われており、タイトルはこの主要な変更内容を適切に反映しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f30b03 and 9e07398.

📒 Files selected for processing (2)
  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
🧰 Additional context used
📓 Path-based instructions (9)
src/{components,screens}/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Component files should use PascalCase naming (e.g., StationBanner.tsx)

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Biome as the formatter for all code files

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Use Biome as the linter for all code files
Use // biome-ignore only for true compatibility issues and include an inline reason

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{ts,tsx,js,jsx,py,java,go,cs}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx,py,java,go,cs}: Use descriptive names for agents that clearly indicate their purpose and domain
Implement agents with well-defined input/output contracts to ensure clear communication
Document agent responsibilities and expected behaviors in comments or docstrings
Use composition and dependency injection for agent collaboration rather than tight coupling
Implement error handling and graceful degradation in agents to improve system resilience

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Use UTF-8 encoding, two-space indentation, single quotes, and ES5 trailing commas as enforced by .editorconfig.

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{js,ts,tsx,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Biome is authoritative for linting; avoid // biome-ignore unless a rule is truly incompatible and document the rationale inline.

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Name components with PascalCase (e.g., StationBanner.tsx).

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Name hooks with use* prefix (e.g., useStationFeed.ts).

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Keep comments purposeful: explain intent or non-obvious constraints, not obvious mechanics.

Files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4448
File: functions/src/funcs/tts.ts:214-232
Timestamp: 2025-08-11T20:23:23.071Z
Learning: PR #4448 in TrainLCD/MobileApp is specifically about AI feedback summarization and labeling functionality, not about TTS (Text-to-Speech) improvements. The TTS code changes appear to be part of a modularization refactoring but are not the focus of this PR.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4595
File: src/components/LineBoardEast.tsx:497-504
Timestamp: 2025-11-03T12:13:46.409Z
Learning: In TrainLCD/MobileApp LineBoard components (LineBoardEast, LineBoardWest, LineBoardSaikyo, LineBoardToei, LineBoardJRKyushu), the correct implementation pattern is to apply the dynamic width (dim.width / 9) to the outer stationNameContainer View, as implemented in LineBoardEast, not to the inner wrapper View.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
📚 Learning: 2026-01-02T09:13:09.701Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4890
File: src/components/LineBoard.tsx:41-50
Timestamp: 2026-01-02T09:13:09.701Z
Learning: In LineBoard.tsx for bus lines (TransportType.Bus), only the `nameRoman` field requires parentheses removal via `parenthesisRegexp.replace()`. Other language fields (name, nameKatakana, nameChinese, nameKorean) should remain unchanged in the slicedLeftStations mapping.

Applied to files:

  • src/components/Transfers.tsx
  • src/components/TransfersYamanote.tsx
📚 Learning: 2025-07-18T11:04:45.459Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4396
File: src/components/TrainTypeBoxJRKyushu.tsx:176-183
Timestamp: 2025-07-18T11:04:45.459Z
Learning: TrainTypeBoxJRKyushuコンポーネントでは、trainTypeNameとprevTrainTypeNameは常に文字列となるため、.split()メソッドを使用する際のnull安全性チェックは不要である。これらの変数はuseMemoとuseLazyPreviousを通じて管理され、translate()関数からのフォールバック値により常に文字列が保証される。

Applied to files:

  • src/components/TransfersYamanote.tsx
📚 Learning: 2025-05-19T10:59:37.813Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Applied to files:

  • src/components/TransfersYamanote.tsx
📚 Learning: 2025-11-03T12:13:46.409Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4595
File: src/components/LineBoardEast.tsx:497-504
Timestamp: 2025-11-03T12:13:46.409Z
Learning: In TrainLCD/MobileApp LineBoard components (LineBoardEast, LineBoardWest, LineBoardSaikyo, LineBoardToei, LineBoardJRKyushu), the correct implementation pattern is to apply the dynamic width (dim.width / 9) to the outer stationNameContainer View, as implemented in LineBoardEast, not to the inner wrapper View.

Applied to files:

  • src/components/TransfersYamanote.tsx
🧬 Code graph analysis (2)
src/components/Transfers.tsx (1)
src/constants/regexp.ts (1)
  • parenthesisRegexp (1-1)
src/components/TransfersYamanote.tsx (1)
src/constants/regexp.ts (1)
  • parenthesisRegexp (1-1)
🔇 Additional comments (2)
src/components/Transfers.tsx (1)

193-197: LGTM!

line.nameRomanが存在しない場合に空のTypographyをレンダリングしないようにする改善です。既存の中国語・韓国語名の条件付きレンダリング(198-205行目)と一貫性があります。

src/components/TransfersYamanote.tsx (1)

128-132: LGTM!

Transfers.tsxと同様の改善で、line.nameRomanが存在しない場合の空要素レンダリングを回避しています。両コンポーネント間で一貫性が保たれています。


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: 1

♻️ Duplicate comments (1)
src/components/TrainTypeListModal.tsx (1)

170-170: 不要な null 合体演算子(重複)

Line 154 と同様に、?? undefined は不要です。

🧹 Nitpick comments (1)
src/components/TrainTypeListModal.tsx (1)

154-154: 不要な null 合体演算子

line.station は既に Station | null | undefined 型で、targetStation プロパティは Station | undefined を受け入れるため、?? undefined は不要です。TypeScript が自動的に null を処理します。

🔎 提案される修正
-          targetStation={line.station ?? undefined}
+          targetStation={line.station ?? undefined}

または単に:

-          targetStation={line.station ?? undefined}
+          targetStation={line.station}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9ed841 and 9f30b03.

📒 Files selected for processing (9)
  • src/components/CommonCard.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/NumberingIconSquare.tsx
  • src/components/StationSearchModal.tsx
  • src/components/TrainTypeListModal.tsx
  • src/components/TransferLineMark.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/screens/SelectLineScreen.tsx
🧰 Additional context used
📓 Path-based instructions (9)
src/{components,screens}/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Component files should use PascalCase naming (e.g., StationBanner.tsx)

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Biome as the formatter for all code files

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Use Biome as the linter for all code files
Use // biome-ignore only for true compatibility issues and include an inline reason

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{ts,tsx,js,jsx,py,java,go,cs}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx,py,java,go,cs}: Use descriptive names for agents that clearly indicate their purpose and domain
Implement agents with well-defined input/output contracts to ensure clear communication
Document agent responsibilities and expected behaviors in comments or docstrings
Use composition and dependency injection for agent collaboration rather than tight coupling
Implement error handling and graceful degradation in agents to improve system resilience

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Use UTF-8 encoding, two-space indentation, single quotes, and ES5 trailing commas as enforced by .editorconfig.

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{js,ts,tsx,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Biome is authoritative for linting; avoid // biome-ignore unless a rule is truly incompatible and document the rationale inline.

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Name components with PascalCase (e.g., StationBanner.tsx).

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Name hooks with use* prefix (e.g., useStationFeed.ts).

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Keep comments purposeful: explain intent or non-obvious constraints, not obvious mechanics.

Files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
🧠 Learnings (8)
📓 Common learnings
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4448
File: functions/src/funcs/tts.ts:214-232
Timestamp: 2025-08-11T20:23:23.071Z
Learning: PR #4448 in TrainLCD/MobileApp is specifically about AI feedback summarization and labeling functionality, not about TTS (Text-to-Speech) improvements. The TTS code changes appear to be part of a modularization refactoring but are not the focus of this PR.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4595
File: src/components/LineBoardEast.tsx:497-504
Timestamp: 2025-11-03T12:13:46.409Z
Learning: In TrainLCD/MobileApp LineBoard components (LineBoardEast, LineBoardWest, LineBoardSaikyo, LineBoardToei, LineBoardJRKyushu), the correct implementation pattern is to apply the dynamic width (dim.width / 9) to the outer stationNameContainer View, as implemented in LineBoardEast, not to the inner wrapper View.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T03:10:26.328Z
Learning: Code review and feedback should be provided in Japanese
📚 Learning: 2025-05-19T10:59:37.813Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Applied to files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
📚 Learning: 2025-12-20T09:29:40.164Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4758
File: src/components/TypeChangeNotify.tsx:663-672
Timestamp: 2025-12-20T09:29:40.164Z
Learning: In TrainLCD/MobileApp TypeChangeNotify component (src/components/TypeChangeNotify.tsx), the centerCircle size differences across themes (MetroBars, SaikyoBars, JOBars) are intentional design decisions. JOBars uses larger non-tablet dimensions (32x32, borderRadius 16) compared to the base style (24x24, borderRadius 15) to maintain theme-specific visual identity.

Applied to files:

  • src/components/NumberingIconSquare.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/components/NumberingIconOdakyu.tsx
  • src/components/NumberingIconRound.tsx
  • src/components/CommonCard.tsx
📚 Learning: 2026-01-02T09:13:09.701Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4890
File: src/components/LineBoard.tsx:41-50
Timestamp: 2026-01-02T09:13:09.701Z
Learning: In LineBoard.tsx for bus lines (TransportType.Bus), only the `nameRoman` field requires parentheses removal via `parenthesisRegexp.replace()`. Other language fields (name, nameKatakana, nameChinese, nameKorean) should remain unchanged in the slicedLeftStations mapping.

Applied to files:

  • src/components/NumberingIconSquare.tsx
  • src/screens/SelectLineScreen.tsx
  • src/components/TransferLineMark.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
📚 Learning: 2025-11-25T03:10:26.328Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T03:10:26.328Z
Learning: Applies to src/{components,screens}/**/*.tsx : Component files should use PascalCase naming (e.g., `StationBanner.tsx`)

Applied to files:

  • src/screens/SelectLineScreen.tsx
  • src/components/TrainTypeListModal.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/components/StationSearchModal.tsx
  • src/components/CommonCard.tsx
📚 Learning: 2025-11-03T12:13:46.409Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4595
File: src/components/LineBoardEast.tsx:497-504
Timestamp: 2025-11-03T12:13:46.409Z
Learning: In TrainLCD/MobileApp LineBoard components (LineBoardEast, LineBoardWest, LineBoardSaikyo, LineBoardToei, LineBoardJRKyushu), the correct implementation pattern is to apply the dynamic width (dim.width / 9) to the outer stationNameContainer View, as implemented in LineBoardEast, not to the inner wrapper View.

Applied to files:

  • src/components/TrainTypeListModal.tsx
  • src/components/CommonCard.tsx
📚 Learning: 2025-06-18T17:29:46.085Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4359
File: src/components/TrainTypeList.tsx:1-1
Timestamp: 2025-06-18T17:29:46.085Z
Learning: When analyzing React import changes in TypeScript/JavaScript files, carefully verify that React.Fragment, React.createElement, or other React namespace usages actually exist in the code before flagging them as issues. Don't assume React.Fragment is used just because the default React import was removed.

Applied to files:

  • src/components/CommonCard.tsx
📚 Learning: 2025-07-18T11:04:45.459Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4396
File: src/components/TrainTypeBoxJRKyushu.tsx:176-183
Timestamp: 2025-07-18T11:04:45.459Z
Learning: TrainTypeBoxJRKyushuコンポーネントでは、trainTypeNameとprevTrainTypeNameは常に文字列となるため、.split()メソッドを使用する際のnull安全性チェックは不要である。これらの変数はuseMemoとuseLazyPreviousを通じて管理され、translate()関数からのフォールバック値により常に文字列が保証される。

Applied to files:

  • src/components/CommonCard.tsx
🧬 Code graph analysis (1)
src/components/CommonCard.tsx (1)
src/constants/numbering.ts (2)
  • MARK_SHAPE (1-37)
  • NUMBERING_ICON_SIZE (39-43)
🔇 Additional comments (13)
src/components/NumberingIconOdakyu.tsx (1)

35-35: LGTM!

iOS向けのmarginTop調整により、縦画面でのナンバリング表示が改善されます。

src/screens/SelectLineScreen.tsx (1)

653-653: LGTM!

targetStation propの追加により、CommonCardがより文脈に応じたレンダリング(バス路線対応など)が可能になります。

src/screens/RouteSearchScreen.tsx (1)

297-297: LGTM!

検索結果の駅をtargetStationとしてCommonCardに渡すことで、より適切なレンダリングが可能になります。

src/components/NumberingIconSquare.tsx (1)

83-83: これは意図的な設計です。コンポーネントの形状により色値が異なります。

ナンバリングアイコンコンポーネントの色値の違いは意図的な設計です。Square形状のコンポーネント(NumberingIconSquare.tsx)は#231e1f、Round形状のコンポーネント(NumberingIconRound.tsx、NumberingIconRoundHorizontal.tsx、NumberingIconOdakyu.txzなど)は#221714を使用しており、コンポーネントの視覚的アイデンティティを維持する設計になっています。

src/components/StationSearchModal.tsx (1)

170-170: LGTM!

targetStation プロパティの追加が正しく実装されています。

src/components/TransferLineMark.tsx (2)

63-64: バス路線のシンボル抽出ロジックが適切に実装されています

全角数字を削除してから最初の文字を取得する実装は、バス路線番号の表示に適しています。


196-203: LGTM!

バス路線とその他の路線で stationNumber を適切に切り替えています。

src/components/CommonCard.tsx (6)

7-9: LGTM!

必要なインポートが適切に追加されています。


19-19: LGTM!

targetStation プロパティの追加により、駅固有のナンバリング情報を渡せるようになっています。


56-61: LGTM!

マークなしの場合のスタイルが適切に定義されています。スケール変換は既存パターンと一致しています。


169-169: LGTM!

バス路線の判定ロジックが明確です。


195-199: 可読性の向上

titleOrLineName をブロック形式の useMemo に変更したことで、コードが読みやすくなっています。


247-263: 空文字列では「-00」フォールバックは発動しません

レビューコメントの懸念について検証しました。実際には、targetStationNumber が undefined の場合、CommonCard は空文字列 '' を TransferLineMark に渡します(line 258)。TransferLineMark のフォールバック(line 196-203)は stationNumber ?? fallback で、nullish coalescing 演算子(??)は null または undefined のみ をチェックするため、空文字列 '' に対しては発動しません。つまり、'' ?? '-00' は '' を返し、'-00' は表示されません。

Comment thread src/components/NumberingIconRound.tsx 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