Skip to content

Headerコンポの構造改善&データ上存在しない英中韓駅名のスキップ - #4882

Merged
TinyKitten merged 5 commits into
devfrom
feature/header-improve
Jan 2, 2026
Merged

TinyKitten merged 5 commits into
devfrom
feature/header-improve

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jan 2, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • リファクタリング

    • ヘッダー群を共通化しアニメーションとデータ供給を統一。複数コンポーネントのコード量を削減し保守性を向上しました(外観・挙動に目立った変更なし)。
  • 新機能

    • ヘッダー向けの共有フックと型を公開し、統一的なアニメーション/データ取得が可能になりました。
  • テスト

    • ヘッダー関連のテストを拡充し、各種ケースで安定性が向上しました。
  • ドキュメント

    • 変更概要と指標を更新しました。

✏️ 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

Walkthrough

ヘッダーを大規模にプロップ駆動へリファクタ。共通アニメーションと共通データを新規フック(useHeaderAnimation、useHeaderCommonData)へ抽出し、共通型を追加。複数ヘッダーでの内部状態/アニメーションが統一され約1,800行削減。

Changes

Cohort / File(s) 変更内容
新規共有フックと型定義
src/hooks/useHeaderAnimation.ts, src/hooks/useHeaderCommonData.ts, src/components/Header.types.ts
ヘッダー共通のアニメーション管理と共通データ取得フックを追加。共通プロップ型(CommonHeaderProps, HeaderE235Props, HeaderAnimationState)を導入・公開。
フック公開インデックス
src/hooks/index.ts
新フック useHeaderAnimation と useHeaderCommonData をエクスポートに追加。
ヘッダーメイン
src/components/Header.tsx
既存の station フック参照を useHeaderCommonData に置換し、取得した共通データを各サブヘッダーへプロップとして渡すよう変更(ガード追加)。
サブヘッダー群(プロップ化)
src/components/HeaderTokyoMetro.tsx, .../HeaderTY.tsx, .../HeaderSaikyo.tsx, .../HeaderJRKyushu.tsx, .../HeaderJRWest.tsx, .../HeaderJL.tsx, .../HeaderLED.tsx, .../HeaderE235.tsx
各コンポーネントを内部atom/多重フック依存から CommonHeaderProps 受け取りへ書き換え。ローカル状態・副作用を削除し、アニメーションは useHeaderAnimation の返却オブジェクトを使用する構成へ。
HeaderE235 固有変更
src/components/HeaderE235.tsx, src/components/HeaderE235.test.tsx
HeaderE235 を HeaderE235Props(isJO を含む)ベースのプロップ駆動へ変更。テストは createMockHeaderE235Props を使用するよう更新。
テスト・フィクスチャ整備
src/__fixtures__/headerProps.ts, src/components/*.test.tsx (複数)
createMockHeaderProps / createMockHeaderE235Props を追加。既存ヘッダーテスト群をプロップ駆動に更新し、useHeaderCommonData/useHeaderAnimation のモックを追加・調整。
ヘッダー遷移ロジック改善
src/hooks/useTransitionHeaderState.ts
駅名の言語可用性チェックと次候補言語選定ヘルパーを追加し、言語遷移判定ロジックを置換。

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Header as Header Component
  participant Common as useHeaderCommonData
  participant Animation as useHeaderAnimation
  participant Store as Atoms/Store

  Note over Header,Common: 描画開始(親 Header または Theme 切替)
  Header->>Common: 共通データ要求(currentStation, line, langState,...)
  Common->>Store: atoms / サブフックを読み取り
  Store-->>Common: currentStation 等を返却
  Common-->>Header: CommonHeaderProps(または null)
  alt commonData present
    Header->>Animation: アニメーション制御要求(headerState, selectedBound, delay)
    Animation->>Animation: 内部アニメ値更新(fadeIn/fadeOut など)
    Animation-->>Header: animatedStyles + prevTextSnapshots
    Header->>Header: UI を animatedStyles と props でレンダー
  else no data
    Header->>Header: レンダリングガード(何も描画しない / 空)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • コード重複排除 #4789 — 同様にヘッダー共通化・アニメーション抽出を行っており、同一ヘッダー群の共通コードに重複変更の可能性あり。
  • zustandを削除しjotaiに統一 #4874 — 新規 Jotai atoms(theme/location 等)を追加・移行しており、本PRのフック/コンポーネントが参照する atom 定義と直接関係。
  • 経路デグレ修正 #4343 — useCurrentStation / useNextStation 周りの変更を含み、useHeaderCommonData が依存するコアフックの挙動に影響を及ぼす可能性あり。

Poem

🐰 フック抱えて跳ねる僕
プロップの草原で名を呼ぶよ
アニメは一つにまとまり
消えた行は千八百の夢
テストもうさぎが踊るよ 🥕

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タイトルは、Header コンポーネントの構造改善とデータに存在しない言語の駅名をスキップする2つの主要な変更を的確に要約しており、変更セットの主要な目的を明確に反映しています。
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 8b69cf0 and 39dbb0f.

📒 Files selected for processing (1)
  • src/components/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/components/HeaderLED.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/components/HeaderLED.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/HeaderLED.tsx
🧠 Learnings (8)
📓 Common learnings
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.
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: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T03:10:26.328Z
Learning: Write commit messages in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`)
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4521
File: src/screens/RouteSearchScreen.tsx:173-176
Timestamp: 2025-10-27T14:15:54.478Z
Learning: In the TrainLCD/MobileApp repository, when BFF (Backend For Frontend) returns nullish IDs for stations, this is considered a critical data integrity incident that should be fixed at the source (BFF) rather than worked around with composite key fallbacks in the client code.
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: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Commit messages must be single-sentence statements in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`); prefix production hot fixes with `Hotfix:`.
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
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.
📚 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/HeaderLED.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/components/HeaderLED.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/HeaderLED.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{tsx,ts} : Name components with PascalCase (e.g., `StationBanner.tsx`).

Applied to files:

  • src/components/HeaderLED.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{ts,tsx} : Name hooks with `use*` prefix (e.g., `useStationFeed.ts`).

Applied to files:

  • src/components/HeaderLED.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/hooks/**/*.ts : Custom hooks should use `use` prefix (e.g., `useStationFeed.ts`)

Applied to files:

  • src/components/HeaderLED.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/HeaderLED.tsx
🔇 Additional comments (5)
src/components/HeaderLED.tsx (5)

1-7: LGTM: Prop駆動アーキテクチャへの移行が適切です。

Atom関連のimportが削除され、CommonHeaderPropsを使用したProp駆動の設計に移行しています。クリーンで保守性の高い構造です。


51-59: LGTM: Propsの分割代入が一貫性を持って実装されています。

過去のレビューコメントで指摘されたheaderLangStateの分割代入位置の問題は解決済みです。全てのpropsが一箇所でまとめて分割代入されており、読みやすい構造になっています。


67-133: 空文字列フォールバック戦略を確認してください。

全ての箇所で?? ''を使用して、駅名データが存在しない場合に空文字列にフォールバックしています。これはPRタイトル「データ上存在しない英中韓駅名のスキップ」の意図と一致していますが、以下を確認してください:

  1. 空文字列表示(=実質スキップ)が全ての言語ケースで適切なUX体験となるか
  2. 例えば、英語駅名が存在しない場合に日本語駅名にフォールバックする方が良いケースがないか

この設計判断が意図的で、他のヘッダーコンポーネントとも一貫していることを確認してください。


135-190: LGTM: レンダリングロジックとメモ化が適切に実装されています。

  • useMemoによる最適化が適切に行われており、依存配列も正確です
  • 条件付きレンダリングロジックが明確で保守性が高いです
  • React.memoの使用も適切です(React 19.1.0でも引き続き有効)

62-63: HeaderLEDとLineBoardLEDがuseNumberingフックを直接呼び出しているのは設計通りです。

他のヘッダーコンポーネント(HeaderTokyoMetroなど)はcurrentStationNumberをpropsで受け取っていますが、HeaderLEDはLED表示専用で「現在駅と次駅の両方のナンバリングが必要」(lines 61のコメント参照)であり、nextStationNumberはCommonHeaderPropsに含まれていません。このため、フック直接呼び出しは意図的な実装パターンです。LineBoardLEDも同じLED表示コンポーネントとして同じパターンを採用しており、LED表示専用コンポーネント向けの一貫した設計になっています。


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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/HeaderJRWest.tsx (1)

34-103: StyleSheet.createをコンポーネント外に移動することを検討してください。

StyleSheet.createがコンポーネント本体内にあるため、レンダリングごとにスタイルオブジェクトが再作成されます。React Nativeでは、StyleSheetをコンポーネント外で定義することがパフォーマンスのベストプラクティスです。

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f1ea7c and 3b76308.

📒 Files selected for processing (25)
  • TECHNICAL_DEBT.md
  • src/__fixtures__/headerProps.ts
  • src/components/Header.test.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/HeaderJRKyushu.test.tsx
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/index.ts
  • src/hooks/useHeaderAnimation.ts
  • src/hooks/useHeaderCommonData.ts
  • src/hooks/useTransitionHeaderState.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx,js,jsx,json}

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

Use Biome as the formatter for all code files

Files:

  • src/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
src/hooks/**/*.ts

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

Custom hooks should use use prefix (e.g., useStationFeed.ts)

Files:

  • src/hooks/useHeaderAnimation.ts
  • src/hooks/useTransitionHeaderState.ts
  • src/hooks/useHeaderCommonData.ts
  • src/hooks/index.ts
src/{components,screens}/**/*.tsx

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

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

Files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderTokyoMetro.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
**/*.test.{ts,tsx}

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

**/*.test.{ts,tsx}: Place test files in the same hierarchy as the target module with .test.ts or .test.tsx extension
Mock network and Firebase layers using jest.mock
Call jest.clearAllMocks() in afterEach hook
Include TODO comments with reason and assignee for skipped tests

**/*.test.{ts,tsx}: Co-locate unit tests as .test.ts or .test.tsx siblings to the module.
Reuse helper utilities from src/utils/test/ to avoid duplicate setup code in tests.
Mock network and Firebase layers with jest.mock, and call jest.clearAllMocks() in afterEach.
When modifying behavior, update or add tests in the same change set; document skipped tests with TODOs and owner rationale.
Update or add tests relevant to code changes before submitting.

Files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
**/*.{test,spec}.{ts,tsx,js,jsx,py,java,go,cs}

📄 CodeRabbit inference engine (CLAUDE.md)

Test agents in isolation and with integration tests to ensure correctness and compatibility

Files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
🧠 Learnings (26)
📓 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: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T03:10:26.328Z
Learning: Write commit messages in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`)
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.
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
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Commit messages must be single-sentence statements in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`); prefix production hot fixes with `Hotfix:`.
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: 4521
File: src/screens/RouteSearchScreen.tsx:173-176
Timestamp: 2025-10-27T14:15:54.478Z
Learning: In the TrainLCD/MobileApp repository, when BFF (Backend For Frontend) returns nullish IDs for stations, this is considered a critical data integrity incident that should be fixed at the source (BFF) rather than worked around with composite key fallbacks in the client code.
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.
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to src/test/**/*.{ts,tsx} : For integration flows, extend `src/test/e2e.ts` and prefer fixtures from `src/__fixtures__/`.

Applied to files:

  • src/__fixtures__/headerProps.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.test.{ts,tsx} : Update or add tests relevant to code changes before submitting.

Applied to files:

  • src/__fixtures__/headerProps.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.test.{ts,tsx} : Reuse helper utilities from `src/utils/test/` to avoid duplicate setup code in tests.

Applied to files:

  • src/__fixtures__/headerProps.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.test.{ts,tsx} : When modifying behavior, update or add tests in the same change set; document skipped tests with TODOs and owner rationale.

Applied to files:

  • src/__fixtures__/headerProps.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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: Extend `src/test/e2e.ts` for integration flow tests

Applied to files:

  • src/__fixtures__/headerProps.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderTokyoMetro.test.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/__fixtures__/headerProps.ts
  • src/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderJL.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{ts,tsx} : Name hooks with `use*` prefix (e.g., `useStationFeed.ts`).

Applied to files:

  • src/hooks/useHeaderAnimation.ts
  • src/hooks/useTransitionHeaderState.ts
  • src/components/HeaderTokyoMetro.tsx
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderLED.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/HeaderTY.tsx
  • src/components/Header.test.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/hooks/**/*.ts : Custom hooks should use `use` prefix (e.g., `useStationFeed.ts`)

Applied to files:

  • src/hooks/useHeaderAnimation.ts
  • src/hooks/useTransitionHeaderState.ts
  • src/hooks/useHeaderCommonData.ts
  • src/components/HeaderLED.tsx
  • src/hooks/index.ts
  • src/components/Header.tsx
  • src/components/Header.test.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/hooks/useHeaderAnimation.ts
  • src/components/HeaderE235.test.tsx
  • src/components/HeaderTokyoMetro.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderJL.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 {jest.setup.js,src/setupTests.ts} : Jest global setup is managed in `jest.setup.js` and `src/setupTests.ts`

Applied to files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.test.{ts,tsx} : Mock network and Firebase layers with `jest.mock`, and call `jest.clearAllMocks()` in `afterEach`.

Applied to files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-27T22:48:28.461Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-27T22:48:28.461Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx,py,java,go,cs} : Test agents in isolation and with integration tests to ensure correctness and compatibility

Applied to files:

  • src/components/HeaderE235.test.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 **/*.test.{ts,tsx} : Mock network and Firebase layers using `jest.mock`

Applied to files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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: Reuse test helpers from `src/utils/test/`

Applied to files:

  • src/components/HeaderE235.test.tsx
  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to src/store/atoms/**/*.ts : Store Jotai atoms in `store/atoms/*.ts` files.

Applied to files:

  • src/hooks/useTransitionHeaderState.ts
📚 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/hooks/useTransitionHeaderState.ts
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderJL.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/components/HeaderTokyoMetro.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderJL.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/HeaderTokyoMetro.tsx
  • src/components/HeaderJRWest.tsx
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/Header.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderE235.tsx
  • TECHNICAL_DEBT.md
  • src/components/HeaderJL.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 **/*.test.{ts,tsx} : Call `jest.clearAllMocks()` in `afterEach` hook

Applied to files:

  • src/components/HeaderJL.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/Header.test.tsx
📚 Learning: 2025-05-06T18:50:57.931Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4243
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:0-0
Timestamp: 2025-05-06T18:50:57.931Z
Learning: In Jest tests that mock WebSocket objects, it's important to define the global WebSocket mock object and its constants (like WebSocket.OPEN) before using them in other mock objects to prevent "WebSocket is not defined" reference errors.

Applied to files:

  • src/components/HeaderJL.test.tsx
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{tsx,ts} : Name components with PascalCase (e.g., `StationBanner.tsx`).

Applied to files:

  • src/components/HeaderJRWest.tsx
  • src/components/HeaderLED.tsx
  • src/components/HeaderLED.test.tsx
  • src/components/Header.tsx
  • src/components/Header.types.ts
  • src/components/HeaderTY.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/Header.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to {jest.setup.js,src/setupTests.ts} : Jest global setup lives in `jest.setup.js` and `src/setupTests.ts`.

Applied to files:

  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/Header.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderJRKyushu.test.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: Prioritize minimal, auditable diffs and add concise comments for non-obvious changes

Applied to files:

  • TECHNICAL_DEBT.md
📚 Learning: 2025-12-25T12:38:30.140Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4784
File: TECHNICAL_DEBT.md:539-539
Timestamp: 2025-12-25T12:38:30.140Z
Learning: TrainLCD/MobileApp does not maintain a separate changelog file (docs/changelog.md or similar) for dependency updates; changes are tracked in TECHNICAL_DEBT.md instead.

Applied to files:

  • TECHNICAL_DEBT.md
🔇 Additional comments (55)
src/components/Header.test.tsx (1)

3-3: LGTM! フィクスチャベースのテストデータへの移行が適切です。

useHeaderCommonDataフックとcreateMockHeaderPropsフィクスチャへの移行が一貫して実装されており、新しいprops駆動型アーキテクチャに正しく対応しています。

Also applies to: 8-8, 16-17, 112-112, 117-117, 129-130, 137-138

src/components/HeaderJL.test.tsx (1)

3-3: LGTM! props駆動型レンダリングへの移行が適切です。

フィクスチャを使用したpropsの提供により、テストデータの一貫性が保たれています。

Also applies to: 133-133

src/components/HeaderJRWest.test.tsx (1)

4-4: LGTM! 全テストケースでフィクスチャが一貫して使用されています。

様々なヘッダー状態と列車種別をカバーする全てのテストケースで、createMockHeaderProps()を使用したprops提供が正しく実装されています。

Also applies to: 162-162, 181-181, 198-198, 215-215, 232-232, 249-249, 272-272, 295-295, 312-312, 329-329, 346-346, 363-363, 377-377, 389-389, 401-401, 413-413, 425-425, 437-437, 449-449, 461-461, 473-473, 485-485, 507-507, 532-534, 553-553

src/hooks/index.ts (1)

27-28: LGTM! 新しいフックのエクスポートが適切です。

useHeaderAnimationとuseHeaderCommonDataの追加により、ヘッダーコンポーネントの共通ロジックが公開APIとして利用可能になりました。命名規則とアルファベット順にも準拠しています。

src/components/HeaderE235.test.tsx (1)

3-3: LGTM! E235専用フィクスチャの使用が適切です。

createMockHeaderE235Propsを使用することで、isJOパラメータを含むE235固有のpropsを適切にテストしています。

Also applies to: 134-134, 140-140

src/components/HeaderLED.test.tsx (2)

3-3: LGTM!プロップ駆動型への移行が適切に実装されています。

createMockHeaderPropsを使用した一貫したモックプロップの提供により、テストの保守性が向上しています。すべてのレンダリングパスでプロップが正しく渡されており、リファクタリングの目的に沿った実装です。

Also applies to: 91-91, 96-96, 116-117, 133-134, 150-151, 167-168, 184-185, 201-202, 218-219, 235-236, 252-253, 274-275, 293-294


98-98: 日本語駅名の検証に改善されました。

'T'から'新'への変更により、実際の日本語駅名のレンダリングをより適切にテストできています。

src/components/HeaderTY.test.tsx (2)

100-115: useHeaderAnimationのモックが完全に実装されています。

アニメーション関連のすべてのフィールド(prevStationText、stateTopAnimatedStyles、boundTopAnimatedStylesなど)が網羅されており、新しいアーキテクチャに対応した適切なモックです。


387-399: ナンバリングアイコンのテストが改善されています。

createMockHeaderPropsのオーバーライド機能を使用して、currentStationNumberの有無による条件分岐を適切にテストしています。プロップベースのテスト戦略として優れた実装です。

Also applies to: 418-422

src/components/HeaderSaikyo.test.tsx (2)

103-118: プロップ駆動型への移行が一貫して実装されています。

すべてのテストケースでcreateMockHeaderPropsを使用しており、他のヘッダーコンポーネントのテストと統一された構造になっています。モックの設定も完全です。

Also applies to: 163-177, 199-286, 313-314, 338-339, 363-364, 385-386


406-418: ナンバリングアイコンの条件付きレンダリングが適切にテストされています。

プロップのオーバーライドを使用して、駅番号の有無による表示制御を検証しています。

Also applies to: 437-441

src/__fixtures__/headerProps.ts (2)

14-39: 優れたフィクスチャ設計です。

createMockHeaderPropsは以下の点で良い実装になっています:

  • すべてのCommonHeaderPropsフィールドに適切なデフォルト値を提供
  • Partial<>を使用したオーバーライド機構
  • 既存のフィクスチャ(TOEI_SHINJUKU_LINE_STATIONS)を再利用
  • 型安全性を保持

テスト間の一貫性を保ちながら、柔軟なカスタマイズを可能にしています。


44-50: コンポジション設計が適切です。

createMockHeaderE235Propsが基本プロップを継承しつつ、E235固有のisJOフラグを追加する設計は、DRY原則に従った優れた実装です。オーバーライドの優先順位も正しく処理されています。

src/components/HeaderTokyoMetro.test.tsx (2)

3-3: LGTM!一貫したプロップ駆動型テストへの移行です。

すべてのレンダリングでcreateMockHeaderPropsを使用し、useHeaderAnimationの包括的なモックを提供しています。他のヘッダーコンポーネントのテストと統一された構造で、保守性が高い実装です。

Also applies to: 100-115, 153-160, 182-183, 202-203, 222-223, 245-246, 268-269, 296-297, 321-322, 346-347, 368-369


389-401: ナンバリングアイコンのテストカバレッジが適切です。

M01駅番号の存在/不在による条件付きレンダリングを正しく検証しており、プロップベースのテスト戦略に沿った実装です。

Also applies to: 420-424

src/components/HeaderJRKyushu.test.tsx (3)

100-115: useHeaderAnimationのモックが適切に構造化されている

新しいhookの戻り値を正しくモックしており、テストの信頼性が向上しています。


145-148: jest.clearAllMocks()の使用を確認

コーディングガイドラインに従い、afterEachでjest.clearAllMocks()を呼び出しています。


389-401: propsオーバーライドによるテストが明確

createMockHeaderPropsを使用してpropsをオーバーライドするパターンが明確で、テストの意図が分かりやすくなっています。

src/hooks/useHeaderAnimation.ts (3)

27-33: hookの命名とドキュメントが適切

useプレフィックスを使用し、日本語コメントでhookの目的と使用箇所を明確にドキュメント化しています。コーディングガイドラインに準拠。


147-155: fadeコールバックの依存配列による再生成に注意

fadeはfadeInとfadeOutに依存し、それらは多くのSharedValueに依存しています。useEffectでfadeを依存配列に含めているため、SharedValueの参照が変わらない限り問題ありませんが、将来的なリファクタで注意が必要です。


56-62: prevStationTextの使用について

usePrevious(stationText)の結果を返していますが、prevStationTextはhook内のロジックでは参照されず、呼び出し元へのパススルーのみです。これは意図的な設計と思われますが、確認をお願いします。

src/hooks/useTransitionHeaderState.ts (4)

20-44: 駅名の言語チェック関数が適切に実装されている

hasStationTextForLangは各言語に対応する駅名フィールドを正しくチェックしており、PR目的の「存在しない英中韓駅名のスキップ」を実現しています。


46-68: 次の利用可能な言語を取得するロジック

getNextAvailableLangは現在の言語から順に次の言語を探し、駅名が存在しない言語をスキップします。見つからない場合はnullを返してJAにフォールバックする設計です。

KANAをJAとして扱う処理(Line 55)は、KANAが常にJAの直後にあるため正しい動作です。


156-165: ヘッダー状態に応じた対象駅の選択

CURRENTの場合はstation、それ以外(NEXT/ARRIVING)の場合はnextStationを使用しており、言語切り替え時に正しい駅の情報を参照できます。


299-302: stationを依存配列に追加

stationの変更時にuseIntervalのコールバックが再生成されるよう、依存配列に追加されています。これにより、駅が変わった際に言語チェックが正しく更新されます。

src/hooks/useHeaderCommonData.ts (3)

22-26: 共通データhookの設計が明確

日本語コメントでhookの役割と使用場所を明示しており、理解しやすい設計です。戻り値の型CommonHeaderProps | nullにより、currentStationがない場合のハンドリングが型レベルで強制されます。


81-88: connectionTextの生成が安全

オプショナルチェーンと?? ''によるフォールバックで、connectedLinesがnullの場合も安全にハンドリングしています。


95-98: 早期リターンのタイミング

すべてのhooksを呼び出した後に条件分岐しているため、Reactのhooksルールに違反していません。

src/components/Header.tsx (2)

15-21: prop-driven アーキテクチャへの移行が完了

useHeaderCommonDataを使用して共通データを取得し、null チェック後に各ヘッダーコンポーネントへspreadしています。これにより、各ヘッダーコンポーネントからの重複したhook呼び出しが削除され、約1,800行の削減が実現されています。


23-44: テーマ別のヘッダーコンポーネント選択

すべてのケースで{...commonData}をspreadしており、一貫性のあるprops受け渡しパターンです。HeaderE235のみ追加でisJOpropを渡しており、HeaderE235Propsの定義と整合しています。

src/components/HeaderJRKyushu.tsx (3)

115-144: propsからの値の分解とアニメーションhookの使用

CommonHeaderPropsから必要な値を分解し、useHeaderAnimationに渡しています。アニメーション関連のロジックがhookに抽出され、コンポーネントはレンダリングに集中できるようになりました。


156-192: バウンドテキストのアニメーション実装

トップとボトムのアニメーションスタイルをanimationオブジェクトから適用し、prevBoundTextやprevConnectionTextもanimation経由で取得しています。クロスフェードアニメーションの実装が明確です。


287-287: React.memoによるパフォーマンス最適化

コンポーネントをReact.memoでラップしており、propsが変更されない限り再レンダリングを防ぎます。

src/components/Header.types.ts (3)

8-42: CommonHeaderPropsの型定義が包括的

駅・路線データ、グローバル状態、テキスト、ナンバリング、その他のカテゴリで整理されており、各ヘッダーコンポーネントに必要なpropsが網羅されています。日本語コメントでカテゴリを明示しているのも良い点です。


44-49: HeaderE235Propsの拡張設計

CommonHeaderPropsを継承してisJOを追加する形で、JO/YAMANOTEテーマの違いを表現しています。isJOがオプショナルなのは、デフォルトでfalseとして扱うためと思われます。


51-72: HeaderAnimationStateの型定義

useHeaderAnimationhookの戻り値型を明示的に定義しており、前フレームの値とアニメーションスタイルが区別されています。これにより、hookの使用箇所でTypeScriptの型サポートが得られます。

src/components/HeaderLED.tsx (2)

51-58: props駆動のリファクタリングが適切に実装されています。

CommonHeaderPropsを使用した型安全なprops受け渡しは、ヘッダーコンポーネント間の一貫性を向上させています。


60-62: useNumberingフックの使用について確認してください。

コメントで説明されているように、HeaderLEDは現在駅と次駅両方のナンバリングが必要です。このフックがprops駆動のアーキテクチャと整合しているか確認してください。他のヘッダーコンポーネントではcurrentStationNumberがpropsとして渡されていますが、このコンポーネントではフックを直接使用しています。

src/components/HeaderTokyoMetro.tsx (2)

112-142: useHeaderAnimationフックによるアニメーション共通化が適切に実装されています。

アニメーションロジックをuseHeaderAnimationに集約し、propsから現在の状態を、animationオブジェクトから前の状態を取得する設計は、関心の分離が明確で保守性が向上しています。


157-192: アニメーションスタイルの適用が正しく実装されています。

animation.boundTopAnimatedStylesとanimation.boundBottomAnimatedStylesを使用したテキスト遷移、およびanimation.prevBoundTextとanimation.prevConnectionTextによる前の状態の表示は、スムーズなトランジション効果を実現しています。

src/components/HeaderJRWest.tsx (2)

20-32: props駆動へのリファクタリングが適切に実装されています。

CommonHeaderPropsを使用し、外部から必要なデータを受け取る設計に変更されています。


367-370: currentStationのnullチェックの意図を確認してください。

currentStationはこのnullチェックのみで使用されており、実際の値は使用されていません。これは意図的な動作でしょうか?もしデフォルトロゴを返すための条件であれば、コメントで意図を明確にすると良いでしょう。

src/components/HeaderSaikyo.tsx (2)

129-157: HeaderSaikyoのprops駆動リファクタリングが適切に実装されています。

useHeaderAnimationフックの使用と、CommonHeaderPropsからのデータ取得が正しく実装されています。stateTextRight: ''は、このヘッダーでは右側の状態テキストを使用しないことを明確に示しています。


231-266: 駅名アニメーションの実装が正しいです。

animation.topNameAnimatedStylesとanimation.bottomNameAnimatedStylesを使用したスムーズな駅名遷移、およびtransformOriginの適切な設定が確認できます。

src/components/HeaderE235.tsx (2)

87-100: HeaderE235のprops駆動リファクタリングが適切に実装されています。

HeaderE235Propsを使用し、isJOプロパティを含む専用の型定義で、JO線固有の表示ロジックをサポートしています。


102-126: ループ線判定とローカライゼーションロジックが適切に実装されています。

useLoopLineフックの使用と、boundPrefix/boundSuffixのメモ化による多言語対応(日本語、英語、中国語、韓国語)が正しく実装されています。

TECHNICAL_DEBT.md (3)

5-5: 技術負債ドキュメントが適切に更新されています。

最終更新日と、Header系コンポーネントの構造改善による約1,800行削減の記録が正確に反映されています。


94-140: Header系コンポーネントの改善状況が詳細に記録されています。

各コンポーネントの行数削減、新しい共通フック・型定義ファイルの作成、テストケース数の更新が適切に文書化されています。これにより、将来のメンテナンスや新規開発者のオンボーディングが容易になります。


825-825: 更新履歴が詳細に記録されています。

2026-01-02の変更内容が包括的に記載されており、コード削減量、新規作成ファイル、多言語対応の改善などが明確に文書化されています。

src/components/HeaderJL.tsx (2)

100-112: HeaderJLのprops駆動リファクタリングが適切に実装されています。

CommonHeaderPropsを使用した型安全なprops受け渡しと、必要なデータの分割代入が明確に実装されています。


116-151: 多言語対応のメモ化が適切に実装されています。

boundPrefix、boundSuffix、clockLabelのメモ化により、headerLangStateの変更時のみ再計算されます。日本語、英語、中国語、韓国語の各言語に対応した適切なテキストが設定されています。

src/components/HeaderTY.tsx (4)

1-17: インポート構造が適切に整理されています

必要な型とフックが正しくインポートされており、コンポーネントのプロップ駆動型への変換に対応しています。


116-145: コンポーネント宣言とフック呼び出しが適切です

CommonHeaderProps型の採用とプロップからのデータ取得により、状態管理がシンプル化されています。アニメーション関連のプロップがuseHeaderAnimationに正しく渡されています。


293-293: React.memoによるパフォーマンス最適化が適切です

ヘッダーコンポーネントは頻繁に再レンダリングされる可能性があるため、メモ化は有効です。


135-145: useHeaderAnimationフックの戻り値型でアニメーションプロパティが定義されているか確認が必要です

animationオブジェクトから複数のプロパティ(prevBoundText、prevConnectionText、prevStateText、prevStationText、prevStateTextRightなど)を参照していますが、useHeaderAnimationの戻り値型にこれらすべてが定義されているか確認してください。特にprev*系プロパティについて、型定義との整合性を確認してください。

Comment thread src/components/HeaderLED.tsx Resolved

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

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

69-133: null/undefined処理の一貫性を検討してください。

|| ''と?? ''が混在しています。nameプロパティには||、nameKatakana/nameRomanには??が使用されていますが、意図的でなければ統一を検討してください。また、91, 109, 127行目のオプショナルチェーン(?.)はif文で既にnullチェック済みのため不要です。

🔎 冗長なオプショナルチェーンの修正例
       case 'ARRIVING_EN':
         if (nextStation) {
           setStateText(translate(isLast ? 'soonEnLast' : 'soonEn'));
-          setStationText(nextStation?.nameRoman ?? '');
+          setStationText(nextStation.nameRoman ?? '');
         }
         break;
       ...
       case 'CURRENT_EN':
         if (station) {
           setStateText('');
-          setStationText(station?.nameRoman ?? '');
+          setStationText(station.nameRoman ?? '');
         }
         break;
       ...
       case 'NEXT_EN':
         if (nextStation) {
           setStateText(translate(isLast ? 'nextEnLast' : 'nextEn'));
-          setStationText(nextStation?.nameRoman ?? '');
+          setStationText(nextStation.nameRoman ?? '');
         }
         break;
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b76308 and 8b69cf0.

📒 Files selected for processing (1)
  • src/components/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.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/HeaderLED.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/components/HeaderLED.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/components/HeaderLED.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/HeaderLED.tsx
🧠 Learnings (7)
📓 Common learnings
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.
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: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T03:10:26.328Z
Learning: Write commit messages in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`)
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4521
File: src/screens/RouteSearchScreen.tsx:173-176
Timestamp: 2025-10-27T14:15:54.478Z
Learning: In the TrainLCD/MobileApp repository, when BFF (Backend For Frontend) returns nullish IDs for stations, this is considered a critical data integrity incident that should be fixed at the source (BFF) rather than worked around with composite key fallbacks in the client code.
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: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Commit messages must be single-sentence statements in Japanese (e.g., `テレメトリー送信機をリファクタリングしてnull状態を回避`); prefix production hot fixes with `Hotfix:`.
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
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.
📚 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/HeaderLED.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/HeaderLED.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/components/HeaderLED.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{tsx,ts} : Name components with PascalCase (e.g., `StationBanner.tsx`).

Applied to files:

  • src/components/HeaderLED.tsx
📚 Learning: 2025-12-31T12:21:36.200Z
Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-31T12:21:36.200Z
Learning: Applies to **/*.{ts,tsx} : Name hooks with `use*` prefix (e.g., `useStationFeed.ts`).

Applied to files:

  • src/components/HeaderLED.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/hooks/**/*.ts : Custom hooks should use `use` prefix (e.g., `useStationFeed.ts`)

Applied to files:

  • src/components/HeaderLED.tsx
🧬 Code graph analysis (1)
src/components/HeaderLED.tsx (1)
src/components/Header.types.ts (1)
  • CommonHeaderProps (11-42)
🔇 Additional comments (4)
src/components/HeaderLED.tsx (4)

51-59: LGTM!

プロップ駆動への移行が適切に実装されています。全てのpropsが一箇所で分割代入されており、可読性が向上しています。


61-63: LGTM!

HeaderLEDが両方のナンバリングを必要とする理由がコメントで明確に説明されています。


152-160: LGTM!

numberingTextのメモ化ロジックが明確で、依存配列も正しく設定されています。


162-190: LGTM!

レンダリングロジックがシンプルで、条件分岐も明確です。React.memoによるメモ化も適切です。

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