Skip to content

The map page was missing half its host contract (#153) - #154

Merged
CaYatur merged 1 commit into
mainfrom
fix/map-page-host-contract
Jul 29, 2026
Merged

The map page was missing half its host contract (#153)#154
CaYatur merged 1 commit into
mainfrom
fix/map-page-host-contract

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Closes #153.

MAP_ICONS is not defined

The map page is the fourth host of the shared map engine and was given only part of what that engine asks for. STRUCTURE_ICONS, MAP_ICONS, mapIconFor and mapIconSvg are supplied by the panel and by the public site, and by nothing on this page. With structures switched on, mapDraw threw and took the rest of the draw with it — the map stopped updating entirely, on the page whose only purpose is the map.

It shipped because the smoke never ran this page's script. It ran the panel's and the site's. It runs all three now, with every layer on — the defect only appeared with structures enabled, so a page tested at its defaults would still have passed. The test names each thing the contract requires, then draws.

Bottom-left is a stack, not a pile

The legend, the structure key and the mouse coordinates were all pinned to the same corner and drew over each other — which is why the coordinates were unreadable. Each now sits above the one below it, at offsets measured from their real heights, because every one of them wraps at some width. Re-measured after each draw, since the structure key comes and goes with its toggle.

The page takes the site's colours

An operator who picked an accent for their website was getting a map page in a different red. It now reads site.theme, with the same defaults the site falls back to.

API keys list again

refresh() in the desktop panel was one sequential chain with the keys awaited last, called everywhere as void refresh(). Anything that threw earlier left the list empty and reported nothing.

"I created a key and it is not listed" was not a problem with keys. It was a problem with being fourth in a queue that could stop.

Four independent loads via allSettled, and a failure is surfaced rather than swallowed.

Verification

12/12 gates. Removing MAP_ICONS again fails with the map page never defines MAP_ICONS.

The generator was also checked directly rather than through a running app — rendering getMapPageHtml in isolation confirms the theme reaches the CSS (--accent:#22c55e from a supplied theme), MAP_ICONS is defined, and the stack offsets are present.

    ReferenceError: MAP_ICONS is not defined
        at mapDraw

The map page is the FOURTH host of the shared map engine and was given
only part of what that engine asks for. `STRUCTURE_ICONS`, `MAP_ICONS`,
`mapIconFor` and `mapIconSvg` are all supplied by the panel and by the
public site, and by nothing on this page. With structures switched on,
`mapDraw` threw and took the rest of the draw down with it — so the map
stopped updating entirely, on the page whose only purpose is the map.

It shipped because the smoke ran the panel's script and the site's and
never this one. It does now, with every layer ON — the defect only
appeared with structures enabled, so a page tested at its defaults would
still have passed. Removing `MAP_ICONS` again fails with "the map page
never defines MAP_ICONS", and the test then draws, which is what threw.

Bottom-left is a STACK now, not three things at the same coordinates.
The legend, the structure key and the mouse coordinates were all pinned
to the corner and drew over each other, which is why the coordinates
were unreadable. Each sits above the one below it, at offsets measured
from their real heights — every one of them wraps at some width, so a
constant is wrong somewhere. Re-measured after each draw, because the
structure key comes and goes with its toggle.

The page also takes the operator's own website colours instead of a
hardcoded palette. Somebody who chose their site's accent was getting a
map page in a different red, which reads as a different product.

And the desktop panel lists API keys again. `refresh()` was one
sequential chain with the keys awaited LAST, called everywhere as
`void refresh()` — so anything that threw earlier left the list empty
and said nothing. "I created a key and it is not listed" was not a
problem with keys; it was a problem with being fourth in a queue that
could stop. Four independent loads, `allSettled`, and a failure is
reported rather than swallowed.

Verified: 12/12 gates, and the generator checked directly rather than
through a running app — rendering `getMapPageHtml` in isolation confirms
the theme reaches the CSS, `MAP_ICONS` is defined, and the stack offsets
are there.
Copilot AI review requested due to automatic review settings July 29, 2026 19:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CaYatur
CaYatur merged commit b85d1fe into main Jul 29, 2026
1 check passed
@CaYatur
CaYatur deleted the fix/map-page-host-contract branch July 29, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map page: MAP_ICONS is not defined, chrome does not match the site, and API keys never list

2 participants