mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #2329] viewer: follow a camera link opened in the open page (VIEWER-FOLLOW-CAM-LINK) #2331
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#2331
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/2329
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:feat/viewer-follow-cam-link📝 Commits (1)
0370dc2viewer: follow a camera link opened in the open page (VIEWER-FOLLOW-CAM-LINK)📊 Changes
2 files changed (+56 additions, -2 deletions)
View changed files
📝
tests/test_viewer_streaming.cjs(+48 -0)📝
viewer/index.html(+8 -2)📄 Description
Claimed in the coordination issue as: VIEWER-FOLLOW-CAM-LINK
What and why
Pcopies a link to the current view (#cam=x,y,z,yaw,pitch), and the viewer reads that hash once, at startup. Opening such a link in a tab that already shows the viewer changes only the hash: the browser makes a same-document navigation, the page does not reload, and the camera stayed where it was. The same happened with Back and Forward between two links. A shared view therefore only worked in a fresh tab. The VIEWER-HUNT finding in #1608 noted this as an untested edge.The viewer now applies the hash again on
hashchange, through the same helper that applies it at startup. A hash that is not a camera link (empty, malformed, another fragment) leaves the camera where it is, as at startup.Puseshistory.replaceState, which fires nohashchange, so copying a link does not move the camera.Tested
node --test tests/test_viewer_streaming.cjs(Node 26): a new test runs the whole viewer module with a link in the hash, checks that it places the camera, then fireshashchangewith a second link (camera and look follow, pitch clamped as at startup) and with five hashes that are not camera links (nothing moves). Onmainthe new test fails (nohashchangehandler); with the change all 58 tests pass.viewer/serve.py(test terrain): setting the hash to a second link moves the HUD position there,#notacamleaves it, and Back twice returns to each earlier link.viewer/index.htmland this test file.scripts/check_no_game_data.pyon both files.GPUs tested: n/a (viewer logic, Node harness)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.