Make the detail column useful for places no encyclopaedia describes

A restaurant got nothing: no wiki article, and a coordinate search around it
returns whatever was photographed nearby rather than the place itself. Three
changes, all on free sources:

OpenStreetMap facts. A tagged restaurant carries its cuisine, its opening hours,
a link to its menu, outdoor seating, step-free access and diet tags. Those
arrive with the details lookup the dialog already makes, so showing them as
chips costs nothing and is the single biggest gain for exactly the places that
were empty before. Only positive facts are listed - "no outdoor seating" is
noise.

Commons categories. Where a place has a wikimedia_commons tag, its category is
pictures OF it; geosearch falls back in when the category is empty.

Wikivoyage before Wikipedia. Same API, same licence, but it describes a place
for someone about to visit rather than opening with area in square kilometres.
Two sentences instead of three, because this sits beside a form.

The column also follows the section-heading idiom Vacay and the dashboard share
(uppercase overline, wide tracking), its header matches the Saved places panel
beside it, and a lead picture with a row underneath replaces the two-column
grid that left a hole on every odd count. Credits wrap over two lines instead
of truncating - a cut-off name credits nobody.

Saved places stops after ten with a Show more button; search and filters still
run over everything, not just the visible page.

Form spacing is one rhythm (12px between groups, 8px inside, 4px label to
field) and Notes matches Description in height. The OSM notice fits on one line
and no longer claims there are no photos, which stopped being true when the
column started fetching them from Wikimedia. The clipboard hint is gone; paste
still works.
This commit is contained in:
Maurice
2026-08-09 23:37:02 +02:00
committed by Maurice
parent fc9ac64496
commit d98d597581
61 changed files with 1120 additions and 232 deletions
+35 -1
View File
@@ -124,7 +124,7 @@ export const placePhotoCandidateSchema = z.object({
});
export type PlacePhotoCandidate = z.infer<typeof placePhotoCandidateSchema>;
export const placeDescriptionSourceSchema = z.enum(['google', 'osm', 'wikipedia']);
export const placeDescriptionSourceSchema = z.enum(['google', 'osm', 'wikivoyage', 'wikipedia']);
export type PlaceDescriptionSource = z.infer<typeof placeDescriptionSourceSchema>;
export const placeDescriptionSchema = z.object({
@@ -135,6 +135,39 @@ export const placeDescriptionSchema = z.object({
});
export type PlaceDescription = z.infer<typeof placeDescriptionSchema>;
/**
* A practical fact about a place, taken from its OpenStreetMap tags.
*
* This is what makes the column worth opening for a restaurant: places like
* that have no encyclopaedia article and no photograph of their own, but they
* very often carry a cuisine, opening hours and a link to their menu. The tags
* arrive with the details lookup the dialog already makes, so none of this
* costs an extra request.
*
* `kind` is translated client-side; `value` is provider data and stays as-is.
*/
export const placeFactKindSchema = z.enum([
'cuisine',
'openingHours',
'menu',
'outdoorSeating',
'takeaway',
'delivery',
'wheelchair',
'vegetarian',
'vegan',
'internetAccess',
]);
export type PlaceFactKind = z.infer<typeof placeFactKindSchema>;
export const placeFactSchema = z.object({
kind: placeFactKindSchema,
/** Free-text detail ("regional", "Mo-Sa 17:30+"); null for a plain yes. */
value: z.string().nullable(),
url: z.string().nullable(),
});
export type PlaceFact = z.infer<typeof placeFactSchema>;
export const mapsPlaceEnrichmentRequestSchema = z.object({
/** Google place id or `osm:<type>/<id>`; empty for a coordinate-only lookup. */
placeId: z.string().max(300).optional(),
@@ -149,6 +182,7 @@ export type MapsPlaceEnrichmentRequest = z.infer<typeof mapsPlaceEnrichmentReque
export const mapsPlaceEnrichmentResultSchema = z.object({
photos: z.array(placePhotoCandidateSchema),
description: placeDescriptionSchema.nullable(),
facts: z.array(placeFactSchema),
/** True when the admin switched enrichment off; the column then stays quiet. */
disabled: z.boolean().optional(),
});