feat: Neuroglancer base url preference when deployment overrides default#412
Open
allison-truhlar wants to merge 6 commits into
Open
feat: Neuroglancer base url preference when deployment overrides default#412allison-truhlar wants to merge 6 commits into
allison-truhlar wants to merge 6 commits into
Conversation
Introduce a per-user viewerUrlSources preference (configured/manifest/custom,
keyed by viewer) and a resolveViewerTemplate helper that maps a viewer plus the
chosen source to an effective URL template. Expose the manifest-default template
on ValidViewer so the manifest ('external') option has a URL to resolve to, and
persist the new preference through the existing preference API.
No consumers yet; wired up in subsequent commits.
Add a radio group under a new 'Neuroglancer' preferences section letting users switch their Neuroglancer links between the deployment-configured URL and the manifest default (external appspot). The control only appears when the deployment actually overrides the URL. Includes the accompanying layout adjustments to give Neuroglancer options their own section.
Resolve the effective Neuroglancer template via resolveViewerTemplate when building the 'Open with' tool links, so OME-Zarr, Zarr, and N5 datasets all honor the user's chosen URL source instead of the deployment default.
Default the 'Create Neuroglancer Short Link' dialog's base URL and placeholders to the preference-resolved URL rather than a hardcoded appspot value, keeping the create-mode default in sync as viewers load. Existing links keep their stored base URL.
Move the default Neuroglancer base URL resolution out of NGLinkDialog into a useDefaultNeuroglancerBaseUrl hook used by the NGLinks container, which passes the result down as a prop. Keeps the dialog a pure presentational component (no direct context access), so it renders without the viewers/preferences provider tree and its unit tests pass without extra wrappers. No behavior change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a preference to the preference page that allows the user to select one of two options for the Neuroglancer deployment - either the new override at fileglancer.int.janelia.org or the capability-manifest default at neuroglancer-demo.appspot.com. The preference is only shown if the capability-manifest default is overridden in
viewers.config.yaml.This PR lets users choose which Neuroglancer instance their links point to. It adds a "Neuroglancer" section to the Preferences page with a two-option toggle:
instance_template_urlinviewers.config.yaml— e.g. fileglancer.int.janelia.org in our production deployment) or theThe selected preference is applied everywhere the app generates a Neuroglancer URL: the "Open with Neuroglancer" links for OME-Zarr, Zarr, and N5 datasets, and the default base URL in the "Create Neuroglancer Short Link" dialog.
The underlying per-viewer preference model is also designed to support fully custom URLs and other viewers in the future, though only the Neuroglancer configured/external choice is exposed now.
Note - this PR requires the changes in PR #14 in fileglancer-hub, which change the
nginx.conftemplate to serve Neuroglancer from fileglancer.int.janelia.org/neuroglancer/.@krokicki