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

Add a custom protocol handler for JBrowse Desktop #2988

Open
garrettjstevens opened this issue Jun 1, 2022 · 23 comments
Open

Add a custom protocol handler for JBrowse Desktop #2988

garrettjstevens opened this issue Jun 1, 2022 · 23 comments
Labels

Comments

@garrettjstevens
Copy link
Collaborator

There is an example here of how to register an electron app as a handler for a custom protocol. If we regester e.g. the jbrowse:// protocol, we could use a link like jbrowse://something to open JBrowse Desktop from a browser or another app. One use for this could be an "Open in dekstop" menu item in JBrowse Web.

@garrettjstevens garrettjstevens added the enhancement New feature or request label Jun 1, 2022
@rbuels rbuels added the good first issue Good for newcomers label Jan 20, 2023
@raj1701
Copy link

raj1701 commented Mar 9, 2023

Hey @rbuels @garrettjstevens can I work on this?
I am planning to make a new main.js file in the src folder of jbrowse_desktop and follow the steps given in the provided link. Is this the right direction?

@cmdcolin
Copy link
Collaborator

cmdcolin commented Mar 9, 2023

@raj1701 the code would likely go in this file https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-desktop/public/electron.ts

we may not have the bandwidth to help, but if you'd like to try, you can

@raj1701
Copy link

raj1701 commented Mar 9, 2023

Sure I will give it a go. Working on this will give me a better understanding of the codebase atleast.

@cmdcolin
Copy link
Collaborator

cmdcolin commented Mar 9, 2023

sounds good. see the short note on the readme here for developing the desktop https://github.com/GMOD/jbrowse-components#quick-start-for-developers specifically I recommend launching two tabs for developing the desktop app.

the yarn electron command essentially runs the electron.ts file that i linked, and then yarn start command starts the webpack watch server that runs the rest of the codebase. you may need to restart the yarn electron command after your changes to the electron.ts file

@raj1701
Copy link

raj1701 commented Mar 9, 2023

Hey @cmdcolin can you please help me with how the electron app is packaged.
Which is the main config file. Is it craco.config.js?
I basically need to enter the declaration of the custom protocol in the config file.

@cmdcolin
Copy link
Collaborator

cmdcolin commented Mar 9, 2023

we do not use electron-packager or electron-fiddle, we use electron-builder. can google around but this is the first google result for electron-builder https://stackoverflow.com/questions/45809064/registering-custom-protocol-at-installation-process-in-electron-app

@cmdcolin
Copy link
Collaborator

cmdcolin commented Mar 9, 2023

@raj1701
Copy link

raj1701 commented Mar 10, 2023

Thanks @cmdcolin will look into it

@raj1701
Copy link

raj1701 commented Mar 10, 2023

Hey @cmdcolin . I was able to add a custom protocol in windows by adding the following code

  • app.setAsDefaultProtocolClient('jbrowse',process.execPath,[path.resolve(process.argv[1])]) in electron.ts
  • "protocols": [ { "name": "electron-deep-linking", "schemes": [ "jbrowse" ] } ] inside build of package.json
  • run yarn build-electron

After these three the protocol works perfectly in windows but not working in linux.
This shows "electron-userland/electron-builder#4035", something else needs to be tried for linux.
Any insights??

@cmdcolin
Copy link
Collaborator

sorry no ideas, but great progress @raj1701 :) that is very cool

@raj1701
Copy link

raj1701 commented Mar 13, 2023

Hey @cmdcolin I tried a lot of things but nothing worked for linux. The problem is no .desktop file is getting created.

It does work perfectly for windows and mac. The above solution does not disturb the linux app. Should I issue a PR for making it work for windows and mac?

Also I wish to apply for GSOC 2023 with jbrowse. Can I pick up some other issue to get familiar with the codebase? Is there some issue you can recommend?

@cmdcolin
Copy link
Collaborator

sure thing, you could create a PR for the work so far with windows/mac. the linux 'landscape' might definitely be more challenging, i don't think a .desktop file always can be counted on for example. it might be we could ship the feature without linux support

@cmdcolin
Copy link
Collaborator

as far as other things to get familiar with the codebase, it is hard to recommend. there are just not a lot of low hanging fruit hanging out in the issue queue for a long time so even our 'good first issues' are significantly involved in many cases. if you want to just browse the issues and see if any are of interest, post and let us know. can also just try to learn background about genomics, bioinformatics, react, typescript, mobx-state-tree, etc.

@raj1701
Copy link

raj1701 commented Mar 14, 2023

Thanks for the help @cmdcolin. I will look into the topics you mentioned and also the Gsoc idea "BLAST integration for JBrowse 2". Also I was thinking of writing a draft proposal for this idea. For getting reviews can I contact you?

@cmdcolin
Copy link
Collaborator

sure thing :) if you are comfortable can post on https://github.com/GMOD/jbrowse-components/discussions or can email me

@raj1701
Copy link

raj1701 commented Mar 15, 2023

Thank you very much @cmdcolin.

@raj1701
Copy link

raj1701 commented Mar 24, 2023

Hey @cmdcolin I have started with an initial draft of the proposal for the idea "BLAST integration for JBrowse 2". Can you please share your email id.

@cmdcolin
Copy link
Collaborator

I believe you can submit draft to the gsoc portal now, and I can read it there

@raj1701
Copy link

raj1701 commented Mar 27, 2023

I have submitted the proposal on the portal @cmdcolin. Please review it

@cmdcolin
Copy link
Collaborator

as mentioned here there is probably a larger effort involved to open up data in desktop related to loading the same data in the view on web into the view on desktop #3579 (comment) just knowing the basics of protocol handlers that you submitted is useful though

@cmdcolin
Copy link
Collaborator

oh sorry I thought you meant to review the PR, you meant the gsoc portal. nevermind above comment

@raj1701
Copy link

raj1701 commented Mar 29, 2023

No problem. Please let me know the changes required in the proposal. I will update it accordingly. Thanks!

@cmdcolin
Copy link
Collaborator

see #3476 for nice mockup of how we could link to desktop from web

@cmdcolin cmdcolin added high impact and removed good first issue Good for newcomers labels Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants