Skip to content

Transfersの乗換路線画像がAndroidで別路線のwebpになる問題を修正 - #5795

Merged
TinyKitten merged 1 commit into
devfrom
feature/fix-transfers-android-image-recycle
Apr 11, 2026
Merged

TinyKitten merged 1 commit into
devfrom
feature/fix-transfers-android-image-recycle

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 11, 2026 •

Copy link
Copy Markdown
Member

概要

Transfers コンポーネントの乗換路線リストで、主にAndroid端末において別路線のwebp画像が一時的に表示される不具合を修正。

原因

FlatList に指定していた removeClippedSubviews={Platform.OS === 'android'} が原因。
この最適化フラグはAndroidで画面外のネイティブViewをデタッチ/再アタッチするが、expo-image と組み合わせた際に再アタッチ時に古い source のwebpが残存して表示されるという既知の描画不具合がある。

乗換路線リストはそもそも数件〜十数件程度のため、この最適化の恩恵は薄く、削除することで解決。

変更点

  • src/components/Transfers.tsx
    • FlatList の removeClippedSubviews 指定を削除
    • 使用されなくなった Platform の import を削除

リグレッションリスク

  • 低。乗換路線リストは短尺のため、removeClippedSubviews 削除によるパフォーマンス劣化はほぼ発生しない想定。

ローカル実行コマンド

  • npx biome check --unsafe --fix ./src/components/Transfers.tsx

動作確認

  • Android実機で乗換表示を複数駅分スクロールし、別路線のwebpが混入しないことを確認
  • iOSで従来通り表示されることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • リファクタリング
    • コンポーネントのインポート文を簡潔にしました。
    • リスト表示の動作を調整しました。

@github-actions github-actions Bot added the react label Apr 11, 2026
@coderabbitai

coderabbitai Bot commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

src/components/Transfers.tsx ファイルで、react-native からのインポートを簡素化しました。Platform インポートを削除し、複数行のインポート定義を単一行に統合し、FlatList から Platform に基づいて条件付きで有効化されていた removeClippedSubviews プロップを削除しました。

Changes

Cohort / File(s) Summary
Import Refactoring
src/components/Transfers.tsx
react-native インポートを整理し、Platform インポートを削除。FlatList の removeClippedSubviews プロップと関連する Android 向けの条件付き処理を廃止。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 インポート行をすっきりと
Platform の呼び出しも消えて
FlatList は今日も軽やかに
Android も iOS も仲良くね
コードは今、もっときれいさ

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはPRの主な変更点を明確に要約しており、Androidでの乗換路線画像の不具合修正という核となる変更を正確に反映している。
Description check ✅ Passed PRの説明はテンプレートのほぼすべてのセクション(概要、変更点、テスト手順など)を含んでいる。ただし、「変更の種類」セクションでバグ修正にチェックがされていない。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feature/fix-transfers-android-image-recycle

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

@TinyKitten TinyKitten self-assigned this Apr 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/Transfers.tsx (1)

270-275: FlatList 変更意図を1行コメントで残すと再発防止になります。

この最適化を外した理由を近接コメントで明示しておくと、将来の最適化時に意図せず戻されるリスクを減らせます。

📝 提案差分
       <TransfersHeading theme={theme} />
+      {/* Android描画不具合回避のため、removeClippedSubviews は意図的に指定しない */}
       <FlatList
         contentContainerStyle={styles.transferView}
         data={lines}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Transfers.tsx` around lines 270 - 275, Add a one-line comment
next to the FlatList usage explaining why the optimization was removed and the
intent not to revert it inadvertently; reference the FlatList block that uses
contentContainerStyle={styles.transferView}, data={lines}, keyExtractor and
renderItem={renderTransferLine} and state explicitly that the change was
intentional (e.g., performance/behavior tradeoff or platform bug) so future
maintainers won't reintroduce the previous optimization by accident.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/Transfers.tsx`:
- Around line 270-275: Add a one-line comment next to the FlatList usage
explaining why the optimization was removed and the intent not to revert it
inadvertently; reference the FlatList block that uses
contentContainerStyle={styles.transferView}, data={lines}, keyExtractor and
renderItem={renderTransferLine} and state explicitly that the change was
intentional (e.g., performance/behavior tradeoff or platform bug) so future
maintainers won't reintroduce the previous optimization by accident.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fe75706b-984c-4978-b19a-afd0f04ee13c

📥 Commits

Reviewing files that changed from the base of the PR and between c5f3d48 and 5a430eb.

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

@TinyKitten
TinyKitten merged commit 45da183 into dev Apr 11, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the feature/fix-transfers-android-image-recycle branch April 11, 2026 00:16
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