open-payments icon indicating copy to clipboard operation
open-payments copied to clipboard

[BUG] "View full diagram" is not linkable

Open jeremiahlee opened this issue 11 months ago • 3 comments

Bug Report

Describe the bug

On the Open Payments flow documentation, the "View full diagram" links are not able to be copied/pasted. The blob: URLs show in the browser address bar cannot be re-requested. Removing the blob protocol results in a 404 error.

To Reproduce

  1. Go to Open Payments flow documentation
  2. Click on "View full diagram"
  3. Copy URL from browser address bar.
  4. Paste URL in a private window.
  5. See browser error.
  6. Remove blob: prefix from URL, hit return.
  7. See 404 error.

Screenshots

First click on "View full diagram" Image

Requesting the blob: URL: Image

Requesting the URL without the blob: protocol: Image

Expected behavior

The diagram images would be sharable like any image asset on the website: copying the link and when copying the URL shown when viewing the image.

jeremiahlee avatar Feb 17 '25 18:02 jeremiahlee

Some extra info: I believe this is a Mermaid thing, which means the same behavior exists across our doc sites. I personally would like the option to Save Image when I right click on a diagram, but I’m not given that option because of the way the diagrams are rendered. I’m mentioning it here because maybe the fix to Jeremiah’s issue will/could involve this piece as well.

melissahenderson avatar Mar 10 '25 15:03 melissahenderson

Since Mermaid renders diagrams as SVGs in the browser, I found that it's possible to serialize the generated SVG into a Base64 string, making it technically "shareable" (see below). However, this approach may run into issues with some browsers due to URL length limitations.

Base64 SVG

I also explored an option to enable downloading the SVG with a button click.

Both approaches would not solve the "linkable" issue since the downloaded SVG or Base64 encoded SVG would be static, any suggestions?

marclevin avatar Mar 12 '25 17:03 marclevin

I'm aware this has been open for a while. I'm full with work for the next two weeks so I'm un-tagging myself in case anyone wants to pick it up in the interim. Otherwise I'll check in again when the immediate deadlines have passed.

JoblersTune avatar Mar 14 '25 06:03 JoblersTune