Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"makefile.configureOnOpen": false
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<n>/` with a sticky link comment and teardown on close. Self-contained on `GITHUB_TOKEN` — no external preview service.

Expand Down
10 changes: 8 additions & 2 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion app/components/toolbar/LaunchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function LaunchPanel() {
export function LaunchButton({ size, showLabel }: { size: number; showLabel?: boolean }) {
return (
<Popover.Root>
<Popover.Trigger className="flex items-center cursor-pointer">
<Popover.Trigger aria-label="Launch notebook" className="flex items-center cursor-pointer">
<Tooltip label="Launch Notebook">
<CirclePlay
className="opacity-90 hover:scale-110"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions tests/visual/theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,39 @@ test.describe("QuantEcon theme — visual regression", () => {
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",
});
Comment thread
mmcky marked this conversation as resolved.
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$/
);
});
});
Loading