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

🚀 MVP launch buttons for JupyterHub & MyBinder #503

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Nov 25, 2024

To close jupyter-book/mystmd#1643 and jupyter-book/mystmd#1644, this PR prototypes a launch UI. We will want to move things around in time, but this PR is designed to start design conversations.

There are some deeper conversations around environment provisioning, and execution strategies. They should be ignored for the purpose of this MVP.

Open questions

  • It would be nice for the launch button to be sticky, but the current Thebe example feels a bit uncoupled from the rest of the document. How can we improve this?

Zero-mystmd-changes MVP

  • Use HEAD
  • Support bring-your-own Hub/Binder
  • Use frontmatter-defined binder

Kitchen-sink solution

This comment was marked as off-topic.

@agoose77
Copy link
Collaborator Author

agoose77 commented Nov 25, 2024

The first commit adds a basic launch popover from the frontmatter header icons:
image

I think this is a good spot for a launch button, as it's "per-document", and not too obtrusive. However, it's not necessarily a "frontmatter" feature, and perhaps is too unobtrusive.

In the long run, I'd like us to expose more features, like JupyterHub vs MyBinder, Deepnote, Colab, etc. These will probably be tabs within the popover. We should aim to support these kinds of options, but reducing the amount of input that the reader needs to handle.

For now, though, the goal of this prototype is to explore the MVP for a UX in order to identify changes in MyST-MD / MyST theme that will be necessary.

image

@choldgraf
Copy link
Contributor

choldgraf commented Nov 25, 2024

Quick thoughts from me:

  • That location for a button seems natural, at least as a first step. The one other place I could imagine it would be next to the thebe button, which I think is floating to the bottom-right? But I think that could be a future enhancement.
  • Agree tabs is worth exploring for different launch services. Though for now, just supporting one-or-more hard-coded BinderHub and JupyterHubs is fine.
  • A "nice to have" would be allowing users to specify their own BinderHub / JupyterHub to launch, but I think that's not critical for an MVP.
  • If JH doesn't have an ability to tell MyST whether it has image building functionality, let's just make the assumption that a hard-coded hub/Binder instance does, and scope the "discover if a Binder image can be built" task for a follow up

Overall - the UX you describe above seems like a good first step for an MVP - it roughly mimics the behavior of Jupyter Book and would let users get started if they were already relying on that feature.

@@ -24,6 +24,7 @@
"@heroicons/react": "^2.0.18",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

function LaunchButton(props: { github: string; location: string; binder?: string }) {
const binder = props.binder ?? 'https://mybinder.org';
type CommonLaunchProps = {
github: string;
Copy link
Contributor

@stevejpurves stevejpurves Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we generalize in our naming a bit more? as in:

git: <url>
provider: 'github'

thebe does that, as the intention is to support git interface/protocol.

or are we happy with

github: 'https://gitlab.myinstitution.org/...'

Also I realise that we only have github in the frontmatter, but I am imagining that this git info will in future come from a more dedicated frontmatter.services block or the like which may have non github specific fields, like the one I suggest there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, entirely! I'm going to take inspiration from some of the jb1 config here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do need to change our frontmatter; GitHub should not be the only Git repo that we can define in our frontmatter.

I would probably have frontmatter fields for github, gitlab, etc. that are normalised to a git field i.e. mystmd should know how to build canonical URLs for those providers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@agoose77 agoose77 changed the title 🚀 Prototyping launch buttons for JupyterHub & MyBinder 🚀 MVP launch buttons for JupyterHub & MyBinder Nov 28, 2024
@agoose77 agoose77 force-pushed the agoose77/wip-add-launch-button branch from d35cb27 to e2f97b8 Compare November 29, 2024 17:39
@agoose77
Copy link
Collaborator Author

agoose77 commented Nov 29, 2024

I've added support for basic validation using Radix Form:

screen

I think this is good to go for a WIP. I'm keen to ship this in time for AGU, so I'm not exporting it intentionally. We can also disable it by default if that provides less concern for @stevejpurves et al. to ship.

Any review welcome.

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

Successfully merging this pull request may close these issues.

Allow users to launch JupyterHub or a BinderHub session with book content and the current page active
4 participants