feat: remove the Private JupyterHub launch option - #152
Conversation
Collapses the launcher to a direct Colab link. Closes #87. The demand signal #87 was gated on came back empty. The book-theme only renders its hub button when `jupyterhub_url` is set in `_config.yml`, and an org-wide search finds that key in no lecture repo at all — every flagship series configures `colab_url` alone — so the button has never appeared on a live QuantEcon site. The MyST version was also not the same feature. It had no config key and rendered unconditionally, asking the reader to type a hub URL into a box whose value was `React.useState('')`, discarded as soon as the popover closed. Probing a live build showed it also hardcodes a `/jupyter/hub/` path segment that the Sphinx theme leaves to the configured URL, so it only ever addressed hubs at `<host>/jupyter/hub/` — not a stock JupyterHub, and not a local Jupyter server, which it could not reach in any case because nbgitpuller clones from GitHub rather than serving local files. Changes beyond deleting the option: - `LaunchButton` becomes an anchor rather than a button driving `window.open`, matching `GitHubButton`. With no choice left to make there is nothing for a popover to hold, and a real link restores middle-click and open-in-new-tab. - It renders nothing when `project.github` or the page location is missing. Previously the popover still opened with everything inside it disabled, which is the clickable-but-inert affordance #117 was about. - `buildJupyterHubUrl` and its unit tests are gone; `@radix-ui/react-popover` and `@radix-ui/react-radio-group` had no other consumers and are dropped from package.json, as `react-dialog` was when the history modal was removed. - `launch-open.png` and its two baselines are deleted — there is no popover to photograph. `launch-colab` now asserts the anchor's `href`, which also pins that the control is a link, so a regression back to a chooser fails here. Verified: `npm run compile` clean, `npm run test:unit` 18/18, and the full visual suite 19 passed / 3 skipped against untouched baselines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🎭 Visual regression resultsDetails
Skipped testsmobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › without JavaScript › drawer-opens-without-javascript |
There was a problem hiding this comment.
Pull request overview
This PR removes the Private JupyterHub notebook-launch option (resolving #87), collapsing the launcher from a Radix popover with a radio group and a hand-typed service-URL box down to a single direct anchor to Google Colab. The href is computed at render from the manifest, so the link is present in the server-rendered HTML and supports middle-click/open-in-new-tab. The change also drops the now-unused buildJupyterHubUrl builder, its unit tests, the Radix popover/radio-group dependencies, and the launch-open.png visual baseline.
Changes:
- Rewrote
LaunchButtonas an<a>(from aPopover+RadioGroup+window.open), rendering nothing whenproject.githubor the page location is missing. - Removed
buildJupyterHubUrland its tests; converted thelaunch-colabvisual test to assert the anchor'shref/targetinstead of stubbingwindow.open. - Dropped
@radix-ui/react-popoverand@radix-ui/react-radio-groupdirect dependencies and updated README/PLAN/CHANGELOG/types documentation.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/components/toolbar/LaunchButton.tsx | Replaces popover/radio launcher with a direct Colab anchor; hides control when repo/location missing |
| app/components/toolbar/launchUrls.ts | Removes the now-unused buildJupyterHubUrl builder |
| tests/unit/launch-urls.test.mjs | Drops JupyterHub URL tests and the HUB fixture constant |
| tests/visual/theme.spec.ts | Rewrites launch-colab to assert the anchor href/target rather than a stubbed popover |
| package.json / package-lock.json | Removes the Radix popover and radio-group direct dependencies |
| app/types.ts | Updates comment to reference only Colab launch URLs |
| README.md / PLAN.md / CHANGELOG.md | Documents the removal and future-work tracking |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@DrDrij we don't use this so I suggest we remove for now. I have opened issues to track better integration points. |
…upyterhub # Conflicts: # CHANGELOG.md # app/components/toolbar/LaunchButton.tsx # tests/visual/__snapshots__/desktop-chrome-darwin/launch-open.png # tests/visual/__snapshots__/desktop-chrome-linux/launch-open.png # tests/visual/theme.spec.ts
There was a problem hiding this comment.
🟡 Changes recommended
The removal leaves user-facing docs outside the diff stale — template/README.md still advertises launching "Private Jupyter Hub" sessions and README.md's Live-compute section still says "Colab/Hub".
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 9/12 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
Rebased onto current |
Collapses the notebook launcher to a direct Colab link. Closes #87.
Why now
#87's resolution path was "gather demand/usage signal from lecture maintainers." That signal is available from the lecture repos themselves, and it is empty.
The book-theme only renders its hub button when
jupyterhub_urlis set in_config.yml(launch.pyappends it tolaunch_buttonsconditionally). An org-wide code search finds that key in no lecture repo at all — every hit is insidequantecon-book-themeitself. What the flagship series actually configure:colab_urlcolab_urlcolab_urlcolab_urlSo the hub button has never appeared on a live QuantEcon lecture site over the lifetime of the incumbent theme.
It was also not the feature it looked like
Probed against a live build rather than read off the source. Typing
http://localhost:8888into the box produced:Three things that URL shows:
/jupyter/hub/segment is hardcoded. The Sphinx theme builds{jupyterhub_url}/user-redirect/git-pull?…, leaving the whole prefix to configuration, so any hub layout works. This baked QuantEcon's production layout into the code, so it could only ever address hubs at<host>/jupyter/hub/— a stock JupyterHub at/hub/user-redirect/would 404, and you cannot compensate from the text box./hub/user-redirect/is JupyterHub routing; a plainjupyter labhas no such route, and nbgitpuller on a single-user server answers at/git-pull.git-pullclones from GitHub — here a.notebooksrepo that does not exist — so even on a correctly configured hub it fetches published notebooks rather than what you are reading.There was no config key of any kind, so it rendered unconditionally even on Colab-only sites, and
privateServiceUrlwasReact.useState('')— verified that closing the popover resets the field to""and the radio to unchecked, so the URL had to be retyped for every launch.What changed beyond deleting the option
LaunchButtonis now an anchor, not a button drivingwindow.open, matching theGitHubButtonidiom. With no choice left to make there is nothing for a popover to hold, and a real link restores middle-click, open-in-new-tab and copy-link. Thehrefis computed at render from the manifest, so it is present in the served HTML and works without JS.project.githubor the page location is missing. Previously the popover still opened with every control inside it disabled — the clickable-but-inert affordance Code cells nested in a directive are never registered with the kernel, so they render a run button that does nothing #117 was about.buildJupyterHubUrland its unit tests are removed.@radix-ui/react-popoverand@radix-ui/react-radio-groupare dropped frompackage.json— the launcher was their only consumer, asreact-dialogwas for the history modal. Confirmed no other consumer repo-wide, and that refactor: rebuild the contents drawer on the Popover API #144 does not introduce one.launch-open.pngand both its baselines are deleted — there is no popover to photograph.launch-colabnow asserts the anchor'shrefinstead of stubbingwindow.open, which is offline and deterministic and additionally pins that the control is a link, so a regression back to a chooser fails the test.Verification
npm run compileclean ·npm run test:unit18/18 · full visual suite 19 passed, 3 skipped, against untouched baselines — the toolbar is visually identical, which is why no snapshot moved.Follow-up
Re-adding launch targets properly is tracked as three separate enhancement issues linked from #87 (JupyterHub, BinderHub, and local-server connections via Thebe), each with the background research behind it.
🤖 Generated with Claude Code