mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #2338] viewer: an overview map of the world's chunks, with click to fly there (VIEWER-OVERVIEW-MAP) #2342
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2342
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2338
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:feat/viewer-overview-map📝 Commits (1)
ad1c662viewer: an overview map of the world's chunks, with click to fly there (VIEWER-OVERVIEW-MAP)📊 Changes
3 files changed (+609 additions, -0 deletions)
View changed files
📝
docs/world.md(+22 -0)➕
tests/test_viewer_map.cjs(+409 -0)📝
viewer/index.html(+178 -0)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.