Hey folks ,
I was looking for the next bigger thing to tackle and both @Julien & @abbey suggested I should look into deep linking, because it was suggested by the community on multiple occasions (1, 2, 3).
Before we shipped our first public beta we also had a discussion around linking to entities within Upstream, but due to time constraints we decided to postpone figuring out what the structure for deep linking should be. Now would be a great time to revisit it again.
What I’d like to get out of the discussion here is a better definition of what the user experience should be, I think this would help to properly scope and break down this feature for implementation.
So, I talked to @abbey regarding her feature request, and if I understood correctly, then her goal is to reduce the steps that are necessary to look at a project’s source code while browsing the web and not having Upstream open, or in other words the higher-level goal is to improve project discoverability.
To achieve this goal, we essentially want a shareable URL which is rendered as a clickable link by services like Twitter/GitHub/forums/etc. A caveat, which at first I didn’t realise is, that these services only render URLs with http://
and https://
protocols as clickable links. In other words, custom protocols like rad:
, rad://
or upstream://
would be rendered as plain-text by these services and would not be clickable, thus a user would have to still select, copy and paste them somewhere for this feature to work, which is not ideal.
This is why other apps (like Telegram, for example) link to a website which calls their custom protocol to open the app on the user’s computer. There are also other benefits of having this intermediate step:
- we can provide instructions to download and install the app if a user hasn’t installed it yet
- generate link previews for Twitter and other services
- provide a URL shortening service
- we have an additional abstraction between the links shared on the web and an application that handles them, giving us the flexibility to redirect to something else in the future
To illustrate things further, here are some screenshots:
-
Custom protocol on Twitter:
-
A link to a website that opens a custom protocol with a preview
-
A link to a website that opens a custom protocol without a preview
-
Custom vs
https://
links on Github
The other end of this feature is about how to handle these external requests inside of Upstream.
Let’s assume that for the initial version we only want to handle sharing projects via their Radicle ID
s. In this case, once a user clicks on a project’s link on the web this link leads to the redirect webpage, which in turn opens Upstream and forwards it the Radicle ID
. Now, if the user already has the project locally, we can simply display that. But if the project hasn’t been followed and replicated yet, we could show the search modal with the Radicle ID
pre-filled in the search field.
macOS proof-of-concept
Linux proof-of-concept
@xla already proposed a scheme which could work for opening Upstream via a custom protocol.
Next steps:
- discuss in this thread whether the feature as I laid it out here makes sense
- once we agree on the feature, break it down into smaller steps, eg.:
- define what the URL scheme of the redirect webpage should look like and what domain to use
- something to consider here is that
.xyz
domains often get blocked
- something to consider here is that
- design the UI of the redirect website
- figure out what stack to use and how to deploy the redirect website
- formalise @xla’s proposed custom Upstream protocol scheme
- should we use
rad:
(URN form),rad://
(URL form) orupstream://
as the custom protocol, i.e. should the custom protocol be usable by many different apps or should it be Upstream specific?
- should we use
make a proof-of-concept implementation to validate that the custom protocol works on Linux and macOS:1652
- define what the URL scheme of the redirect webpage should look like and what domain to use