worldwide todo list: global map (List/Map toggle, clustered category pins, Global strip, pick on map, location_precision, tasks.geojson)
All checks were successful
Deploy production / deploy (push) Successful in 1m13s

This commit is contained in:
2026-10-26 08:38:51 +00:00
parent 21b10ea894
commit 9d79dfb43a
15 changed files with 42669 additions and 13 deletions

View File

@@ -8,6 +8,19 @@ export const WORLDTODO_REQUEST_KINDS = ['add', 'edit', 'delete'] as const;
export type RequestKind = (typeof WORLDTODO_REQUEST_KINDS)[number];
export const WORLDTODO_REQUEST_STATUSES = ['pending', 'approved', 'rejected'] as const;
export type RequestStatus = (typeof WORLDTODO_REQUEST_STATUSES)[number];
export const WORLDTODO_LOCATION_PRECISIONS = ['exact', 'approximate', 'none'] as const;
export type LocationPrecision = (typeof WORLDTODO_LOCATION_PRECISIONS)[number];
/** Same rule as the tasks_location_precision trigger: what kind of pin a task gets. */
export function precisionFor(
scale: Scale,
lat: number | null | undefined,
lon: number | null | undefined
): LocationPrecision {
if (lat === null || lat === undefined || lon === null || lon === undefined) return 'none';
if (scale === 'planet') return 'none';
return scale === 'street' || scale === 'city' ? 'exact' : 'approximate';
}
/** The only keys a request payload may carry (checked server-side). */
export const EDITABLE_FIELDS = [
@@ -66,6 +79,8 @@ export type PublicTask = {
countryCode: string | null;
lat: number | null;
lon: number | null;
/** Map pin kind (see precisionFor). */
locationPrecision: LocationPrecision;
status: Status;
sourceUrls: string[];
sourceDate: string | null;