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

@@ -25,6 +25,7 @@ const WORLDTODO_SCALES = ['planet', 'region', 'country', 'city', 'street'] as co
const WORLDTODO_STATUSES = ['open', 'in_progress', 'done'] as const;
const WORLDTODO_REQUEST_KINDS = ['add', 'edit', 'delete'] as const;
const WORLDTODO_REQUEST_STATUSES = ['pending', 'approved', 'rejected'] as const;
const WORLDTODO_LOCATION_PRECISIONS = ['exact', 'approximate', 'none'] as const;
const tsvector = customType<{ data: string }>({ dataType: () => 'tsvector' });
@@ -36,6 +37,11 @@ export const worldtodoRequestStatus = worldtodoSchema.enum(
WORLDTODO_REQUEST_STATUSES
);
export const worldtodoLocationPrecision = worldtodoSchema.enum(
'location_precision',
WORLDTODO_LOCATION_PRECISIONS
);
export const worldtodoCategories = worldtodoSchema.table('categories', {
slug: text('slug').primaryKey(),
label: text('label').notNull(),
@@ -61,6 +67,13 @@ export const worldtodoTasks = worldtodoSchema.table(
countryCode: text('country_code'),
lat: doublePrecision('lat'),
lon: doublePrecision('lon'),
/**
* How the map treats lat/lon: street and city tasks are exact pins, region and country
* pins sit at a rough centre, planet tasks (or no coordinates) get no pin. Set from scale
* and lat/lon by the tasks_location_precision trigger (hand-written in the migration), so
* it never drifts from the data.
*/
locationPrecision: worldtodoLocationPrecision('location_precision'),
status: worldtodoStatus('status').notNull().default('open'),
sourceUrls: text('source_urls').array().notNull(),
/** Date of the main source as given ('2026-09', '2026-10-21'). */