datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
15 stars 12 forks source link

When should a download button in the content tab be shown #380

Open mslw opened 1 year ago

mslw commented 1 year ago

The change in 498c2787ebb78c618f32e0857255d0455e43a20e makes the catalog display a file download button in the content tab only if the file content URL is http(s). I think it is overly restrictive.

As an alternative, I would propose that a download button should be reported for any URL that has a scheme (in Python terms, that would mean urlparse(url).scheme != "" instead of urlparse(url).scheme.startswith("http")). That would eliminate the situation where a url is treated as relative to the catalog location without excluding things like e.g. (s)ftp.

Premises:

This is not to suggest a quick change, but rather to understand better what is the desired behavior and role of the URL/download display in the content tab.


Counterpoint by @jsheunis from https://github.com/psychoinformatics-de/sfb1451-projects-catalog/pull/50#issuecomment-1749094255

I agree the current state is a somewhat blunt "fix". I do think the UX is important though, and having a download button that always fails is bad UX. I would suggest more fit-for-purpose functionality, such as having a scheme for interpretation and having different renderings and UX accordingly.


Previous discussions:

jsheunis commented 12 months ago

Thanks for the write-up! Will get back to this.