Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open local or remote diagram directly with URL #1898

Open
2 tasks done
hberge opened this issue Oct 25, 2024 · 4 comments
Open
2 tasks done

Open local or remote diagram directly with URL #1898

hberge opened this issue Oct 25, 2024 · 4 comments

Comments

@hberge
Copy link

hberge commented Oct 25, 2024

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

It would be convenient to have URL links that from any program can at the same time 1. open the website/app and 2. open a diagram stored either locally or remotely. This is different to creating a link that embeds the entire diagram.

  • I would use the link in my notes to find back to the file I was editing.
  • I would share the link with other people with the same access, so they can review and/or edit.

Describe the solution you'd like

  • I believe this function would fit under "File>Share...". Here I would like an option to create a "Link to reopen drawing". (Links could have an option to open it in a read-only mode.).
  • When opening the link, the app could present a popup asking if you trust the remote resource and wish to proceed.

Describe alternatives you've considered
My current alternative is to store the link or path to the file separately. Then copy this, open the draw.io app, find the right form to open the file, then paste the URL or path and click to open it.

@davidjgraph
Copy link
Contributor

Could you give a full, concrete example, including example URLs please?

@hberge
Copy link
Author

hberge commented Oct 25, 2024

Yes, of course. Thanks for this amazing tool by the way.

I have come to realize that I might be in the wrong repository as this is the desktop app, while I am using the online app.

In the web app the URL's to open files directly exist (decoding code starts here ).

The links start with #U for url, #L for local storage, #W for Onedrive API.

What works:

  • I am able to get a link to a #W resource to open automatically.
  • I am able to make the app show a link in the banner for a #W resource opened via the File>OneDrive... function. And I can reopen it by pasting it to a new browser window.

What doesn't work (for me):

  • I am unable to make the app show/provide a link to a local file.
  • I am unable to create a functional link to a local file using the '#L' prefix.
  • I am unable to open a OneDrive url using the '#U' prefix.

Longer explanation:

#W The app does give me a link in the banner for Onedrive if I authenticate the app and open through the API. It looks something like this (note this particular link is not functional, but this would work for my use-case):

https://app.diagrams.net/#W39e456aa12b5b347%2F39E456AA93B5B348!2500#%7B%22pageId%22%3A%22wI32ebNNtJT7YJtcZUMU%22%7D

#L - I am unable to find a parallel for local files, the app does not show these as links. Therefore I can't see how such a link should be encoded, if it is possible. My attempt at encoding it looks like https://app.diagrams.net/#LC%3A%5CUsers%5Chberge%5CDocuments%5COneDrive%5Cx.drawio although I tried several variants. I also tried encoding the path with a url-encoded version of "https://app.diagrams.net/#Ufile:///C/Users/....". In both cases I get the response "File Not Found".

#U - I am unable to open an URL that I created within Onedrive and where I've set the access to an "Anyone with the link can view/edit". Using open from a URL gives the following link format:

https://app.diagrams.net/#Uhttps%3A%2F%2F1drv.ms%2Fu%2Fs!AkiztZKsVuQ5k0T71oqDCE9QivUg%3Fe%3DiRp95U

@davidjgraph
Copy link
Contributor

You can't create a https protocol URL to a local file, browsers don't allow that.

@hberge
Copy link
Author

hberge commented Oct 25, 2024

Ah,.. I once knew, but now had forgotten that.

I now downloaded the desktop app and (on Windows) it recognizes the *.drawio extension. So I can use this to make links to the filesystem while the OS opens the app. This is enough for me at the moment, I can use this to improve my workflow.

What remains in this thread is for the webapp the inability to open URL "share links" that onedrive/sharepoint provides. (E.g. https://1drv.ms/u/s!AkiztZKq...). I also see that desktop app does not have the option to open or import from Url's or onedrive links or resources, via the File menu.

I can live without this, so having learnt two work-arounds I can use, please close the issue if you feel like it. Thanks for your time.

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

No branches or pull requests

2 participants