Commit Graph

2 Commits

Author SHA1 Message Date
Ho Ngoc Hai
d7c5b1ca2c perf(map): migrate listing-map to GeoJSON clustering, eliminate DOM marker thrash
- Replace 200+ individual mapboxgl.Marker DOM nodes with a single GeoJSON
  source using Mapbox built-in clustering (clusterRadius=50, maxZoom=14)
- Cluster + unclustered price labels render as WebGL symbol/circle layers —
  zero per-frame DOM cost, 60fps pan on mid-range Android
- Decouple selectedListingId updates from full marker teardown: selection
  state is now a `selected:0|1` feature property, updated via setData() only
- fitBounds no longer fires on hover/selection changes — camera moves only
  when the listings array identity changes (filter change)
- Fix stale onMarkerClick closure with a stable ref pattern
- Decided clustering strategy: Mapbox built-in over supercluster (no extra
  dep, sufficient for <5k results; see docs/perf/listing-map-perf-analysis.md)
- Add perf analysis doc to apps/web/docs/perf/

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 11:02:05 +07:00
Ho Ngoc Hai
0fc23b7ebd feat(web): add missing error boundaries across all route groups
- Add global-error.tsx at app root (inline styles, wraps html/body)
- Add group-level error.tsx for (public) — catches all unguarded public routes
- Add per-route error.tsx for high-traffic public segments:
  listings, listings/[id], du-an, du-an/[slug],
  khu-cong-nghiep, khu-cong-nghiep/[slug], agents, agents/[id], payment
- Add auth/callback/error.tsx for OAuth callback failures
- Commit coverage table to apps/web/docs/error-boundary-coverage.md

Pre-existing API test failures unrelated to this change (broker-cert,
update-listing-status, mcp.module) were already failing on master.

Closes GOO-115

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 10:49:15 +07:00