TransferLineMarkにrecyclingKeyを追加してAndroidの画像誤表示を修正#5804
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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)
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/TransferLineMark.tsx`:
- Around line 167-168: recyclingKey が line?.id が null かつ mark.sign が未定義のとき null
になり、Image コンポーネントのリサイクルリセットが効かないケースがあるため、recyclingKey のフォールバックを必ず非 null
にするよう修正してください:現在の定義 (recyclingKey) を変更して最終フォールバックに画像ソース(該当する
props/変数名を使用)を含め、line?.id → mark.sign → imageSrc
の順で優先し、どれも無ければ固定文字列(例:"unknown-mark")を返すようにして Image(該当箇所: Line 181 / Line 199 の
Image)で常に一意かつ非 null な key が渡るようにしてください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 940c2229-574b-47df-a573-276aaaaf4d1e
📒 Files selected for processing (1)
src/components/TransferLineMark.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
FlatListでビューが使い回される際、expo-imageが前の路線の画像(例: 千代田線)をそのまま表示し続けて、都営新宿線など別路線のアイコンが誤って表示される不具合を修正。TransferLineMark.tsxの<Image>にrecyclingKey(line.idベース、フォールバックはmark.sign)を追加し、リサイクル時にソースを確実に無効化するようにした。removeClippedSubviewsを外したが根治に至らんかったため、ThemeConfirmModal.tsx:169と同じrecyclingKeyパターンで本丸を叩く対応。Regression risk
TransferLineMarkを使っとる他の画面(Transfers以外にもPadLineMarks/HeaderJRWest/CommonCardなど)にも影響するが、recyclingKeyはリスト外でも副作用なしで安全。line.idがnullの場合はmark.signにフォールバックするため、キーが完全に欠ける事態は避けている。Test plan
npx biome check --unsafe --fix ./srcnpx tsc --noEmit🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート