You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One map in all three places, with heads and the world on (#129)
* One map in all three places, with heads and the world on
The desktop app, the web panel and the public site showed three different maps,
because the desktop one was a second implementation. The panel and the site
share `MAP_JS`; the desktop had its own React canvas written for #26 and never
gained what #104 and #119 added — so it had no pan, no zoom, no coordinate
readout, no heads, no world and no reset, while offering a heatmap the others
did not surface the same way.
The desktop now uses the same view transform from `@shared/livemap` — the same
`fitView`, `panBy`, `zoomAt` and `screenToWorld` — and the same controls: drag
to pan, wheel to zoom anchored on the cursor, the world under the markers, skin
heads, the coordinate readout, reset view, and the heatmap it already had.
**The tile queue moved into `core/worldTiles`.** All three surfaces now share
one queue and one parse budget rather than the web owning it and the desktop
having none: three callers each parsing regions on their own would be three
times the work on the same main thread, and three maps that disagree about what
has loaded. The desktop reaches it over a new `map:tiles` IPC, capped the same
way the HTTP route is — the renderer is trusted, but a bug there should not be
able to queue a whole world either.
**Heads and the world default to on.** They are what make this a map of people
and terrain rather than dots on a grid, and an operator should not have to find
two toggles to get the obvious thing. The public site is unchanged in substance:
its feed still refuses heads unless the operator agreed to send names to an
avatar service, and publishing the terrain is still its own decision, off by
default.
A head is decoration, so `mapHead` now returns the dot rather than throwing when
the environment has no `Image` at all — a missing avatar must not take the grid,
the markers and the terrain down with it.
* Self-review: bound the tile cache, and a cursor that never changed
The desktop held every chunk it had ever looked at. Each tile is small and
"small times unbounded" is still unbounded, in a process that runs for as long
as the app is open — panning a big world would grow it without limit. Tiles
outside the view are dropped past 2048, which costs a re-fetch the main process
already has cached.
The grab/grabbing cursor was bound to a React ref. A ref does not re-render, so
the style never updated and the canvas showed `grab` while dragging. It comes
from `:active` in CSS now, which is what the web map already does.
And `headFor` marked a name as failed AFTER starting the load rather than
before, so a handler that resolved first would have been overwritten by the
mark. Browsers never fire `onload` synchronously, so this was a latent ordering
bug rather than a live one — but it is the kind that only shows up under a
cache hit on somebody else's machine.
0 commit comments