Skip to content

TKW: seed map view, fullscreen, King's Landing marker, editMode overlay#40

Merged
codebend3r merged 5 commits into
mainfrom
updating-map
Jul 12, 2026
Merged

TKW: seed map view, fullscreen, King's Landing marker, editMode overlay#40
codebend3r merged 5 commits into
mainfrom
updating-map

Conversation

@codebend3r

Copy link
Copy Markdown
Owner

Summary

  • Seed /maps with a fixed initial view, add a fullscreen toggle, and mark King's Landing as a clickable map marker
  • Add an editMode debug overlay (zoom/x/y) behind a query param
  • Drop the "Coming soon" pill from the Maps tile now that /maps is real
  • Swap map art to the-known-world-enhanced.jpg; remove unused style variants

Map view

  • WorldMap opens on a fixed Dorne-area view (zoom 5, X -1495, Y -1940) instead of fit-to-viewer
  • fullscreen toggle button; transform recomputed on every resize so the same map point stays centered at the same effective zoom
  • Viewer.setValue() sets viewerWidth/viewerHeight explicitly — Viewer.getValue() can race the library's internal size sync
  • resize trigger moved from ResizeObserver to a direct re-measure on fullscreenchange (observer doesn't reliably re-fire across fullscreen transitions)
  • Reset view gets a distinct crosshair icon to differentiate from the fullscreen icon

King's Landing marker

  • transparent clickable marker (Link + circle, natural-pixel coordinates) linking to /castles/kings-landing/; gold-leaf ring on hover/focus
  • new content/castles/kings-landing.md (AWOIAF-sourced) so the route resolves

Edit mode

  • WorldMap reads editMode via useQueryState (nuqs); ?editMode=true shows a parchment-styled zoom/x/y overlay
  • polls Viewer.getValue() on requestAnimationFrameUncontrolledReactSVGPanZoom swallows a consumer onChangeValue prop
  • new WorldMapSkeleton; /maps wraps WorldMap in Suspense (required for useQueryState under output: "export")

Cleanup

  • MainMenuTile drops the now-unused status prop and pill markup/styles
  • delete unexplored map art variants (ink, night, parchment, watercolor) — ~110MB, nothing references them
  • CLAUDE.md: commits only on explicit request; never commit directly to main

Tests

  • WorldMap.test.tsx extended with fake requestAnimationFrame, nuqs testing adapter, fullscreen/resize coverage
  • MainMenu/MainMenuTile tests updated for pill removal

- `WorldMap` reads `editMode` via `useQueryState` (`nuqs`), `?editMode=true` shows the overlay
- polls `Viewer.getValue()` on `requestAnimationFrame` while `editMode` is on — `UncontrolledReactSVGPanZoom` swallows a consumer `onChangeValue` prop instead of forwarding it, so that callback never fires
- overlay is a parchment-styled `dl` pinned to the top-left of `.stage`, `aria-hidden`
- new `WorldMapSkeleton`, `/maps` wraps `WorldMap` in `Suspense` — required for `useQueryState` under `output: "export"`
- extends `WorldMap.test.tsx` with a fake `requestAnimationFrame` and `nuqs` testing adapter
- workflow: commits happen only when explicitly requested, not automatically after each change
- workflow: never commit directly to `main`; branches still required per feature/fix, but only created when asked
- `/maps` is a full interactive map now, not a stub — `MainMenu` stops passing `status="coming-soon"`
- `MainMenuTile` drops the now-unused `status` prop and pill markup/styles
- tests updated to match
- `WorldMap` opens on a fixed Dorne-area view (zoom 5, X -1495, Y -1940) instead of fit-to-viewer
- new fullscreen toggle button; recomputes the pan/zoom transform on every resize (not just fullscreen) so the same map point stays centered at the same effective zoom
- the underlying `<image>` re-centers itself on resize but the transform didn't follow — `Viewer.setValue()` now sets `viewerWidth`/`viewerHeight` explicitly since `Viewer.getValue()` can race the library's own internal size sync
- switched the resize trigger from `ResizeObserver` (doesn't reliably re-fire across a fullscreen transition) to a direct re-measure on `fullscreenchange`
- `Reset view` gets a distinct crosshair icon — it was visually identical to the new fullscreen icon
- King's Landing gets a transparent clickable marker (`Link` + `circle`, positioned by natural-pixel coordinates read off the source map) linking to `/castles/kings-landing/`; hover/focus shows a gold-leaf ring
- new `content/castles/kings-landing.md` (AWOIAF-sourced) so that route resolves
- swap map art to `the-known-world-enhanced.jpg` (labeled); add the other art-style variants explored alongside it
- delete `the-known-world-ink.jpg`, `-night.jpg`, `-parchment.jpg`, `-watercolor.jpg` from `public/map/`
- no code references; drops ~110MB of unused assets
@netlify

netlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

Deploy Preview for theknownworld ready!

Name Link
🔨 Latest commit a3a8033
🔍 Latest deploy log https://app.netlify.com/projects/theknownworld/deploys/6a539d505e53d3000afc45eb
😎 Deploy Preview https://deploy-preview-40--theknownworld.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codebend3r
codebend3r merged commit 2c3ce3d into main Jul 12, 2026
5 checks passed
@codebend3r
codebend3r deleted the updating-map branch July 12, 2026 22:36
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.

1 participant