Skip to content

feat: Neuroglancer base url preference when deployment overrides default#412

Open
allison-truhlar wants to merge 6 commits into
mainfrom
internal-neuroglancer
Open

feat: Neuroglancer base url preference when deployment overrides default#412
allison-truhlar wants to merge 6 commits into
mainfrom
internal-neuroglancer

Conversation

@allison-truhlar

Copy link
Copy Markdown
Collaborator

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:

  • the deployment-configured instance (set via instance_template_url in viewers.config.yaml — e.g. fileglancer.int.janelia.org in our production deployment) or the
  • capability-manifest default (neuroglancer-demo.appspot.com). The toggle only appears when the deployment overrides the Neuroglancer URL; otherwise both options are identical and it's hidden.

The 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.conf template to serve Neuroglancer from fileglancer.int.janelia.org/neuroglancer/.

@krokicki

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.
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