Skip to content

Clustered regions don't open popup when selected from search results #23

@comnam90

Description

@comnam90

Bug Description

When selecting a clustered region (regions grouped together in a map cluster bubble) from search results, the map pans to the region but the popup does not open. Non-clustered regions work correctly.

Steps to Reproduce

  1. Open the map at https://vdcmap.bcthomas.com
  2. In the search box, type "East US 2" (or any other clustered region)
  3. Click on the search result
  4. Expected: Map pans to region AND popup opens showing region details
  5. Actual: Map pans to region but popup does NOT open

Expected Behavior

All regions should open their popup when selected from search results, regardless of whether they're in a cluster or standalone.

Actual Behavior

  • Non-clustered regions (e.g., "Canada Central"): Popup opens correctly
  • Clustered regions (e.g., "East US 2", "US East 1"): Popup does not open

Test Evidence

Playwright test results confirm this behavior:

  • Test with "East US 2" (clustered): FAILS - popup not visible
  • Test with "Canada Central" (non-clustered): PASSES - popup appears

Technical Context

  • Leaflet.js map with marker clustering
  • Search functionality in layouts/index.html
  • Regions that are close together are grouped into numbered cluster bubbles on the map
  • Direct marker clicks work correctly (when you can reach the individual marker)
  • Only search-triggered popup opening fails for clustered regions

Affected Code

Likely in the search result click handler around line 600-700 in layouts/index.html

Test Coverage

Test case added in tests/ui.spec.ts:

  • Line ~75: Failing test marked as .fixme() demonstrating the bug
  • Line ~93: Passing control test with non-clustered region

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingui

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions