feat: Adds copy view URL button to bypass browser URL truncation #868
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.
Summary
Adds a "Copy view URL to clipboard" button to the top bar that copies the complete URL including the full state fragment, bypassing browser truncation issues.
Problem
When neuroglancer state URLs become very long, browsers truncate them in the address bar. Copying the URL directly from the address bar results in an incomplete URL that cannot restore the full state when pasted into another browser
Solution
Changes
src/widget/copy_button.ts: AddedmakeCopyUrlButton()function that uses the clipboard iconsrc/ui/url_hash_binding.ts: AddedencodeStateAsFragment()helper function and refactored existing code to use itsrc/viewer.ts: Added the copy URL button to the top bar