Skip to content

fix(map): avoid mobile pin-selection flicker by replacing ?select via history API - #231

Open
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-mobile-pin-selection-flicker-i2xeig
Open

fix(map): avoid mobile pin-selection flicker by replacing ?select via history API#231
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-mobile-pin-selection-flicker-i2xeig

Conversation

@badjoke-lab

Copy link
Copy Markdown
Owner

Motivation

  • Pin taps on mobile caused visual flicker because router.replace triggered router-driven updates; the goal is to stop the flicker while preserving deep-linking for ?select= without touching Next Router behavior.

Description

  • Add replaceSelectParam(placeId: string | null) which updates only the select query using new URL(window.location.href) and window.history.replaceState to avoid router navigation.
  • Stop syncing selectedPlaceId via router.replace by removing the effect that performed router-based updates and leave the deep-link restoration from searchParams.get("select") intact.
  • Call replaceSelectParam(placeId) from openDrawerForPlace and replaceSelectParam(null) from closeDrawer so URL reflects user actions without causing re-render flicker.
  • Adjust the existing guard (skipNextSelectionRef) minimally to prevent an immediate double-update after user-triggered URL writes.

Testing

  • Ran npm run -s lint -- components/map/MapClient.tsx which failed due to next lint requiring a pages/app directory in this environment (lint did not validate the change here).
  • Ran npm run -s test:stats which reported unrelated repository test failures (Cannot find module '@/lib/db') so full test suite could not be validated end-to-end.
  • Ran npx tsc --noEmit which produced unrelated type/fixture errors in test files, so typecheck could not be fully validated in this CI-like environment.

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 8:56am

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