Files
wanderer/web/package.json
Pål Håland 197cd8d04e feat: implement server-side map clustering (#991)
* feat: meilisearch bounding box intersection and map filtering

* feat: tiered clustering and polyline filtering based on bounding box diagonal

Addressing review comments with optimized performance and data accuracy:
- Implemented a two-tiered search strategy (Summary vs. Detailed) to provide 100% accurate cluster counts while minimizing metadata traffic.
- Added a client-side ID-based cache to eliminate redundant network requests for trails already in memory.
- Introduced tiered 'detail shedding' that dynamically hides small trail lines when zooming out to maintain smooth panning performance.
- Fixed Svelte 5 reactivity issues to ensure clusters reappear instantly when trail detail is shed.
- Consolidated zoom thresholds into centralized constants for system-wide consistency.
- Updated Meilisearch configuration to support efficient ID-based filtering.

* feat: implement server-side map clustering using Meilisearch and Supercluster

- Implemented SvelteKit server-side clustering route at `/api/v1/search/trails/cluster` using the `supercluster` library.
- Integrated backend search results with the new clustering endpoint to improve performance for large trail datasets.
- Fixed Svelte 5 reactivity in `MapWithElevationMaplibre.svelte` by making `mapLoaded` reactive and fixing destructuring of `` map data.
- Removed obsolete client-side zoom constraints (`minzoom`/`maxzoom`) from `TrailLayer`, `PreviewLayer`, and `ClusterLayer` to allow dynamic visibility controlled by backend attributes.
- Fixed a bug where unauthenticated users generated invalid Meilisearch filters.
- Optimized map page performance by caching bounding box and filter values in the route loader.
- Updated `ClusterLayer` font to `Noto Sans Regular` to match available tileserver resources.

* feat: implement dynamic polyline visibility based on result density

- Replaced static zoom-based diagonal thresholds with a dynamic "Top N" approach for polyline visibility.
- Updated `/api/v1/search/trails/cluster` to mark only the top `MAP_MAX_POLYLINES` (default 100) trails by bounding box diagonal as "large".
- Modified `trails_search_bounding_box` store function to always fetch polylines for trails marked as large, regardless of zoom level.
- Removed obsolete `MAP_*_ZOOM_DIAGONAL_LIMIT` constants and simplified map layer constructors by removing tier-based filtering.
- Updated environment configurations and documentation to use the new `PUBLIC_MAP_MAX_POLYLINES` variable.

* refactor: remove obsolete zoom-based map clustering thresholds

Following the transition to dynamic server-side clustering based on result density (Top N polylines), this commit removes all remaining zoom-based thresholds and logic.

- Removed PUBLIC_MAP_LOW_ZOOM_THRESHOLD, PUBLIC_MAP_MEDIUM_ZOOM_THRESHOLD, and PUBLIC_MAP_HIGH_ZOOM_THRESHOLD environment variables.
- Removed the 'mapClusterMinZoom' user setting from the schema, models, and settings UI.
- Simplified the map component and MapLibre layer managers by removing unused 'clusterMinZoom', 'minZoom', and 'maxZoom' parameters.
- Cleaned up obsolete 'map-cluster-zoom-level' translation keys across all locales.
- Updated documentation to reflect the removal of these variables.

* chore: remove map clustering debug logs

* docs: update changelog and fix global zoom feature disappearance

* fix: address PR reviews and refine map cluster/preview visuals

* feat: implement configurable map cluster zoom and trail start marker settings

* feat: render single unclustered shedded trails as start markers instead of cluster circles

* minor fixes

* minor ui changes

* fix missing entries in map list

* remove redundant map clustering zoom clamp

* fix merge issues

* fix merge issues

* fixes

* hide popup for trails without details

* several improvements

* prevent import of client trail_store in server cluster code

* update changelog

---------

Co-authored-by: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com>
2026-06-07 13:00:26 +02:00

95 lines
2.8 KiB
JSON

{
"name": "wanderer",
"version": "0.19.2",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"openapi:generate": "node scripts/generate-openapi.js",
"start": "node watcher.js & node build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:integration": "playwright test",
"test:unit": "vitest --passWithNoTests"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@sveltejs/adapter-auto": "^7.0.1",
"@sveltejs/enhanced-img": "^0.10.4",
"@sveltejs/kit": "^2.60.1",
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@tailwindcss/typography": "^0.5.19",
"@types/canvas-confetti": "^1.9.0",
"@types/node": "^25.3.3",
"postcss": "^8.5.6",
"svelte": "^5.55.7",
"svelte-check": "^4.3.6",
"sveltekit-openapi-generator": "^0.1.5",
"tslib": "^2.4.1",
"typescript": "^5.9.3",
"vite": "^8.0.9"
},
"type": "module",
"dependencies": {
"@felte/validator-zod": "^1.0.18",
"@fortawesome/fontawesome-free": "^7.1.0",
"@sveltejs/adapter-node": "^5.5.2",
"@tailwindcss/vite": "^4.2.4",
"@threlte/core": "^8.5.9",
"@threlte/extras": "^9.14.6",
"@tiptap/core": "^2.14.0",
"@tiptap/extension-heading": "^2.14.0",
"@tiptap/extension-link": "^2.14.0",
"@tiptap/extension-mention": "^2.14.0",
"@tiptap/extension-placeholder": "^2.14.0",
"@tiptap/extension-underline": "^2.14.0",
"@tiptap/pm": "^2.14.0",
"@tiptap/starter-kit": "^2.14.0",
"@tiptap/suggestion": "^2.14.0",
"@turf/destination": "^7.3.3",
"@turf/distance": "^7.3.3",
"@types/chart.js": "^4.0.1",
"@types/supercluster": "^7.1.3",
"@types/three": "^0.183.1",
"@xmldom/xmldom": "^0.8.12",
"activitypub-types": "^1.1.0",
"autoprefixer": "^10.4.24",
"canvas-confetti": "^1.9.4",
"canvg": "^4.0.3",
"chart.js": "^4.5.1",
"chartjs-plugin-crosshair": "^2.0.0",
"chartjs-plugin-zoom": "^2.1.0",
"chokidar": "^5.0.0",
"crypto-random-string": "^5.0.0",
"felte": "^1.3.0",
"heic2any": "^0.0.4",
"instead": "^1.0.3",
"isomorphic-xml2js": "^0.1.3",
"json-diff-ts": "^4.8.2",
"jspdf": "^4.2.1",
"jszip": "^3.10.1",
"maplibre-gl": "^4.7.1",
"marked": "^17.0.4",
"meilisearch": "^0.57.0",
"ngeohash": "^0.6.3",
"nouislider": "^15.7.1",
"pdfkit": "^0.17.2",
"photoswipe": "^5.4.3",
"pocketbase": "^0.26.8",
"qrcode": "^1.4.4",
"supercluster": "^8.0.1",
"svelte-i18n": "^4.0.0",
"tailwindcss": "^4.2.4",
"three": "^0.183.1",
"vitest": "^4.1.4",
"zod": "^3.24.1"
},
"overrides": {
"sveltekit-openapi-generator": {
"vite": "$vite"
}
}
}