Repository navigation
CommonCard で対象駅の駅番号が無い場合はナンバリング記号を返さない - #5923
Merged
Merged
Conversation
Contributor
|
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)
📝 Walkthrough概要CommonCardコンポーネントの 変更内容駅マーク検証ロジック
見積りレビュー時間🎯 3 (中程度) | ⏱️ ~20 分 関連するPR
提案されるラベル
🐰 ウサギの詩
🚥 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)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
CommonCardが、路線シンボルは設定されているのに当該駅の駅番号を持たない駅 (例: 川越線日新駅) を描画するとき、NumberingIconSquareが路線記号 (JA) だけ表示される中途半端な見た目になっていた。getLineMark由来のmarkを返さない条件を追加し、画像 (signPath) で代替もできない場合は既存の空プレースホルダー (withoutMark) にフォールバックするよう修正した。変更の種類
変更内容
src/components/CommonCard.tsx:markのuseMemoを拡張し、line.lineSymbolsがあるのにtargetStation.stationNumbersに対応する駅番号が存在せず、signPath/btUnionSignPathsの画像代替もできない場合はnullを返すようにした。JA-26が紐付く) のように駅番号が取れるケースは従来通りマークを返すため、表示は変わらない。KKの駅番号が引けないが線そのものにsignPath(KK ロゴ画像) があるケースは、画像代替が効くためmarkを返し続け、表示崩れを起こさない。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることnpm run lintは CommonCard.tsx については新規エラー無し (既存の他ファイルの CRLF 等の指摘は本 PR のスコープ外)。npm run typecheckはクリーン。TransferLineMarkのテストはパス。関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
バグ修正