Skip to content

Toggle sharing single scene or entire collection#499

Open
frasercl wants to merge 12 commits intofix/share-large-collectionfrom
feature/toggle-share-scene-collection
Open

Toggle sharing single scene or entire collection#499
frasercl wants to merge 12 commits intofix/share-large-collectionfrom
feature/toggle-share-scene-collection

Conversation

@frasercl
Copy link
Copy Markdown
Contributor

@frasercl frasercl commented Mar 27, 2026

Review time: smallish (~10-15min)

Loosens up the share modal's restrictions on trying to share very large scene collections and image metadata from BFF. This behavior was introduced in #488.

There are two types of data that can be passed to Vol-E from BFF which cause problems for shareable links:

  1. Large sets of images, which can make the URL arbitrarily long if every single image's path is included in the URL.
  2. Extra image metadata, which we have no means of including in the URL at all.

In #488 I added a restriction around 1. and introduced a warning message when either was present. I talked to UX about this, and we agreed to some revisions:

  • Messages should be styled like info, not a warning
  • Users should always be given the option to fit the entire scene collection into a URL, no matter how long the URL might become

Screenshots

Before
image

After
image

@frasercl frasercl requested a review from a team as a code owner March 27, 2026 00:56
@frasercl frasercl requested review from ascibisz and toloudis and removed request for a team March 27, 2026 00:56
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.4.8
🚀 Deployed preview to https://allen-cell-animated.github.io/vole-app/pr-preview/pr-499/
on branch gh-pages at 2026-03-27 01:00 UTC

Copy link
Copy Markdown
Contributor

@toloudis toloudis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of recommendations (a comment and a symbolic constant) but overall LGTM.

view3dRef?: React.RefObject<View3d | null>;
};

const MAX_URL_CHARACTERS = 2000;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, what was the rationale for choosing this number? A comment would be helpful. Because why not 4000 or 32767?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const serializedUrl = hasTooManyScenes
? encodeSceneUrl(urls[viewerSettings.scene])
: urls.map(encodeSceneUrl).join("+");
const serializedUrl = showAllScenes ? urls.map(encodeSceneUrl).join("+") : encodeSceneUrl(urls[viewerSettings.scene]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like "+" could be a symbolic constant called something like SCENE_DELIMITER since it probably shows up in a couple different places, in other parts of the code.

}

// location.pathname will include up to `.../viewer`
const baseUrl = location.protocol + "//" + location.host + location.pathname;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised there isn't a common function to do this!

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.

2 participants