Skip to content

ポートレートモードの駅名見切れを修正 - #6310

Merged
TinyKitten merged 2 commits into
devfrom
fix/portrait-station-name-clipping
Jun 24, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/portrait-station-name-clipping

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

概要

ポートレートモードの駅名表示がiPhoneで見切れることがある問題を修正

変更の種類

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

変更内容

  • テキスト計測バッファ(STATION_NAME_MEASURE_BUFFER)を8pxから16pxに拡大し、iOSでの日本語グリフ計測誤差によるクリップを防止
  • 計測完了前(renderWidth === 0)の表示用Typographyにopacity: 0を適用し、スケーリング未適用のテキストがoverflow: hiddenで見切れるのを防止
  • 表示用TypographyにellipsizeMode="clip"を追加し、万一クリップが発生しても「…」ではなく自然に切れるように変更

テスト

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

関連Issue

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

Summary by CodeRabbit

  • バグ修正
    • 駅名の計測バッファを拡張し、表示・スケーリングの安定性を向上しました。
    • 文字描画の準備中は不可視化し、描画幅が確定したときのみ幅・拡大縮小・変形基準を適用するよう調整しました。あわせて長い駅名の末尾挙動も改善しました。
  • テスト
    • 駅名スロット幅計算の期待値を更新しました。

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

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 24ba73ea-eb28-4205-87a4-71db54645a6c

📥 Commits

Reviewing files that changed from the base of the PR and between f361e3c and a222cb3.

📒 Files selected for processing (1)
  • src/components/PortraitMain.test.tsx

📝 Walkthrough

Walkthrough

PortraitMain.tsx の STATION_NAME_MEASURE_BUFFER を 8 から 16 に拡大し、StationName の Typography で renderWidth が未確定(0)の間は opacity: 0 を適用してクリップを回避、renderWidth > 0 のときのみ width・scaleX・数値配列形式の transformOrigin を適用する条件分岐に整理。あわせて ellipsizeMode="clip" を追加し、対応するテスト期待値を更新。

Changes

駅名計測バッファと表示ロジックの修正

Layer / File(s) Summary
計測バッファ拡大と renderWidth 条件付き描画ロジック
src/components/PortraitMain.tsx, src/components/PortraitMain.test.tsx
STATION_NAME_MEASURE_BUFFER を 8 → 16 に変更。StationName の Typography で renderWidth == 0 の間は opacity: 0 にしてスケーリング前テキストのクリップを回避し、renderWidth > 0 のときのみ width・scaleX・transformOrigin(数値配列形式)を適用する条件分岐に整理。ellipsizeMode="clip" を追加。テスト期待値は末尾欠け防止バッファの拡大に対応して、駅名スロット style.width を 208 → 216 に、バッファ込み描画幅を 400 → 408 に更新。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • TrainLCD/MobileApp#6087: 駅名計測バッファと width/scaleX の描画条件調整が同じコード領域を対象としている。
  • TrainLCD/MobileApp#6106: HeaderStationName.tsx で計測完了前の width フォールバックや scaleX ちらつき抑制ロジックを変更しており、本 PR の renderWidth 未確定時の非表示制御と同じ問題に対応している。
  • TrainLCD/MobileApp#6232: PortraitMain.tsx の transformOrigin およびその適用条件変更が本 PR と同一箇所を修正している。

🐇 バッファを倍にして余裕たっぷり、
ゼロの幅には opacity ゼロ 🫥
clip でパチン、はみ出し封じ、
scaleX 変形、確定してから ✨
にんじん食べながら駅名整う 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは「ポートレートモードの駅名見切れを修正」で、変更内容の主要な目的(iPhoneでの駅名見切れの修正)を明確に示しており、変更内容と完全に関連している。
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 fix/portrait-station-name-clipping

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@TinyKitten
TinyKitten merged commit 3acfa8b into dev Jun 24, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/portrait-station-name-clipping branch June 24, 2026 00:18
@TinyKitten TinyKitten mentioned this pull request Jun 24, 2026
4 of 9 tasks
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