diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..082b1943 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.configureOnOpen": false +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 537d5c1a..6bdb4163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- The notebook-launch toolbar trigger now has an accessible name (`aria-label="Launch notebook"`); previously it exposed no name to assistive technology. Added alongside the first regression coverage of the launch popover (Colab URL + default selection — BinderHub was deliberately not added, see [#26](https://github.com/QuantEcon/quantecon-theme.mystmd/issues/26)). + ### Added - Per-PR rendered previews on GitHub Pages (`.github/workflows/preview.yml`): each PR statically builds the real `lecture-python-programming` lectures with the candidate theme (`myst build --html`, including the build-time Jupyter Book → MyST upgrade) and publishes to `gh-pages` at `pr-preview/pr-/` with a sticky link comment and teardown on close. Self-contained on `GITHUB_TOKEN` — no external preview service. diff --git a/PLAN.md b/PLAN.md index e864dc99..73fba08f 100644 --- a/PLAN.md +++ b/PLAN.md @@ -272,8 +272,14 @@ stripping) + `docs/user/launch.md`. in (`PageContent.tsx` uses `ExecuteScopeProvider`, `NotebookToolbar`). Confirm/enable `myst.yml` `project.jupyter`/`thebe` config path and surface a "live compute" toggle consistent with the toolbar. -- [ ] **BinderHub:** add a Binder option to the `LaunchButton` radio group; build - `…/v2/gh/{org}/{repo}/{branch}?urlpath=…` URLs. +- [x] ~~**BinderHub:** add a Binder option to the `LaunchButton` radio group~~ + **Decided against (2026-06-12):** BinderHub proved flaky in practice, and Colab + is the launch target QuantEcon standardises on — primarily because it provides + **GPU access** for the lectures that need it. #26 stays open as a demand-driven + future request (an implementation existed in PR #86 and was stripped before + merge — recoverable from that history if demand appears). The Private + JupyterHub option remains for now; its possible removal (collapsing the + launcher to a direct Colab button) is tracked in #87. - [ ] Generalise the hardcoded `.notebooks` suffix and `main` branch (`LaunchButton.tsx:9–11`) into config read from project frontmatter / `myst.yml`, so non-default branches and naming work. diff --git a/README.md b/README.md index 26883f38..6b0fe40b 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,11 @@ downloads: The launch notebooks capability has been developed to mirror capabilities in the previous QuantEcon theme. It is assumed that the `.notebooks` suffix convention for repository naming is used when launching both Google Colab and Private Jupyter Hub sessions. +Colab is the primary launch target (it provides GPU access for the lectures that +need it). BinderHub is deliberately not offered — it proved flaky in practice; +see issue [#26](https://github.com/QuantEcon/quantecon-theme.mystmd/issues/26), +kept open as a demand-driven future request. + ## Usage with MyST Point your project's `site.template` at a **pinned release** zip: diff --git a/app/components/toolbar/LaunchButton.tsx b/app/components/toolbar/LaunchButton.tsx index 62a7f27d..0c0f43b5 100644 --- a/app/components/toolbar/LaunchButton.tsx +++ b/app/components/toolbar/LaunchButton.tsx @@ -103,7 +103,7 @@ function LaunchPanel() { export function LaunchButton({ size, showLabel }: { size: number; showLabel?: boolean }) { return ( - + { animations: "disabled", }); }); + + // Launch popover: Colab is the default and primary target (BinderHub is + // deliberately not offered — #26). window.open is stubbed so the launch URL + // assertion is deterministic and offline; the URL's repo part comes from the + // fixture's `github` field, so only the stable pieces (host, .notebooks + // convention, branch, path) are pinned. + test("launch-colab", async ({ page }, testInfo) => { + test.skip( + testInfo.project.name !== "desktop-chrome", + "the launch popover lives in the desktop toolbar; mobile wraps it in MobileActionsMenu" + ); + await page.goto("/notebook", { waitUntil: "domcontentloaded" }); + await settle(page); + await page.evaluate(() => { + (window as any).__opened = []; + window.open = (url?: string | URL) => { + (window as any).__opened.push(String(url)); + return null; + }; + }); + await page.getByRole("button", { name: "Launch notebook" }).first().click(); + const dialog = page.getByRole("dialog"); + await expect(dialog.getByRole("radio", { name: "Google Colab" })).toBeChecked(); + await expect(dialog.getByRole("radio", { name: "Private" })).toBeVisible(); + await expect(page).toHaveScreenshot("launch-open.png", { + maxDiffPixelRatio: 0.01, + animations: "disabled", + }); + await dialog.getByRole("button", { name: "Launch Notebook" }).click(); + const opened = await page.evaluate(() => (window as any).__opened); + expect(opened).toHaveLength(1); + expect(opened[0]).toMatch( + /^https:\/\/colab\.research\.google\.com\/github\/QuantEcon\/[\w.-]+\.notebooks\/blob\/main\/notebook\.ipynb$/ + ); + }); });