Skip to content

fix(views): apply data-link naming preferences and external URL mapping at checkout - #496

Open
allison-truhlar wants to merge 5 commits into
fix/views-inferred-layer-typefrom
fix/views-checkout-link-prefs
Open

allison-truhlar wants to merge 5 commits into
fix/views-inferred-layer-typefrom
fix/views-checkout-link-prefs

Conversation

@allison-truhlar

@allison-truhlar allison-truhlar commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

ClickUp: 17tkuw629e8. Stacked on #494.

View checkout (the cart, "Add to this View", and the "Neuroglancer View" button in the Zarr metadata panel) now resolves data access the same way the standalone Neuroglancer button does.

What changed

Data Link naming. Checkout computes url_prefix with the same defaultUrlPrefix call the file browser uses, so the name, full_path, and custom preferences apply. In custom mode the consent dialog shows one name field per new link, prefilled with the folder name and validated like the Data Link dialog. With automatic links in custom mode, the dialog asks only for names.

External bucket mapping. Checkout resolves the external-bucket mapping before creating a Data Link and builds the layer from that URL. Those datasets don't count toward the consent prompt. The server recognizes external URLs when creating and reconciling View layers, and the viewer sidebar resolves them back to datasets.

Also

  • Bucket reads use credentials: 'same-origin'. include fails CORS against buckets that answer Allow-Origin: *.
  • "Appears in Views" works for datasets without a Data Link through the new GET /api/neuroglancer/views/for-dataset endpoint.

Why

Checkout sent only fsp_name and path when creating a Data Link, so every link got the default basename prefix regardless of preference, and the consent dialog had no field for a custom name. Checkout also skipped the external-bucket mapping for ordinary file shares, creating a Data Link where the standalone button reuses the external URL.

Testing

Automated:

  • pixi run -e test test-backend: bucket_source with external roots, external-layer reconcile, get_views_for_dataset.
  • pixi run test-frontend: prefix per naming mode, custom-name dialog, external URL resolution, dataset variant of AppearsInViews.

Manual, in the dev server:

  • Naming modes: set full_path, name, and custom (with automatic links on and off), then created a View from a dataset with no link. Each new link got the expected name. Repeated from "Add to this View" and from the draft View button.
  • External mapping: with links set to not automatic, added an OME-Zarr under an externally mapped folder to the cart and clicked Create View. The dialog asked only for the View name. The Data Links page shows no new link for that path, and the View's source points at the external bucket URL and loads.
  • Appears in Views: the Properties drawer lists the View for both a public bucket dataset and the externally mapped dataset above.

@krokicki

Browsers block credentialed requests to servers that answer with
Access-Control-Allow-Origin '*', so reading metadata from such a
public bucket failed and checkout built an empty View.
Match the standalone Neuroglancer button: a path an external bucket
already serves needs no Data Link, so checkout and the consent count
skip it. Saving and the Sources tab now recognize those URLs too.
Match the standalone Neuroglancer button, which names new links by
the naming preference. Checkout always used the basename.
Match the standalone Neuroglancer button: in custom naming mode, the
dialog asks for a name for each new link and checks it before
creating the link.
Bucket and externally mapped datasets have no Data Link, so the
properties drawer's "Appears in Views" had nothing to key on. Add
GET /api/neuroglancer/views/for-dataset, matching the caller's working
layers by (fsp_name, path), and show it for read-only and externally
mapped paths.
@allison-truhlar
allison-truhlar force-pushed the fix/views-checkout-link-prefs branch from c8a4994 to 58a4571 Compare October 30, 2026 19:01
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