Skip to content

Fix skybox console errors, add Puppeteer animation skills + Matterhorn demo, fix screenshot self-navigation - #3

Merged
isConic merged 5 commits into
ESIPFed:mainfrom
emirkaan5:main
Aug 6, 2026
Merged

Fix skybox console errors, add Puppeteer animation skills + Matterhorn demo, fix screenshot self-navigation#3
isConic merged 5 commits into
ESIPFed:mainfrom
emirkaan5:main

Conversation

@emirkaan5

Copy link
Copy Markdown
Contributor
  • Fix skybox console errors on the web map.
  • Puppeteer animation skills (reference examples) + a Matterhorn demo GIF in the README header.
  • Headless-screenshot loopback fix so screenshots work when MAPCONTROL_PUBLIC_URL isn't reachable from inside the container — and revert of an image-default port change that would have broken existing deployments.

emirkaan5 and others added 5 commits August 5, 2026 11:39
Reference-only skills showing how to drive the web map with Puppeteer for
different animation scenarios: ballistic flyTo tours, 3D terrain orbit
(Matterhorn), keyframe screenshots, and frame-sequence recording. Each
scenario ships a SKILL.md recipe plus a runnable animate.mjs, over a shared
lib/esip-map.mjs helper that targets the page's published MapLibre instance.

Wired links into the README (docs table + Demos section). Terrain examples
use map.setSky(), reinforcing the correct MapLibre API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…vigation

Reverts the image's default-port change (8000→8080) so existing deployments
that reference 8000 in Compose, proxies, MAPCONTROL_PUBLIC_URL, or SDK calls
keep working. A host-side port conflict is handled the normal Docker way —
remap the host port and leave the container port unchanged ("8080:8000").

Screenshot self-navigation fix: take_screenshot built the URL Chromium opens
from _public_base_url() (MAPCONTROL_PUBLIC_URL). When that is an external
address or reverse-proxy origin, it does not resolve back to this process from
inside the container, so every screenshot failed. Chromium now self-navigates
via the new _internal_base_url() — loopback on the server's bound port — while
_public_base_url() stays in use for URLs returned to external clients. Applied
at both call sites: the MCP take_screenshot tool (mcp_tools.py) and the
Playwright fallback (main.py).

The bound port and config must agree for loopback to work: the working-dir
config.toml carries a dev port (7777) while the image binds 8000, so the
Dockerfile now sets ENV MAPCONTROL_PORT=8000 (config.py already lets that
override config.toml) — making load_config().server.port == the bound port in
the container without changing the image default.

Also:
- regression test (server/tests/test_screenshot_loopback.py): with an
  unreachable MAPCONTROL_PUBLIC_URL and the container's port split, asserts
  take_screenshot self-navigates to loopback:8000, not the public host or the
  config.toml dev port.
- keep the .gitignore *.log entry.
- README: note the "8080:8000" host-remap for when host port 8000 is occupied.
- puppeteer-skills docs: sync example URLs back to :8000.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@emirkaan5
emirkaan5 requested a review from isConic August 5, 2026 21:49
@emirkaan5 emirkaan5 self-assigned this Aug 5, 2026

@isConic isConic 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.

Excellent resubmit — this is exactly what was asked for, plus a catch I didn't spec. Approving.

What I verified:

  • setSky fix — intact and unchanged from the original PR: enableSky()/disableSky() replacing the four Mapbox-style addLayer({type:'sky'}) blocks. Correct MapLibre 5+ API, nice dedup.
  • Port sweep dropped — net diff is clean; the image contract stays on 8000. The README troubleshooting note (host-side 8080:8000 remap) is the right way to serve Mac users with a port clash.
  • Loopback self-navigation fix_internal_base_url() in mcp_tools.py, used by both call sites (the MCP take_screenshot tool and the Playwright fallback in main.py). Public URLs stay public, self-navigation stays loopback. This is the root-cause fix.
  • Bonus catch: ENV MAPCONTROL_PORT=8000 in the Dockerfile — good spot. Without it, load_config().server.port would read the working-dir config.toml dev port (7777) and the loopback URL would target the wrong port inside the container. The keep-in-sync comment next to CMD is appreciated.
  • Regression testtest_screenshot_loopback.py pins the invariant hard: unreachable public URL, asserts nav URL is 127.0.0.1:<bound port>, and explicitly checks that neither the public host nor the 7777 dev port leaks. Runnable standalone and via pytest, matching the other gates.
  • Puppeteer skills + Matterhorn GIF — additive reference docs, no runtime impact. Nice showcase for the README header.
  • CI on the head commit is green (build-test-push success).

Two follow-ups (non-blocking, happy to take either as a separate PR):

  1. Wire test_screenshot_loopback.py into publish-image.yml as a gate alongside test_mcp/test_mcp_auth/test_portal, so the invariant is enforced on every push.
  2. main.py importing the underscore-private _internal_base_url from mcp_tools works but reads as private-API reach-in — consider promoting it to a public name later.

Squash-merging to collapse the port-change/revert pair in the branch history into one clean commit. Thanks Emir — two real bug fixes and a demo upgrade in one PR. 🏔️

@isConic
isConic merged commit 2e1bb00 into ESIPFed:main Aug 6, 2026
1 check passed
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.

2 participants