Skip to content

モバイル BottomSheet 遷移中の Leaflet invalidateSize を抑止して画面チカつき解消 - #229

Open
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-mobile-flicker-on-bottomsheet-open
Open

モバイル BottomSheet 遷移中の Leaflet invalidateSize を抑止して画面チカつき解消#229
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-mobile-flicker-on-bottomsheet-open

Conversation

@badjoke-lab

Copy link
Copy Markdown
Owner

Motivation

  • モバイルでピン選択→BottomSheet 表示時に発生する画面全体のチカつきは、Sheet の遷移と visualViewport/resize、および Leaflet の invalidateSize() が同時に複数回走ることによる再レイアウト連鎖が原因と推測されるため、遷移中は invalidateSize を走らせないことで UX を安定化する。

Description

  • components/map/MapClient.tsx を変更し、invalidateMapSize(reason) を受け取るようにして、シート遷移中は実行を抑止して理由をデファーする機構(isSheetTransitioningRef, hasDeferredInvalidateRef, deferredInvalidateReasonRef)を追加した。
  • 遅延フラッシュは1回だけ行う実装として beginSheetTransition(reason) を導入し、遷移完了判定をタイマー(280ms)で行ってデファーしていた invalidateSize を一度だけ実行するようにした。
  • requestAnimationFrame と短い setTimeout(0) を組み合わせて実際の invalidateSize 呼び出しをまとめ、onStageChange と mobile シートの open/close をトリガーとして遷移 gating を開始するようにした(副作用のクリーンアップも追加)。

Testing

  • npm run build を実行してビルドは成功したことを確認した。
  • npm run dev で開発サーバを起動し、Playwright スクリプトでモバイルビュー(360x640)で /map を開いてマーカークリック→BottomSheet 表示の操作を自動実行し、スクリーンショットを取得して動作を目視確認できた。
  • 自動単体テストは追加していないが、手順に沿ったビルド/起動/簡易 UI スモーク検証は通過している。

Codex Task

@vercel

vercel Bot commented Feb 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cryptopaymap-v2 Ready Ready Preview, Comment Feb 22, 2026 0:58am

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