Skip to content

fix(views): match standalone Neuroglancer layer types in Views - #494

Open
allison-truhlar wants to merge 5 commits into
mainfrom
fix/views-inferred-layer-type
Open

allison-truhlar wants to merge 5 commits into
mainfrom
fix/views-inferred-layer-type

Conversation

@allison-truhlar

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

Copy link
Copy Markdown
Collaborator

What changed

Views now pick layer types the same way the standalone Neuroglancer
button does:

  • OME-Zarr datasets use the thumbnail-edge heuristic from the
    single-dataset preview to choose between image and segmentation.
    The disableHeuristicalLayerTypeDetection preference turns it off,
    as it does for the standalone button.
  • Plain Zarr arrays always open as image. The standalone button
    has no thumbnail to run the heuristic on, so it does the same. This
    removes the name-and-dtype guess in guessPlainLayerType.

Two follow-on changes keep checkout fast and reliable now that it
renders thumbnails:

  • buildViewState starts every dataset at once instead of awaiting
    them one at a time, so checkout time no longer grows with cart size.
  • useCreateViewFlow opens the draft tab right away on click, then
    sends the tab to the draft once the state is built. Rendering the
    thumbnails can take longer than the click's user activation lasts,
    and then the browser blocks the popup. If building the state fails,
    the tab closes.

Why

The metadata panel and the standalone Neuroglancer button could call a
dataset a segmentation while the View opened it as an image, or the
other way around.

Addresses Clickup ids 17tkuw61tnm and 17tkuw629cv

Testing

  • New unit tests in viewCheckout.test.ts cover inference on, inference
    off, and the parameter it passes through.
  • useCreateViewFlow.test.tsx checks that the pre-opened tab gets the
    draft URL and closes on failure.
  • pixi run test-frontend passes for viewCheckout, useAddToView,
    useCartCheckout, and useCreateViewFlow.
  • Checked out a segmentation dataset by hand and confirmed the View
    opens it as a segmentation layer.

@krokicki

Match the standalone Neuroglancer button in Views. It has no thumbnail
to run the edge heuristic on a plain array, so it always opens one as
an image.
Match the standalone Neuroglancer button in Views by using the same
thumbnail-edge heuristic, so the metadata panel and the View agree on
image vs. segmentation.
Every dataset now renders a thumbnail. Building them one at a time made
checkout time grow with cart size.
Rendering the thumbnails can take longer than the click's user
activation lasts, and then the browser blocks the popup.
@allison-truhlar
allison-truhlar force-pushed the fix/views-inferred-layer-type branch from 42ad2a3 to b41ab70 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