feat(places): notes, visits, tours, history, tags and location in the place sheet, saved lists on the trip map

Both the desktop sheet and the phone sheet of All places show the place's
location as a badge, its notes per list, its visits from trips (hidden without
any), linked tours and bookings, its change history and the reader's own tags
with a tag filter. A trip map can show the places of linked lists and add one
to the trip. All places reloads after a list is added or removed.
This commit is contained in:
Maurice
2026-11-29 21:16:38 +01:00
parent 9abd16b907
commit d008331e5f
84 changed files with 3874 additions and 288 deletions
+26
View File
@@ -0,0 +1,26 @@
import { useEffect, useMemo } from 'react';
import { tripVisitedEntry, usePlaceVisitsStore, watchPlaceVisits } from '../store/placeVisitsStore';
/**
* The places of a trip the reader confirmed a visit at (PLC-23), there or at the
* same place elsewhere, for the "visited" choice of the place list and the map.
* Read when the trip opens and again whenever a visit changes; offline it stays
* empty, so the choice simply is not offered.
*/
export function useTripVisitedIds(tripId: number | null | undefined): ReadonlySet<number> {
const entry = usePlaceVisitsStore((s) => tripVisitedEntry(s, tripId));
const load = usePlaceVisitsStore((s) => s.loadTripVisited);
useEffect(() => watchPlaceVisits(), []);
useEffect(() => {
if (tripId == null) return;
load(tripId).catch(() => {
// Offline or without access: no visited places to offer.
return undefined;
});
}, [tripId, load]);
const ids = entry?.placeIds;
return useMemo(() => new Set(ids ?? []), [ids]);
}