Skip to content

fix(map): draw an area, not a pin, for a listing with no real place - #374

Merged
Ardnived merged 13 commits into
mainfrom
fix/approximate-places
Nov 10, 2026
Merged

Ardnived merged 13 commits into
mainfrom
fix/approximate-places

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes bug 15 from the 6 Nov sweep. About a dozen in-person listings give only a town, so their stored point is the town's centre. The map pinned that point as if it were the venue: Sneek's landed on an Albert Heijn supermarket, with a Directions button to it.

hasApproximatePlace (in lib/shape/event.ts) decides which listings have no real place. It is the one reading of "inactive" — the panel reads the same predicate, so the two cannot describe the same listing differently:

  • Every inactive listing. It meets only on request. Its page already hid the street and Directions, and now the map agrees.
  • Every class with no dates left. resolveEventDisplay already reports these as inactive, and the panel already hid their street — the map pinned them anyway. A course that is merely over is ended, not inactive, and keeps its pin and its street.
  • Any listing whose street names no place, as read by hasVagueAddress: a placeholder, the town's own name, or a "city centre" word.

Such a listing shows only the town's name, offers no directions, and frames its neighbourhood at VAGUE_ZOOM.

Change outline

On the map it is a pin, then a ring, then a dot — exactly one of the three at any zoom. All three read the clustering events source behind !has point_count, so the listing joins a cluster like any other and never draws a ring while a bubble beside it already counts it.

Band What draws Why it hands over there
below RING_ZOOM ≈ 9 the ordinary pin the ring would be narrower than the pin itself
RING_ZOOM to RING_MAX_ZOOM ≈ 11.7 a VAGUE_RADIUS_KM (3km) ring, drawn to scale the radius doubles per level, so past 11.7 it is as wide as the narrowest map the interface renders in
above RING_MAX_ZOOM a fixed-size dot past the bound the ring's outline is off screen, leaving a flat tint with no marker that answered every click and hover across the map

The ring is a circle layer rather than a polygon: a polygon cannot cluster, and its radius interpolates exponential 2 on zoom — exactly Mercator's doubling — divided by each feature's cosLat, which an expression cannot read off a point. ⚠ The dot marks the stored point, which is the town's centre and not the venue; what stops that reading as a doorstep is the panel, which shows only the town and offers no directions.

vague is the feature property and the three layer ids, matching MapPoint.vague. MapPoint.approximate stays the union of online-or-vague, which is what picks the softer selection sprite, and eventFrameZoom takes online — so no call reads two senses of one word.

Data side: sydevs/SahajCloud main now carries the rewrite (VENUE_FIELD_OVERRIDES in seeds/atlas/dedupe.ts), turning all six word-shaped placeholder streets ("Zentrum", "Innenstadt", "Centro", "Perth CBD", "None", "wird noch angekündigt") into the town's own name. It reaches production at the next Atlas sync, and until that runs the word list here is load-bearing: three live listings are caught by it alone. A lone "-" is deliberately not treated as a placeholder: its one listing is Parc Vaira'i, and its point really is the park.

Production listings this changes

Checked against all 442 production events:

Listing Why
Sneek, Silvianópolis, Ituiutaba the street repeats the town
Innsbruck, Salzburg, Krems "Innenstadt", "Zentrum", "wird noch angekündigt"
Broome, Beechboro, Perth, Araguari, Sevenoaks inactive (and town-only)
Every other inactive listing inactive

Punaauia (Parc Vaira'i) keeps its pin.

⚠ The dateless-class case above is not in that count — it was added after the production read, and no run since has had production data to re-count against. Every such class already read as inactive in the panel, so the change is confined to its map representation.

Checked

  • Lean gate passes: lint, typecheck, and 1997 unit tests, on the branch merged with current main.
  • Each new assertion was watched failing against its own defect before being kept — most recently the three-band handover (with the ring left unbounded above), the dot's fixed radius (with it interpolated like the ring's), and the dot's place in INTERACTIVE_LAYER_IDS.
  • Earlier rounds: the accent fold, and the dateless class — the last also with the predicate widened too far, so the ended-course case bites in both directions.

⚠ No browser pass has seen the current layers. The one in this PR's history ran at 1280×800 against production data, before the move off the unclustered area source and before the ring gained its upper bound: Sneek (1168), Broome (914) and Salzburg (804) drew an area with no pin and no Directions and named only the town, Balham Library (717) kept its pin and its street, and the console showed no layer or image errors. What a fresh pass would settle that the specs cannot: how the pin-to-ring and ring-to-dot handovers look while zooming, and whether a cluster bubble ever sits over a ring at the seam.

Notes for reviewer

Two of the second review's three findings are built here, one commit each, with the SHA in each thread. The third — a ## Summary naming four things the diff no longer had — is this body.

The word list is now the open question, and it is yours rather than this PR's. The first round's rebuttal rested on SahajCloud main carrying no street override; it does carry all six now, so 18 of the 24 entries guard no production row and the other six guard theirs only until the next Atlas sync. Dropping any of them before that sync drops a live listing, so nothing here is wrong today. A SahajCloud field, rather than a word list in this repo, is the durable fix — another repo's schema, larger than this change, and a decision the goal owns. Say so and it becomes its own ticket.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjVJXtttnitsB4QgSKS

Twelve in-person listings give only a town (bug #15 of the 6 Nov sweep),
so their stored point is the town's centre and the map pinned it as a
venue — Sneek's on a supermarket, with a Directions button to it.

`hasApproximatePlace` decides it: an inactive listing (it meets only on
request), or a street that names no place — a placeholder, the town's
own name, or a "city centre" word (`hasVagueAddress`). Such a listing
draws a 1.5km area instead of a pin, frames its neighbourhood, shows
only the town, and offers no directions. Inactive listings already hid
the street and directions on their page; the map now agrees.

A lone "-" is not a placeholder: its one listing is a park whose point
is the park. SahajCloud's Atlas importer rewrites the six word-shaped
placeholders to the town's own name (sydevs/SahajCloud
fix/atlas-town-only-venues), so after the final sync the word list is
only a fallback.

The area drawing ports 7fa03d1.

Co-authored-by: antontcymbal <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design f7ccbc7 Nov 10 2026, 04:58 PM

@Ardnived
Ardnived marked this pull request as ready for review November 7, 2026 22:26
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 7, 2026
@sydevs-bot

sydevs-bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 16:41Z address-review · attempt 1 · session · done
  • 16:41Z address-review · attempt 1 · session
  • 16:30Z review-pr · attempt 1 · session · done
  • 16:30Z review-pr · attempt 1 · session
  • 22:40Z address-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 7, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

It matches the bug it names, and widening to all inactive listings is argued, not smuggled. NO_PLACE_STREETS is 24 multilingual entries, yet the producer branch this PR names rewrites all six observed placeholders to the town's own name — which the town-repeat rule already catches — so the list guards no production row. And the area frames at a zoom inside the clustering range, so it misfires for exactly the listings this PR widened to.

Findings

  • should-fix — VAGUE_ZOOM 12 is under clusterMaxZoom 14, so a framed class can stay clustered: ring, no dot (use-map-controller-real.tsx:62).
  • should-fix — 24 word-list entries guarding zero rows once the producer lands (event.ts:35).
  • should-fix — the town-repeat test re-rolls streetAndCity's comparison, dropping accent folding (event.ts:83).
  • should-fix — the address shape is hand-written twice where EventAddress exists (event.ts:28).
  • should-fix — mapbox.md states the producer rewrite as shipped; it is unmerged (mapbox.md:102).
  • consider — CLASS_LAYER_IDS is INTERACTIVE_LAYER_IDS minus the cluster (layers.ts:50).
  • consider — inactive is read two ways; a dateless class still gets a pin (use-event-display.ts:245).

What was checked

  • Ladder: hasVagueAddress vs streetAndCity; areaAround vs approxBounds/@turf/circle; VAGUE_ZOOM vs EVENT_ZOOM 15 and clusterMaxZoom 14.
  • Read on the branch: event.ts, layers.ts, Map.tsx, both hooks, geo.ts, camera.ts, types/{event,geojson}.ts. FEED_SELECT sends street, city, inactive, schedule, so the map's predicate reads real values; terminalDisplay already drops directions.
  • Producer: SahajCloud main has no street override in seeds/atlas/dedupe.ts; fix/atlas-town-only-venues adds six. No ## Preview link, so none opened.
    🤖 Written by the sydevs autonomous loop — see what this is

Generated by Claude Code

Comment thread src/hooks/use-map-controller-real.tsx Resolved
Comment thread src/lib/shape/event.ts Resolved
Comment thread src/lib/shape/event.ts Resolved
Comment thread src/lib/shape/event.ts Resolved
Comment thread docs/rules/mapbox.md Resolved
Comment thread src/hooks/use-event-display.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 7, 2026
The dot stands in for the 1.5km circle once that shrinks to nothing on screen,
which is zoomed out — and zoomed out is exactly where the `events` source
clusters (`clusterMaxZoom` 14). Filtering it on `!has point_count` there meant it
only ever drew at the zooms the circle was already large at, so framing a vague
class in a dense city left a ring with a cluster bubble over its centre.

Move the dot to `approximate-areas`, which does not cluster, and carry each
class's centre point in that source beside its polygon. `fill` and `line` ignore
a point, and the dot filters on `geometry-type`, so one source serves all three.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
`hasVagueAddress` compared street against town with `toLowerCase` + `startsWith`
while `streetAndCity`, twenty lines below, compares them with `localeCompare` at
`sensitivity: 'base'`. So street "Silvianopolis" in "Silvianópolis" read as a
real place on the map while the address line already showed the town alone.

Fold the accents off both sides instead of switching to `localeCompare`: that
compares whole strings, and the placeholder match needs a position to slice the
town off. The word list is folded on the way in for the same reason.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
The street-and-city shape was written out by hand in three places here, while
`EventAddress` — generated from the feed schema, already imported in this file —
declares both fields nullish exactly as written.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
Both the rule and the `hasVagueAddress` docblock described SahajCloud's
placeholder-street rewrite in the present tense, but `VENUE_FIELD_OVERRIDES` on
its `main` sets no street — the change lives on an unmerged branch. Someone
opening either file today would look for a mechanism that is not there, and
would read the word list as already redundant when every entry still guards a
live listing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
`CLASS_LAYER_IDS` was `INTERACTIVE_LAYER_IDS` minus the cluster, and both call
sites already hold the cluster: the click handler tests it in the branch above,
so a bare `else` is the rest, and the hover tracker needs only "not the cluster".
A second array that must be edited whenever the first is is a sync hazard, and
`layers.test.ts` pins the surviving one as the contract with both handlers.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
`hasApproximatePlace` tested `inactive || !schedule`; the panel tested
`display.status === 'inactive'`, which `resolveEventDisplay` also returns for a
class whose occurrences have all passed. So such a class read town-only in the
panel — street and directions hidden — and still got a pin on the map, the
disagreement this feature set out to remove.

`hasApproximatePlace` now covers a dateless class too, through a shared
`eventKind`, so a course that is merely over keeps its pin and street. The panel
reads that one predicate rather than its own second copy.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS
@sydevs-bot

Copy link
Copy Markdown
Contributor

Six of the seven findings are built on claude/relay-374-f3bc887, one commit each, the SHA in each thread.

Adopted — the dot inside the clustering range (all three area layers now read the non-clustering source), accents, the address shape, docs claiming the producer had shipped, two id arrays, and two readings of inactive.

Rebutted — the word list: SahajCloud main sets no street override, so three live listings are caught by it alone.

Your call (body's notes): a SahajCloud field, not a word list here.

Lean gate green, 1982 tests, each new assertion watched failing first. The browser pass predates the layer change.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 7, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

I could not apply the relay here, so this is the step left for you.

  • apply the relay — GitHub said: claude/relay-374-f3bc887 is at 91099d8, not the requested f3bc887

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot enabled auto-merge November 9, 2026 23:47
Review feedback: rings showed at world zoom beside the cluster that also
counted them. Both the pin and the ring now read the clustering `events`
source, so a listing with no real place joins a cluster like any other,
and is an ordinary pin until the zoom where its ring's radius is as wide
as the pin (RING_ZOOM, about 9). From there it is a 3km ring, up from
1.5km, drawn to scale as a circle layer. The selection and hover
highlights hand over at the same zoom, and a framed vague listing lands
at zoom 11 so the larger ring fits.

The separate unclustered area source and `areaAround` are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived

Copy link
Copy Markdown
Contributor Author

@sydevs-bot review

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 10, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

Second pass, on request, over the two new commits. The pin-until-ring rework is the better answer: a listing now clusters like any other, which the unclustered area source could not. Two costs: the ring is unbounded above, so past about zoom 13 it stops reading as a place, and approximate now means two different things one file apart. SahajCloud's VENUE_FIELD_OVERRIDES is on main with all six street rewrites, so the word-list rebuttal rests on a changed premise: 18 of the 24 entries guard nothing, the other six only until the Atlas sync runs.

Findings

  • should-fix — the ring has no upper zoom bound: past ~13 it is a featureless wash with no marker (layers.ts:140).
  • should-fix — approximate is online-or-vague in the store and vague-only on the feature (store.ts:15).
  • should-fix — the ## Summary describes four things the diff no longer has: the approximate-areas source, a 1.5 km area where APPROXIMATE_RADIUS_KM is 3, a dot at every zoom, and an unlanded producer that mapbox.md now says has landed.

What was checked

  • Ladder: the ring vs @turf/circle/approxBounds (geo.ts:49) — own code earned: a polygon cannot cluster, and geolocation.ts:90 notes turf circles mishandle the antimeridian. ringRadiusPx/ringZoom reuse worldMinZoom's constant; eventKind folds resolveEventDisplay's own literal.
  • Arithmetic: RING_ZOOM 9.06, handing over with no gap; below clusterMaxZoom 14 a clustered listing shows the bubble.
  • Read on the branch: event.ts, layers.ts, Map.tsx, camera.ts, markers.ts, store.ts, types/{event,geojson}.ts. AgnosticFeedEventSchema carries address, inactive and schedule, so the predicate reads real values.
  • Producer: dedupe.ts:114-119 on SahajCloud main sets all six overrides. No ## Preview link, so none opened.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/config/store.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 10, 2026
# Conflicts:
#	CHANGELOG.md
#	src/hooks/use-event-display.ts
The ring's radius doubles per zoom level with nothing stopping it: 111px at
zoom 11, 444px at 13, 888px at 14. Past about zoom 11.7 its outline is off
every screen, so an unselected listing was a flat 14% tint with no marker in
it — where `main` gave it a pin — and that tint answered every click and
hover across the map, with neighbours stacking theirs.

`RING_MAX_ZOOM` is where the ring is as wide as the narrowest map the full
interface renders in, so the three layers hand over at one zoom each and
exactly one of them draws at any zoom. The dot is a fixed size, in the ring's
own colours at a fraction of its weight, and is clickable like the pin and
the ring before it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVJXtttnitsB4QgSKS
`approximate` named two different things. On `MapPoint` it is online-or-vague,
picking the softer selection sprite. On the map's own feature property it was
`hasApproximatePlace`, which excludes online — and `eventFrameZoom`'s option of
that name meant online alone, so one call read `online: isOnline(event)` beside
`point.approximate` and the reader had to tell three senses apart.

The feature property, the three layers and their ids now say `vague`, matching
`MapPoint.vague`, which already meant exactly this. `eventFrameZoom` takes
`online`, agreeing with the `onlineZoom` beside it. `MapPoint.approximate` keeps
its name as the union, and its comment now says so.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVJXtttnitsB4QgSKS
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both open threads built. The review body's third point is answered in the PR body.

⚠ Round one's word-list rebuttal rested on a changed premise: SahajCloud main now sets all six street overrides.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 10, 2026
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 10, 2026
@Ardnived
Ardnived disabled auto-merge November 10, 2026 17:19
@Ardnived
Ardnived merged commit 2fb5d51 into main Nov 10, 2026
11 checks passed
@Ardnived
Ardnived deleted the fix/approximate-places branch November 10, 2026 17:19
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 10, 2026
antontcymbal added a commit that referenced this pull request Nov 10, 2026
Brings in #374 (a listing with no real place draws pin, then ring, then
dot) and the #381/#382 contract re-syncs.

- lib/shape/event.ts: main's hasVagueAddress, eventKind and hasApproximatePlace; drop our older hasVagueAddress and directionsTarget; keep our streetAndCity, now reusing main's module-level fold.
- lib/shape/event.test.ts: main's hasVagueAddress and hasApproximatePlace specs; drop ours and the directionsTarget spec; keep our streetAndCity spec.
- Mapbox/layers.ts: main's vaguePin/vagueRing/vagueDot, VAGUE_RADIUS_KM, RING_ZOOM, RING_MAX_ZOOM and one INTERACTIVE_LAYER_IDS; drop approximateDot/Fill/Outline and CLASS_LAYER_IDS; keep CLUSTER_MAX_ZOOM.
- Mapbox/layers.test.ts: main's id contract and vague-layer specs; keep our stock-count contrast spec.
- Mapbox/Map.tsx: main's vague feature property, cosLat, layers and hover test; drop the approximate-areas source and areaAround; keep the pin popover with class name, useMapTap, the unsplittable cluster opening its list.
- Map.tsx click handler: main's bare else for a class feature, with our useMapTap open() kept inside it.
- hooks/use-map-controller-real.tsx: main's eventPoint (vague, approximate as the union), VAGUE_ZOOM 11 and eventFrameZoom online; keep sheetInset and the world-once WORLD_CENTER.
- hooks/use-event-display.ts: main's townOnly predicate; our postcode line now hides under townOnly too, as the room does (was status inactive).
- lib/camera.test.ts: keep both our sheetInset spec and main's ring spec.
- lib/geo.ts: main's version, so areaAround is gone (nothing else used it).
- EventActions: plain Directions again (5cff0b9 reverted); drop event.actions.directions_to; test and story now assert no Directions for a vague listing.
- docs/rules/mapbox.md: main's "Classes with no real place" section.
- Contract files (payload-types.ts): main's, unchanged by us; typecheck clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants