The map page was missing half its host contract (#153) - #154
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #153.
MAP_ICONS is not definedThe 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,mapIconForandmapIconSvgare supplied by the panel and by the public site, and by nothing on this page. With structures switched on,mapDrawthrew 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 asvoid refresh(). Anything that threw earlier left the list empty and reported nothing.Four independent loads via
allSettled, and a failure is surfaced rather than swallowed.Verification
12/12 gates. Removing
MAP_ICONSagain fails withthe map page never defines MAP_ICONS.The generator was also checked directly rather than through a running app — rendering
getMapPageHtmlin isolation confirms the theme reaches the CSS (--accent:#22c55efrom a supplied theme),MAP_ICONSis defined, and the stack offsets are present.