fix(web): /search — fix duplicated filter bar + invisible map markers
Some checks failed
Deploy / Smoke Test Staging (push) Has been cancelled
Deploy / Deploy to Staging (push) Has been cancelled
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 5s
CI / AI Services (Python) — Smoke (push) Failing after 5s
Deploy / Build Web Image (push) Failing after 4s
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 43s
Deploy / Build API Image (push) Failing after 6s
Security Scanning / Trivy Scan — AI Services Image (push) Has started running
Security Scanning / Trivy Filesystem Scan (push) Has been cancelled
Security Scanning / Security Gate (push) Has been cancelled
CI / E2E Tests (push) Has been skipped
Deploy / Build AI Services Image (push) Failing after 4s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 3s
E2E Tests / Playwright E2E (push) Failing after 8s
Security Scanning / Trivy Scan — API Image (push) Failing after 36s
Security Scanning / Trivy Scan — Web Image (push) Failing after 49s
Deploy / Rollback Staging (push) Has been cancelled
Deploy / Smoke Test Production (push) Has been cancelled
Deploy / Rollback Production (push) Has been cancelled
Deploy / Deploy to Production (push) Has been cancelled

- Hide the desktop horizontal FilterBar in list/split modes — the
  sidebar already renders an identical control set, so showing both
  duplicated every dropdown. Keep horizontal bar only when in map
  mode where there's no sidebar.
- Replace `hsl(var(--…))` paint colors in ListingMap with literal
  hex constants. Mapbox-gl's color parser rejects CSS variable
  references and was throwing
  'circle-color: Could not parse color from value hsl(var(--primary))'
  for cluster + marker layers, leaving the map blank.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-29 17:54:28 +07:00
parent b9a1a24f65
commit 925863e471
2 changed files with 21 additions and 15 deletions

View File

@@ -351,7 +351,10 @@ function SearchContent() {
</Button>
</div>
{/* Desktop horizontal filter bar */}
{/* Desktop horizontal filter bar — only when there's no sidebar
(i.e. full-width map view). Showing it alongside the sidebar in
list/split mode would just duplicate every control. */}
{viewMode === 'map' && (
<div className="mb-4 hidden lg:block">
<FilterBar
filters={filters}
@@ -360,6 +363,7 @@ function SearchContent() {
layout="horizontal"
/>
</div>
)}
{/* Mobile filter panel */}
{showMobileFilters && (

View File

@@ -198,7 +198,9 @@ function ListingMapInner({
clusterRadius: 50,
});
// Cluster circles
// Cluster circles. Mapbox-gl's color parser rejects `hsl(var(--…))` —
// it only accepts literal CSS colors. We use hex constants tuned to
// match the design-system primary/accent palette in dark mode.
map.addLayer({
id: CLUSTER_LAYER_ID,
type: 'circle',
@@ -208,7 +210,7 @@ function ListingMapInner({
'circle-color': [
'step',
['get', 'point_count'],
'hsl(var(--primary))',
'#22c55e', // primary (emerald-500)
10,
'#f1a928',
30,
@@ -248,8 +250,8 @@ function ListingMapInner({
'text-allow-overlap': true,
},
paint: {
'text-color': 'hsl(var(--card-foreground))',
'text-halo-color': 'hsl(var(--card))',
'text-color': '#f5f5f4', // card-foreground (stone-100)
'text-halo-color': '#1c1917', // card (stone-900)
'text-halo-width': 8,
},
});
@@ -269,8 +271,8 @@ function ListingMapInner({
'text-allow-overlap': true,
},
paint: {
'text-color': 'hsl(var(--primary-foreground))',
'text-halo-color': 'hsl(var(--primary))',
'text-color': '#ffffff', // primary-foreground (high-contrast on emerald)
'text-halo-color': '#22c55e', // primary (emerald-500)
'text-halo-width': 10,
},
});