Skip to content

feat: add URL deep linking with full view state sharing#804

Open
remo-lab wants to merge 1 commit intoHSF:mainfrom
remo-lab:feat/url-deep-linking-view-state
Open

feat: add URL deep linking with full view state sharing#804
remo-lab wants to merge 1 commit intoHSF:mainfrom
remo-lab:feat/url-deep-linking-view-state

Conversation

@remo-lab
Copy link
Contributor

Description

This PR adds support for sharing the full current view state of the event display through a URL parameter.
Users can now generate a link that restores the exact camera position, camera target, geometry visibility toggles, and clipping angles they are currently viewing.
A new state URL parameter stores the scene state as compressed JSON. When the link is opened, the view is restored automatically.
To keep URLs manageable, the state is compressed using the browser-native CompressionStream (deflate) before encoding. In testing, a ~46KB state compresses to roughly ~8KB.

Changes

  • state-manager.ts: Added getStateAsJSON() and camera target save/restore support
  • three-manager/index.ts: Exposed getControlsManager() for camera target access
  • url-options-manager.ts: Added support for ?state= parameter and implemented decompression logic
  • atlas.component.ts: Skip default config initialization when ?state= is present to avoid overwriting restored state
  • share-link-dialog.component.ts/html: Added "Include current view state" checkbox and compression handling

Test Plan

  • Open ATLAS experiment
  • Adjust camera position and toggle geometry visibility
  • Open Share Link dialog and enable "Include current view state"
  • Copy the generated URL and open it in a new tab
  • Verify the camera position, camera target, visibility toggles, and clipping angles are restored
  • Verify normal share link behavior remains unchanged when the checkbox is not selected
  • Verify existing ?config= and ?file=&type= parameters still work as expected
Recording.2026-02-23.140101.1.1.mp4

@remo-lab
Copy link
Contributor Author

@EdwardMoyse, Please let me know your thoughts on this!

Signed-off-by: remo-lab <remopanda7@gmail.com>
@remo-lab remo-lab force-pushed the feat/url-deep-linking-view-state branch from e20d91d to 4124325 Compare February 23, 2026 09:49
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