Repository navigation
Headerの極端に長い駅名がscaleX圧縮されず…で省略される問題を修正 - #6060
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthrough駅名表示の Changes駅名スケーリング・省略表示統一
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
概要
長者ヶ浜潮騒はまなす公園前のような極端に長い駅名で、Header の
scaleX圧縮が効かず末尾が…で省略される問題を修正する。変更の種類
変更内容
Typography側にnumberOfLines={1}のみが指定されていたため、transform: scaleX適用前の layout 段階で React Native がスロット幅に合わせて末尾を ellipsize していた。useStationNameScaleXからnaturalTextWidthを返し、HeaderE231/HeaderE235/HeaderJL/HeaderJRWestの可視 Text にwidth: naturalTextWidthを明示することで layout 段階の ellipsize を回避する。MIN_SCALE_FLOORを0.5から0.3に緩和。23 文字級の駅名(例: ちょうじゃがはましおさいはまなすこうえんまえ)でも 1 行スロットに収まるようにする。視認性下限と全文字表示の折衷値で、これより下げると判読が著しく困難になるためコメントに意図を明記。ellipsizeMode="clip"を付与。scaleXが下限に達してなお収まらない極端ケースでも…が表示されないようにする安全弁。useStationNameScaleX.test.tsの下限値テストを 0.3 に更新し、naturalTextWidthを返すことを検証するテストを追加。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit
Bug Fixes