Skip to content

fix(map): bubbles and header counts follow active filters - #60

Merged
Spoof14 merged 2 commits into
mainfrom
fix/filtered-bubbles
Oct 12, 2026
Merged

Spoof14 merged 2 commits into
mainfrom
fix/filtered-bubbles

Conversation

@Spoof14

@Spoof14 Spoof14 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Problem

Map bubbles and header counts kept showing homes that active filters exclude.

Root cause

mapLayersForFilters (client) mixed several sources of truth:

  • When some homes matched, bubbles were rebuilt from matched individual homes only, silently dropping Naver's count-only grouped clusters, while the header kept the server's per-source totals (e.g. rmax=30 at z14: header Naver 7,418 but bubbles/“on map” summed to 68).
  • When nothing matched, it fell back to the server's clusters (comment: "dropping them produced a blank map"), so an empty filtered area still drew bubbles.
  • Naver grouped counts (id naver:cluster:) bypass filterListings entirely. The Naver cluster API accepts type, trade type, price, size and building age, but not text, floor, listing date, foreigner or photos, so with those filters the counts were presented as filtered but were not.
  • Header counts came from unfiltered stats; Ask-picks mode kept live-search counts while drawing only picks; list total used the same stats.

Fix

  • Server returns count-only Naver rows separately (grouped) and flags them (unfiltered) when an active filter the Naver cluster API cannot take is on; clusters carry unfilteredCount/groupedCount; stats carry naverUnfiltered.
  • Client: homes are filtered with the shared predicate; when all homes were loaded, bubbles are rebuilt from filtered homes + radius/polygon-clipped grouped rows (empty area => no bubbles). If the server capped the home list, its (server-filtered) clusters are used.
  • Bubbles that include unfilterable counts are dashed/greyed with tooltip "Count may include homes outside your filters" (KO translated); header shows ≈ for Naver.
  • Header per-source counts, "on map" summary, list total and Ask mode are all derived from what is drawn (layerSourceCounts).
  • Tests for clustering flags, layers, counts, grouped flagging in aggregate, merge.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ziggybang Ready Ready Preview Oct 12, 2026 2:42am UTC
ziggybang-5xjx Ready Ready Preview Oct 12, 2026 2:42am UTC

@Spoof14
Spoof14 merged commit cd10857 into main Oct 12, 2026
4 checks passed

This branch was successfully deployed

2 active deployments
Preview – ziggybang — 5c949a55 Deployed Oct 12, 2026 by vercel[bot]
Preview – ziggybang-5xjx — 5c949a55 Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants