The discussion revolves around the design of a plugin for Discourse, specifically the page that shows the association between a Discourse user and a Keybase user. emanuele is seeking feedback on whether to implement this page as a full page or a modal dialog. He initially considered a full page but believes it is discouraged in plugin design. sam suggests that if the process involves a redirect chain, a full page might be necessary, but if it’s a simple call to the Discourse server, a modal would suffice.
emanuele clarifies the process, stating that after clicking “associate,” the user is redirected to a Keybase URL, which then redirects to the Keybase app or website, without returning to Discourse. He shares the plugin’s skeleton and the intended flow.
pfaffman proposes an alternative approach, suggesting that instead of a plugin, the Keybase user could insert a string in their Discourse profile’s “about me” section, eliminating the need for a plugin. emanuele acknowledges this idea but states that he is focusing on the plugin design, specifically the choice between a modal or full page for the association page, and has decided to proceed with a modal.
I am writing a plugin for Keybase Proofs, and since it is my first attempt at writing a Discourse plugin, I am still trying to figure out the best way to integrate it with the product
The plugin itself needs just a couple UI components, and one of them is still a bit tricky for me to implement: the page that shows the association between the Discourse user and the Keybase user (see the screenshot here).
The easiest way for me to implement it is a full page, for example served at /keybase-proofs/new-proof, but it seems like it is discouraged to have a plugin define their own full pages (@eviltrout I think I remember you writing about this somewhere, perhaps you can give me some hints?).
So what I am trying to do instead is having a modal dialog appear when the url to create the association is hit. So ideally I’d like to show the Discourse homepage with a modal on top, using an outlet. Would this be a better design? If so: how do I make the modal appear only when a specific url is hit, with the homepage in the background? The only way I see to make this happen is to use query parameters:
Here, I would use new_keybase_proof=true to decide if I need to show the modal or not.
UPDATE: Perhaps I should do something like what happens for /login? That is, do a redirect to the homepage in the route beforeModel() method and then call the method that shows the modal?
With a lot of the mobile stuff we were stuck doing full page cause the technique we used involving post message in JS ended up failing.
Can you elaborate a bit about the process after you click associate? Does it redirect to key base and then redirect back to us?
If there is a redirect chain involved you are going to need a new route here with a new full page. If this is simply making a call to the discourse server and it takes care of the magic, then you can get away with a modal.
After you click associate, it just redirects to a Keybase url which then redirects to the Keybase app/website as needed, it doesn’t get back to Discourse.
This may be way off base, but could you instead of having a plugin just have the keybase user insert some string in their profile about_me? (Discourse Meta - The Official Support Forum for Discourse) Then no plugin would be required and people could have a proof on any Discourse site, not only those who had heard of KeyBase and were willing to install a non-standard plugin.
Yep, I am the same person in both threads In here, I was just trying to understand which of the two designs for the association page was better: modal, or full page. I am going for a modal now, but it should be easy to replace it with a full page if needed