Skip to content

feat: add preference to show full file path in data links; add labels for UI display to data links#344

Merged
krokicki merged 31 commits intomainfrom
transparent-links
Apr 10, 2026
Merged

feat: add preference to show full file path in data links; add labels for UI display to data links#344
krokicki merged 31 commits intomainfrom
transparent-links

Conversation

@allison-truhlar
Copy link
Copy Markdown
Collaborator

@allison-truhlar allison-truhlar commented Apr 7, 2026

Clickup ids: 86abc1mrr

This PR adds the ability for the user to select between three data link naming formats:

  • Directory name only - current format, https://.../<key>/directory-name
  • Full/transparent path — when enabled the full relative path appears in the URL instead of just the directory name. https://.../<key>/full/path/to/directory-name
  • Custom - allows the user to type a custom string into an input field. https://.../<key>/some-custom-string/can/be/path-like

Whatever the string added for the data link name, this is added to the "name" column in the data link table. This value is not editable.

Collapse /files/{key}/{sharing_name}/{path} into /files/{key}/{path}. _get_file_proxy_client now resolves subpath by matching captured_path against stored path or basename with boundary guards. This is backwards compatible with existing links because {sharing_name} used to just be the name of the directory the data link was being created for (now called a non-transparent link)
also needed to update the mock for /api/proxied-path for the DataLinkDialog test
New mutation with optimistic rollback for PUT /api/proxied-path/:key.
also change the column heading on the data link table from "name" to "label"
@allison-truhlar allison-truhlar requested a review from krokicki April 8, 2026 17:15
Copy link
Copy Markdown
Member

@krokicki krokicki left a comment

Choose a reason for hiding this comment

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

I like the data labels!

For the transparent URLs, it shows me that the link will look like this:
https://.../<key>/annotations/jrc_P3-E5-D1-N2_v2_destreaked/crop12/crop12cell_labels_for_ML/amira_export.zarr

It needs to include the full path (i.e. mount path of the FSP at the beginning) to be fully transparent.

sharing_key: proxiedPathByFspAndPathQuery.data!.sharing_key,
sharing_name: newLabel
});
toast.success('Data link label updated');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is the same code as handleConfirmLabel in linksColumn. Is there a way to reuse it?

Replace the boolean is_transparent flag with a free-form url_prefix string
that stores the exact URL path segment appearing after the sharing key.
This allows data links to use any arbitrary subpath (directory name, full
path, or custom string) rather than being limited to two hardcoded modes.
Replace the transparentDataLinks boolean preference with a
dataLinkSubpathMode preference ('name' | 'full_path' | 'custom').
The preferences page and create data link dialog show a radio group.
When custom mode is selected, the dialog shows an editable text input.
When automatic links + custom mode are both enabled, a dialog is shown
instead of silently creating the link.
The data link "label" is now always set to the url_prefix at creation
time and is no longer separately editable. Remove the EditDataLinkLabel
dialog, the edit label menu action, and the useUpdateProxiedPathMutation
hook. Rename the table column from "Label" to "Name".
- this is only for now - the sharing_name always equals url_prefix. The put mutation is not included on the frontend for now, so this code is never accessed
Encodes the default url_prefix derived from basename, and also encodes
an explicitly provided url_prefix if it contains invalid characters.
Avoids double-encoding values already encoded by the frontend.
@allison-truhlar allison-truhlar requested a review from krokicki April 9, 2026 21:29
Copy link
Copy Markdown
Member

@krokicki krokicki left a comment

Choose a reason for hiding this comment

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

Looks good. I think it would be better if the "Enable automatic data link creation" option was on the bottom, but that's not easy to do with how the options are currently implemented, so we can come back to it later.

@krokicki krokicki merged commit e3071d8 into main Apr 10, 2026
3 checks passed
@krokicki krokicki deleted the transparent-links branch April 10, 2026 12:14
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