viewer: an overview map of the world's chunks, with click to fly there (VIEWER-OVERVIEW-MAP) #2338
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2338"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by syfyra on 2026-11-26T14:05:34Z.
Claimed in the coordination issue as: VIEWER-OVERVIEW-MAP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193940963)
Depends on: none. It merges cleanly with the open pull requests on the viewer page and its tests (#93, #651, #918, #2243), and the viewer's Node tests pass on each of those four merges.
What and why
The map viewer loads only what is near the camera (1,400 m, or one band per LOD tier), and nothing in it shows where the rest of a world is. A placed world is kilometres across,
Gdraws the chunk boxes in 3D, which helps only for what is in view, and a chunk that fails to load is a count in the HUD with no way to tell which chunk it was.Mopens a map of the whole world from above, drawn fromworld.jsonalone:cellwhen it names a tier, otherwise the X/Z extent of itsbounds), coloured by its streaming state: not loaded, loading, loaded, or failed (its three attempts are used up). +x is right and +z is down, so a placed world has north (RAGE +Y) at the top.world_build.py --regiontakes), and the chunk there with its state. That is how a chunk that fails to load is found by id.Opening the map releases a locked mouse, since the map is used with the cursor.
#mapsits above the "Click to fly" layer, so a click on the map reaches the map and a click beside it locks the mouse again; the map stays open while flying.Nothing touches the page until the map is first opened, so the existing tests that run the whole module with a
getElementByIdthat returns{}are unchanged. An open map is redrawn at most every 100 ms. Chunk ids come fromworld.jsonand are written withtextContent.docs/world.mdgets a section on the map.Tested
Windows 11, Node 26.12.1, Python 3.14.7:
node --test tests/test_*.cjs: 89 pass, 20 of them new intests/test_viewer_map.cjs. The new file runs the map's code from the page together with the streaming section, so the chunk states it checks come from realstream()calls (a load, a pending request, one failure, three failures). It covers the fit and the gap between cells, high-DPI canvases, the four colours and the legend, the arrow, the radius and the spawn ring, the scale bar, north and the RAGE coordinates, the info line (also for a cursor that rests while a chunk loads), LOD cells, the click and its height rule, the zoom and its limits, the redraw interval, an empty world and a collapsed panel.main, where the page has no map section.stopPropagation, a swapped axis, a dropped tier check,innerHTMLfortextContent, and so on) each make at least one of the new tests fail.python -I viewer/serve.py: the test terrain (576 chunks), and a syntheticworld.jsonwith LOD sets,"layout": "placements"and no chunk files, where the cells turn from loading to failed. Opened, hovered, clicked to fly, zoomed with the wheel (the speed in the HUD stayed at 40 m/s) and closed, at 1024x768 and in a 700x560 window.python -Ion everytests/test_docs_*.py,tests/test_i18n_index.py,tests/test_viewer_cdn_integrity.py,tests/test_text_write_line_endings.pyandtests/test_ci_registration.py;python -I scripts/check_no_game_data.pyon the three changed files.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator rule in this change.)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T15:40:32Z.
Review: COMMENTED
Windows 11/Node: all 77 map and streaming tests passed, including bounds, pointer mapping and fly-to controls in the test harness. No findings from those checks.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:51:03Z.
Review: COMMENTED
Draft review note:
VIEWER-OVERVIEW-MAP(viewer/index.html,tests/test_viewer_map.cjs,docs/world.md) is cleanly scoped, mergeable onmain, and passed independent Node map/streaming testing, but remains a draft with no CI run. Please run CI to green and mark ready for review when ready.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:29:28Z.
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:05:45Z.
Review: APPROVED
Now ready for review and
MERGEABLE. Clean-room verified: the chunk overview map with click-to-fly inviewer/index.html,docs/world.mdupdate, andtests/test_viewer_map.cjsare clean and verified (77/77 viewer tests by@lixonik).Approving — ready to merge once CI runs green on current
main.(AI-assisted review.)