Skip to content

feat(atlas): viewport scene-card previews + card redesign#216

Merged
JumpLink merged 2 commits into
mainfrom
feat/atlas-viewport-previews
Jun 12, 2026
Merged

feat(atlas): viewport scene-card previews + card redesign#216
JumpLink merged 2 commits into
mainfrom
feat/atlas-viewport-previews

Conversation

@JumpLink

@JumpLink JumpLink commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Viewport scene-card previews + card redesign

Implements the agreed atlas-preview concept:

  • Uniform pixel zoom, cropped section: cards render their map at a global native-pixel zoom (default 200%) cropped to the card instead of squeezing the whole map in — every preview shares one resolution and content is actually recognizable. Card size stays map-proportional.
  • Global zoom control: the scene editor's FloatingZoom pill also sits in the atlas (bottom-left). win.zoom-in/out/reset route to the global card-preview zoom while the atlas is visible, to the engine camera elsewhere.
  • Per-card viewport lock (top-right, on hover/selection): closed (default) = dragging moves the card on the atlas; open = dragging pans the map section inside the preview. Pan ends persist editorData.preview {tileX,tileY} to disk + as a __project/map.editor-data op (same flow as atlas positions).
  • Background pan: dragging the empty atlas backdrop scrolls the atlas (denies itself over cards).
  • Card redesign: free-floating title row (name + dimensions, no header bar), subtle frame, events badge bottom-right.

Rendering

MapPreview gains a viewport mode: region bakes at the zoom factor through the existing bake queue, whole-map-pixel bake origin (fractional origins caused NEAREST clip-edge seams), stale-texture shifting while a pan's re-bake is pending, ops built per bake from retained source data (no persistent six-figure op arrays).

Verification

Visual: atlas shows crisp 2× sections with correct room colours, zoom pill reads 200%, no seams (window screenshot). Checks + 748 engine tests green; biome clean. Pointer gestures (lock toggle, pan, background scroll) need a quick manual pass — they can't be driven over the MCP bridge yet.

JumpLink added 2 commits June 12, 2026 18:43
Cards now show every map at a uniform native-pixel zoom (300% by
default) cropped to an adjustable section, instead of squeezing the
whole map into the card — all previews share one resolution and the
content is actually recognizable. Card size stays map-proportional.

- MapPreview: viewport mode (region bakes at zoom, whole-pixel
  origin against clip-edge seams, stale-texture shift while a pan's
  re-bake is queued); ops built per bake from retained source data
- SceneCard: free-floating title row (no header bar), subtle frame,
  corner drag handle; content drag pans the viewport, the handle
  moves the card, sample worlds keep drag-to-move
- AtlasCanvas: background drag pans the scrolled atlas (denies
  itself over cards), preview-moved signal, surface sizing accounts
  for real-project cards
- maker: editorData.preview {tileX,tileY,zoom} persisted on pan end
  (disk + __project/map.editor-data op, mirrors atlas positions)
Review feedback on the viewport previews:

- default preview zoom 300% -> 200%
- the scene editor's FloatingZoom pill now also sits in the atlas
  (bottom-left); win.zoom-in/out/reset route to the global card
  zoom while the atlas is visible, to the engine camera elsewhere
- panning is opt-in per card via a lock toggle (top-right, shown on
  hover/selection): closed (default) = drag moves the card on the
  atlas, open = drag pans the map section; replaces the drag handle
  and the always-pannable behaviour
- per-map editorData.preview.zoom dropped — zoom is atlas-global
@JumpLink JumpLink merged commit 50c04ba into main Jun 12, 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.

1 participant