hydrus icon indicating copy to clipboard operation
hydrus copied to clipboard

Make the "ipfs" label in the media viewer clickable

Open roachcord3 opened this issue 2 years ago • 0 comments

Just like how URLs are clickable (or you can right-click them to get the "Copy Link Location" option), I would like the "ipfs" label that appears on pinned files to do the same. Here are the acceptance criteria I have in mind:

  1. When clicking the label, hydrus should tell the OS to open the native URL (i.e., ipfs://{hash}) for that media.

    Leave it up to the OS to decide on how to handle the URL. (I think most people are going to set it up so that it opens in a web browser.)

  2. When right-clicking and choosing "Copy Link Location", it should copy the same URL to your clipboard.

  3. (Optional) If you have a "clipboard multihash url prefix" set in your ipfs service, then perhaps it could replace the ipfs:// with that. Up to you.

  4. It should never just copy the multihash, as that by itself is basically useless.

  5. It should use the bafy hash rather than the Qm hash.

    It should be noted that the URL documentation, as of this writing, strongly recommends avoiding case-sensitive CID multihashes, both in native URL format as well as with an HTTP gateway (i.e., via the "clipboard multihash url prefix" setting); they recommend CIDv1 with Base32 or Base36 encoding instead. You know, bafy hashes. This is because some user agents will forcefully lowercase the multihash because they are treating it like it's a web domain (which is case-insensitive.) Hydrus currently seems to speak in Qm hashes instead right now, hence this requirement.

By the way: if the ipfs addresses were just added as known URLs, I think it would meet the requirements of this request and also #981, which was closed because Suika only cared about a way to get the ipfs hashes from the API.

roachcord3 avatar Dec 28 '22 21:12 roachcord3