Skip to content

Header駅名表示関連の変更をrevert - #6065

Merged
TinyKitten merged 1 commit into
devfrom
codex/revert-header-station-name
May 27, 2026
Merged

TinyKitten merged 1 commit into
devfrom
codex/revert-header-station-name

Conversation

@TinyKitten

@TinyKitten TinyKitten commented May 27, 2026 •

Copy link
Copy Markdown
Member

概要

Header 駅名表示関連の変更を revert します。

変更の種類

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

変更内容

  • Header 駅名表示関連の変更を revert
  • useStationNameScaleX の追加と各 Header コンポーネントへの適用を取り消し
  • revert 後の station name scale utility とテスト構成に戻し

テスト

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

関連Issue

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

Summary by CodeRabbit

リリースノート

  • 改善

    • 駅名表示のスケーリング方式を改善。複数のヘッダーコンポーネント(E231、E235、East、JL、JRKyushu、JRWest、Saikyo)で、駅名テキストが画面幅に応じてスムーズに自動縮小されるようになりました。
  • テスト

    • 駅名スケーリング機能の自動テストを追加しました。

Review Change Stack

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

coderabbitai Bot commented May 27, 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: 581c41a1-a667-4c3c-8467-1ed868184563

📥 Commits

Reviewing files that changed from the base of the PR and between 1705389 and 6d192f2.

📒 Files selected for processing (21)
  • jest.setup.js
  • src/components/HeaderE231.test.tsx
  • src/components/HeaderE231.tsx
  • src/components/HeaderE235.tsx
  • src/components/HeaderEast/HeaderEast.test.tsx
  • src/components/HeaderEast/HeaderEast.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/HeaderOdakyu.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/hooks/index.ts
  • src/hooks/useStationNameScaleX.test.ts
  • src/hooks/useStationNameScaleX.ts
  • src/utils/stationNameScale.test.ts
  • src/utils/stationNameScale.ts
💤 Files with no reviewable changes (12)
  • src/components/HeaderE231.test.tsx
  • src/hooks/useStationNameScaleX.ts
  • src/hooks/useStationNameScaleX.test.ts
  • src/components/HeaderJRWest.test.tsx
  • src/components/HeaderTokyoMetro.test.tsx
  • src/components/HeaderEast/HeaderEast.test.tsx
  • src/components/HeaderOdakyu.test.tsx
  • jest.setup.js
  • src/components/HeaderTY.test.tsx
  • src/components/HeaderSaikyo.test.tsx
  • src/hooks/index.ts
  • src/components/HeaderJRKyushu.test.tsx

📝 Walkthrough

Walkthrough

複数の Header コンポーネントの駅名テキストスケーリング実装を統一しました。手動の scaleX 圧縮から React Native の adjustsFontSizeToFit と minimumFontScale を使用した自動縮小へ移行。新しい calcStationNameMinScale ユーティリティを導入し、古い useStationNameContainerWidth と useStationNameScaleX フックを削除。

Changes

駅名スケーリング実装統一

Layer / File(s) Summary
新しいスケーリング計算ユーティリティの実装
src/utils/stationNameScale.ts, src/utils/stationNameScale.test.ts
calcStationNameMinScale() 関数を実装。画面幅と文字数から最小フォント倍率を計算、0.1~1.0 にクランプ。テストで空文字、上限・下限のクランプ、中間値の単調減少を検証。
古いフック実装と再エクスポートの削除
src/hooks/useStationNameScaleX.ts, src/hooks/useStationNameScaleX.test.ts, src/hooks/index.ts
useStationNameContainerWidth と useStationNameScaleX を完全削除。hooks/index.ts バレルから再エクスポート定義を削除、useSimulationMode / useSlicedStations / useStartBackgroundLocationUpdates を追加。
HeaderE231 と HeaderE235 の駅名スケーリング統一
src/components/HeaderE231.tsx, src/components/HeaderE231.test.tsx, src/components/HeaderE235.tsx
stationNameMeasurer スタイルと非可視計測用 Typography を削除。onLayout と scaleX に依存する構成をやめ、minimumFontScale={calcStationNameMinScale(...)} と adjustsFontSizeToFit を適用。テストから古いモック定義を削除。
HeaderEast と HeaderJL の駅名スケーリング統一
src/components/HeaderEast/HeaderEast.tsx, src/components/HeaderEast/HeaderEast.test.tsx, src/components/HeaderJL.tsx
トップ/ボトムの駅名を calcStationNameMinScale(text, 0.55 または 0.5) で縮小。手動 scaleX 圧縮と計測用フック呼び出しを削除。styles.stationName にレイアウト属性を追加。テストから古いモック定義を削除。
HeaderJRKyushu と HeaderJRWest の駅名スケーリング統一
src/components/HeaderJRKyushu.tsx, src/components/HeaderJRKyushu.test.tsx, src/components/HeaderJRWest.tsx, src/components/HeaderJRWest.test.tsx
HeaderJRKyushu は react-native から Text 直接 import を削除、トップ/ボトムで calcStationNameMinScale(..., 0.55) を適用。HeaderJRWest は stationNameContainer の Typography をフォント自動調整ベースに置換。両コンポーネントで計測用スタイルと古いフック呼び出しを削除。テストから古いモック定義を削除、HeaderJRKyushu テストでは boundTopAnimatedStyles / boundBottomAnimatedStyles を追加。
HeaderSaikyo、HeaderOdakyu、HeaderTY、HeaderTokyoMetro の駅名スケーリング統一
src/components/HeaderSaikyo.tsx, src/components/HeaderOdakyu.test.tsx, src/components/HeaderTY.test.tsx, src/components/HeaderTokyoMetro.test.tsx
HeaderSaikyo はトップ/ボトムで minimumFontScale={calcStationNameMinScale(..., 0.55)} を適用。非表示 measurer Text と transform: scaleX を削除。HeaderOdakyu、HeaderTY、HeaderTokyoMetro テストから古いフックのモック定義を削除。
jest.setup.js の共通モック整理
jest.setup.js
グローバルフックモックから useStationNameContainerWidth と useStationNameScaleX の定義を削除。全テスト環境での一貫性を確保。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TrainLCD/MobileApp#5988: 駅名自動縮小ロジックを scaleX ベースから calcStationNameMinScale による minimumFontScale ベースへ統一する同一方向の変更。

  • TrainLCD/MobileApp#6060: useStationNameScaleX と Header コンポーネントの駅名描画(width、ellipsizeMode、scaleX)を変更する同関連領域。

  • TrainLCD/MobileApp#6057: useStationNameContainerWidth / useStationNameScaleX とそれらのモック・参照箇所を駅名スケーリングで変更。

Suggested labels

react

Poem

駅名の幅を計り直し🐇
スケール手書きから自動へ
九つのヘッダー一度に整え
画面にぴったり、フォントしなやか
新しい道へ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは「Header駅名表示関連の変更をrevert」で、変更セットの主要な目的(Header駅名表示機能の変更をリバート)を簡潔かつ明確に説明しており、スキャン時に主な変更内容が理解できます。
Description check ✅ Passed PR説明はテンプレートのほぼすべてのセクション(概要、変更の種類、変更内容、テスト)を記入しており、revertの理由と実施内容が明確に記述されています。テスト項目も完了チェック済みです。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 codex/revert-header-station-name

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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

@TinyKitten
TinyKitten merged commit 32ce292 into dev May 27, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the codex/revert-header-station-name branch May 27, 2026 23:44
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