feat(atlas): viewport scene-card previews + card redesign#216
Merged
Conversation
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
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.
Viewport scene-card previews + card redesign
Implements the agreed atlas-preview concept:
FloatingZoompill also sits in the atlas (bottom-left).win.zoom-in/out/resetroute to the global card-preview zoom while the atlas is visible, to the engine camera elsewhere.editorData.preview {tileX,tileY}to disk + as a__project/map.editor-dataop (same flow as atlas positions).Rendering
MapPreviewgains 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.