Commit Graph

73 Commits

Author SHA1 Message Date
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
Flomp
fc735130cc Add IRI to local resources (#1046)
* initial commit

* add remote trail/list

* fix errors

* update to use new IRIs

* use origin in migration instead

* use UnsafeWithoutHooks

* fix trail/list order of operations

* fix remote trail/list fetch

* fixes list document update

* fix errors

---------

Co-authored-by: Christian Beutel <>
2026-06-07 12:20:13 +02:00
slothful-vassal
65c2e3d932 fix: reduce Meilisearch load, debounce federation sync (#1012)
* optimize meili trail index

* several fixes

---------

Co-authored-by: Flomp <Flomp@users.noreply.github.com>
2026-06-01 16:01:59 +02:00
slothful-vassal
edad99c7b4 fix email change issues (#973)
* fix email change

* isolated email update

* update email UI immediately

---------

Co-authored-by: Christian Beutel <>
2026-05-10 08:38:55 +02:00
Flomp
d2ac49470a Federation Refactoring & Architecture Improvements (#930)
* initial commit

* add lists

* update permissions

* fix waypoint create

* needs_full_sync for activitypub trails

* fixes build issues

* fix list get

* further CSRF protection

* update API docs

* adds rate limiter

* fix tiptap mentions

* a bit more cleanup of main.go

* Fix migration order

* fixes reviewed notes

* require context for activitpub server calls

* improve hashing for identifier

* fix copy paste error

* fix sync trail/list issues

* fix summit log/comment duplicates

* adaptions after trail merge

* fix dockerignore

---------

Co-authored-by: Christian Beutel <>
Co-authored-by: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com>
2026-05-09 17:30:34 +02:00
slothful-vassal
b5739cb72e merge trails function added (#627)
* merge trails function added

* fix conflict resolve issues

* avoid incorrect authorship when merging trail comments

* require edit access for all selected trails before merge

* fix likes checkbox binding in trail merge modal

* improve error handling

* require editable target and deletable sources for merge

* avoid duplicate trail fetch during merge

* prevent duplicate likes when merging trails

* check photo download responses during trail merge

* add merge completion toast notifications

* cleanup

* small fixes

* move merge code to backend, option to merge single trail selection with similar one, automatic merge for integrations add as option, maintenance page to find and merge similar trails added

* fix build error

* fix

* docu, beautifying, refactoring

---------

Co-authored-by: Flomp <Flomp@users.noreply.github.com>
2026-05-09 13:09:26 +02:00
Pål Håland
127b7a0745 chore: meilisearch sdk rename and dependency upgrades (#958)
Co-authored-by: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com>
2026-05-07 22:58:06 +02:00
slothful-vassal
6d1d1236ef Trail Edit / Waypoints from photos: prevent creating different waypoints for near-by locations (#457)
* trail edit / waypoints from photos: prevent creating different waypoints for near-by locations

* remove not necessary imports

* remove changes from gitignore

* patch gitignore

* waypoint merge radius as category property

* change datamodel for merge radius (use more generic settings field for future implementations)

* fix npm run check issues

* several improvements/fixes

* fix

* move geo cluster code to db

* fix compile issue

* fix docker issue

* merge with existing waypoints

---------

Co-authored-by: Christian Beutel <>
Co-authored-by: Flomp <Flomp@users.noreply.github.com>
2026-04-29 11:15:06 +02:00
slothful-vassal
c9256aeb29 fix help links (#938) 2026-04-22 09:03:48 +02:00
slothful-vassal
369e71fcec hammerhead integration added (#628)
* hammerhead integration added

* typo corrected

* start date added, optimize some translations

* new option to send trail to hammerhead

* fix elevation information (was in cm)

* skip empty tracks on import

* update docs

* remove manual user-id input

* fix merge issues

* remove user-id from documentation

* fix hammerhead logo for light theme

* fix hammerhead logo for light theme

---------

Co-authored-by: Christian Beutel <>
Co-authored-by: Flomp <Flomp@users.noreply.github.com>
2026-03-20 13:58:34 +01:00
slothful-vassal
4b1dc784c9 fix issues updating avatar (#870) 2026-03-10 18:00:38 +01:00
Flomp
711a592038 Feature: API Tokens (#848)
* initial commit

* fix last_used timestamp

---------

Co-authored-by: Christian Beutel <>
2026-03-07 10:10:25 +01:00
Flomp
ba88d08078 Update meilisearch to v1.36.0 (#847)
* Update meilisearch to v1.36.0

* Merge remote-tracking branch 'origin/main' into chore/update-meilisearch

---------

Co-authored-by: Christian Beutel <>
2026-03-07 10:00:31 +01:00
Flomp
6cac905368 Use dynamic tokens & bootstrap meili config on startup (#839)
* initial commit

* persist meili token in cookie

* handle login/logout cookie invalidation

* fix review suggestions

---------

Co-authored-by: Christian Beutel <>
2026-02-27 08:52:53 +01:00
Jonas Plum
82ad995cdc Make the env var change non-breaking (#778)
* Fix typo in environment variable for sender address

Make the env var change non-breaking.

* Fix formatting of environment variable access
2026-02-06 11:49:19 +01:00
Flomp
32e6b6a6cc fix/pocketbase-smtp-sender-address-spelling (#769)
Co-authored-by: Christian Beutel <>
2026-02-04 11:26:49 +01:00
Robert Clarke
029f1f134b Return 401s when logged out of more activitypub api endpoints (#750)
Co-authored-by: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com>
2026-01-31 23:04:56 +01:00
Christian Beutel
962fddc1e2 adds dedup command 2025-09-13 13:27:23 +02:00
Christian Beutel
b2be48a282 improves initial meilisearch indexing speed 2025-09-13 11:33:19 +02:00
Christian Beutel
9c628c6511 cache public meilisearch key 2025-09-12 16:45:50 +02:00
Jonas Plum
f73a109866 Verifiy settings more strictly (#433)
* Verifiy settings more strictly

* Warn only for usage of default keys
2025-08-23 14:40:39 +02:00
Christian Beutel
fdb6ef3b76 adds category to trail card/item/feed 2025-08-22 17:19:12 +02:00
Jonas Plum
f9451d73bf Add healthchecks (#437) 2025-08-22 10:53:55 +02:00
Christian Beutel
03bf5aa5ad finishes feed 2025-07-12 16:36:40 +02:00
Christian Beutel
e8c7e7721a fixes feed 2025-07-11 17:13:30 +02:00
Christian Beutel
237d12bfec adds feed 2025-07-11 16:02:18 +02:00
Christian Beutel
25bf00a38b fixes timeline fetch 2025-07-11 12:12:42 +02:00
Christian Beutel
d577ac209e fixes trail indexing for summit logs 2025-07-10 14:45:53 +02:00
Christian Beutel
277b435c65 fixes private profile issues 2025-06-26 21:19:53 +02:00
Christian Beutel
b828cdb533 auto set pocketbase app name 2025-06-26 11:34:12 +02:00
Christian Beutel
6f0fc6db72 auto set pocketbase app url 2025-06-26 11:15:26 +02:00
Christian Beutel
4051d232c6 signs all activitypub requests 2025-06-26 00:51:15 +02:00
Christian Beutel
cb4f4f8125 fixes 404 for own private profile 2025-06-24 15:15:35 +02:00
Flomp
9276690d60 Federation (#327)
* initial commit federation

* more federation

* more federation

* more federation

* completes follow, accept, undo

* add trail create activity

* process trail create activity

* more trail create activity

* adds missing endpoints

* adds update and delete activity

* adds comment activities

* adds activities back

* adds summit logs activities

* deletes follow counts table

* fixes migrations

* fixes migrations

* fixes migrations

* fixes migrations

* adds remote profiles

* ctd

* ctd

* we are getting closer...

* adds public summit logs

* fixes federated trails in lists

* adds remote lists

* adds list activites

* fixes lists

* adds notifications

* adds iri redirect

* fixes comments and summitlogs

* fixes follows and profiles

* adds asynchronous send

* fixes list search

* adds encryption key

* bug fixes

* fixes activity signing

* removes custon activity object types

* adds html editor

* fixes html editor

* fixes display issues on mastodon

* adds federated sharing

* finishes announcements

* fixes small summit log issues

* adds trail likes

* finalizes likes

* fixes images for komoot

* add disable federation option

* adds private profiles

* updates docs

* adds federated comments

* adds trail and comments actvitiypub routes

* adds mentions to editor

* adds mentions to trails, comments, summit logs

* updates theme

* updates theme

* update docs

* update docs

* updates docs

* fixes various frontend problems

* fixes activitypub follows api

* updates docs

* updates docs

---------

Co-authored-by: Christian Beutel <>
2025-06-21 10:09:22 +02:00
Christian Beutel
3804a384c3 Fixes tags not showing on front page 2025-04-21 20:53:54 +02:00
Christian Beutel
15aa629b6c allows indexing to continue on error 2025-04-16 11:50:37 +02:00
Christian Beutel
5d4a676a38 Adds mail settings envs 2025-04-15 20:24:18 +02:00
Christian Beutel
3973fe7dd9 converts meilisearch key verification to warning 2025-03-29 17:08:40 +01:00
Christian Beutel
2ce2b5e742 makes POCKETBASE_ENCRYPTION_KEY optional 2025-03-28 21:10:50 +01:00
Christian Beutel
07edb2c457 fixes decryption check method 2025-03-28 20:15:03 +01:00
Tomaz Muraus
123470b81b Fix for double encryption of secrets (#216)
* Update db init code to verify that all the required environment
variables are set.

* Add a workaround for integration secret encryption code - make sure we
don't try to encrypt the secret twice.

This is needed due to the bug in the code which would encrypt secrets
even if they are already encrypted.

* fixes spelling & folder structure

---------

Co-authored-by: Christian Beutel <>
2025-03-28 19:54:43 +01:00
Christian Beutel
af106d4859 fixes double encryption of integration secrets 2025-03-28 17:11:10 +01:00
Christian Beutel
b261ada15c adds tags 2025-03-19 22:30:09 +01:00
Christian Beutel
80275ee153 fix shares index bug 2025-03-17 17:59:08 +01:00
Christian Beutel
d23444c799 front end fixes 2025-03-17 02:09:00 +01:00
Christian Beutel
eca79758ec updates migrations 2025-03-17 00:03:56 +01:00
Christian Beutel
c765e6391d start migration to pocketbase 0.23 2025-03-16 21:20:05 +01:00
Christian Beutel
92433ec618 fixes thumbnail bug 2025-03-16 18:39:48 +01:00
Christian Beutel
a2ad4a4800 komoot planned vs completed 2025-02-14 13:22:28 +01:00
Christian Beutel
550e3daa43 map speed improvements 2025-02-10 18:10:14 +01:00