Skip to content

駅名の末尾が圧縮表示で欠ける問題を修正 - #6069

Merged
TinyKitten merged 1 commit into
devfrom
codex/fix-station-name-suffix-clipping
May 28, 2026
Merged

TinyKitten merged 1 commit into
devfrom
codex/fix-station-name-suffix-clipping

Conversation

@TinyKitten

@TinyKitten TinyKitten commented May 28, 2026 •

Copy link
Copy Markdown
Member

概要

駅名を横圧縮表示する際に、末尾が表示窓で欠ける問題を修正しました。

変更の種類

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

変更内容

  • 駅名表示コンポーネントの変換前クリップを外し、センタリングを維持したまま全文を圧縮対象に変更
  • 北野白梅町・きたのはくばいちょう が末尾まで圧縮表示対象になる回帰テストを追加

テスト

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

実行コマンド:

set TZ=UTC&& npx jest --runInBand src/components/HeaderStationName.test.tsx src/components/HeaderTY.test.tsx src/components/HeaderEast/HeaderEast.test.tsx src/components/HeaderJRKyushu.test.tsx src/components/HeaderSaikyo.test.tsx
npm run typecheck
npm run lint

関連Issue

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

Summary by CodeRabbit

リリースノート

  • テスト

    • HeaderStationName コンポーネントのテストケースを強化し、表示スタイルとテキストクリッピング挙動をより厳密に検証
  • スタイル

    • 駅名の描画範囲制御を調整し、テキストスケーリング時の基準点を中央に統一

Review Change Stack

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

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

HeaderStationName コンポーネントのスタイル定義で overflow: 'hidden' を container と viewport から削除し、scaledText に transformOrigin: 'center' を追加しました。テストではこれらの変更を検証する強化されたケースと新規テストケースを追加しています。

Changes

HeaderStationName 描画調整

Layer / File(s) Summary
スタイル定義の変更(overflow 削除・transformOrigin 追加)
src/components/HeaderStationName.tsx
styles.container と styles.viewport から overflow: 'hidden' を削除し、テキストスケーリング時の変換基準点を中心に合わせるため styles.scaledText に transformOrigin: 'center' を追加。
テストの強化と新規ケース追加
src/components/HeaderStationName.test.tsx
既存テストで viewportStyle.overflow が未設定であること、transformOrigin の期待値を検証。新規テストケース「駅名全文がクリップなしで圧縮される」を追加し、Text の children 一致、scaleX、transformOrigin を検証。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分

Possibly related PRs

  • TrainLCD/MobileApp#6066: HeaderStationName の横圧縮表示ロジック(styles の overflow/transformOrigin)とそれを検証する HeaderStationName.test.tsx が、駅名表示をフォント縮小から横圧縮に変更 #6066 が導入・利用した同コンポーネントの変更範囲と直接重なるため。
  • TrainLCD/MobileApp#6053: Main PR updates HeaderStationName to support the same scaleX-based long-station-name compression behavior (including transformOrigin/clipping expectations) that PR #6053 introduced via calcStationNameScaleX and corresponding header rendering changes.

Suggested labels

react

Poem

🐰 ウサギが言う、駅名の表示
クリップを取り除いて、中心に回す
スケール変換、テストで確かめ
描画の調整、滑らかに進む
HeaderStationName、ついに完成~✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは、駅名圧縮表示で末尾が欠ける問題の修正という主要な変更を明確かつ簡潔に説明しており、実装内容と完全に一致しています。
Description check ✅ Passed PR説明は必須セクション(概要、変更の種類、変更内容、テスト)をすべて含み、実施したテスト内容も具体的に記載されており、テンプレートに適切に従っています。
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/fix-station-name-suffix-clipping

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.


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

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

40-44: ⚖️ Poor tradeoff

React Native 0.83 では transformOrigin は公式にサポートされているため、サポート懸念を弱める(描画の最終確認のみ)

src/components/HeaderStationName.tsx の scaledText(transformOrigin: 'center')は、React Native 0.83 の公式ドキュメント上で有効なスタイルプロパティとして iOS/Android 両対応で説明されています。サポート未対応による根本的な崩れの可能性は低いです。
一方で、transformOrigin がスタイリング抽象(例: Tailwind/NativeWind等)を経由してそのままネイティブへ渡っているかと、実機でスケール中心が意図通りになるかは軽く確認してください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/HeaderStationName.tsx` around lines 40 - 44, scaledText にセットした
transformOrigin: 'center' が RN 0.83
では公式サポートされているので大きな問題ではありませんが、HeaderStationName.tsx 内の scaledText
スタイルが実際にネイティブに正しく渡されているか(Tailwind/NativeWind
等のスタイリング抽象を経由していないか)と、実機(iOS/Android)でスケールの中心が期待通りになるかを確認してください。もし抽象層でプロパティがフィルタリングされているなら
transformOrigin を直接スタイルに残すか、代替の transform-origin
相当の実装に置き換え、異常があればその旨をログかコメントで記載してください。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/HeaderStationName.tsx`:
- Around line 40-44: scaledText にセットした transformOrigin: 'center' が RN 0.83
では公式サポートされているので大きな問題ではありませんが、HeaderStationName.tsx 内の scaledText
スタイルが実際にネイティブに正しく渡されているか(Tailwind/NativeWind
等のスタイリング抽象を経由していないか)と、実機(iOS/Android)でスケールの中心が期待通りになるかを確認してください。もし抽象層でプロパティがフィルタリングされているなら
transformOrigin を直接スタイルに残すか、代替の transform-origin
相当の実装に置き換え、異常があればその旨をログかコメントで記載してください。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c24a3c85-58c1-4dda-b3f1-c9b24be94b97

📥 Commits

Reviewing files that changed from the base of the PR and between 64b5a9c and 0493bd0.

📒 Files selected for processing (2)
  • src/components/HeaderStationName.test.tsx
  • src/components/HeaderStationName.tsx

@TinyKitten
TinyKitten merged commit c396bcc into dev May 28, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the codex/fix-station-name-suffix-clipping branch May 28, 2026 13:06
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