Repository navigation
練馬春日町の駅名表示幅に余白を追加 - #6087
練馬春日町の駅名表示幅に余白を追加#6087
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughHeaderStationName コンポーネントのテキスト幅スケーリング計算に固定バッファ(8)を導入し、新しい renderTextWidth 値に基づいて幅スケール計算と描画幅を更新。すべてのテスト期待値を新しい計算結果に合わせて調整、最後のテストでは再測定検証ステップを追加。 Changesテキスト幅バッファ導入とスケーリング計算
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/HeaderStationName.tsx (1)
16-16: ⚡ Quick winバッファ定数にコメントを追加することを推奨します。
MEASURED_TEXT_WIDTH_BUFFERの値 8 が選ばれた理由(ネイティブの文字幅計測が日本語グリフを小さく返す場合の補正など)をコメントで説明すると、将来のメンテナンス時に役立ちます。💡 コメント追加例
const MEASURE_TEXT_WIDTH = 10000; +// ネイティブの文字幅計測が日本語グリフをわずかに小さく返す場合の余白 const MEASURED_TEXT_WIDTH_BUFFER = 8;🤖 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` at line 16, Add an explanatory comment for the constant MEASURED_TEXT_WIDTH_BUFFER (value 8) in HeaderStationName.tsx that states why 8 was chosen and when it’s needed (e.g., to compensate for native text measurement underestimating Japanese glyph widths or other font/renderer quirks), include any references to how it interacts with measured text width logic in the component so future maintainers know the rationale and when to adjust the value.
🤖 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`:
- Line 16: Add an explanatory comment for the constant
MEASURED_TEXT_WIDTH_BUFFER (value 8) in HeaderStationName.tsx that states why 8
was chosen and when it’s needed (e.g., to compensate for native text measurement
underestimating Japanese glyph widths or other font/renderer quirks), include
any references to how it interacts with measured text width logic in the
component so future maintainers know the rationale and when to adjust the value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d9ec9b3f-06e6-494f-a778-a090b0f2deb0
📒 Files selected for processing (2)
src/components/HeaderStationName.test.tsxsrc/components/HeaderStationName.tsx
概要
駅名表示の測定幅に小さな余白を加え、ネイティブの文字幅計測が日本語グリフをわずかに小さく返す場合でも末尾が欠けにくいようにしました。
変更の種類
変更内容
HeaderStationNameの描画幅と縮小率計算に、測定幅 + 8px の余白を使うようにしました。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること実行したコマンド:
補足: Windows
cmdでは package script 内のTZ=UTCが解釈されないため、対象 Jest はTZを設定して直接実行しました。関連Issue
Follow-up: #6084
スクリーンショット(任意)
未取得です。画面上での最終確認は実機または Expo 実行環境で、都営大江戸線の「練馬春日町」表示を確認してください。
Summary by CodeRabbit
リリースノート