From 07e2464228d0cd7b3909204377a2b1680a9f5f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Vogel?= <104342347+cedricvogel-leo@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:11:18 +0100 Subject: [PATCH] Pass the course window's height to the embed (steady height) Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 626e099..abc4bde 100644 --- a/README.md +++ b/README.md @@ -723,6 +723,10 @@ window.__glpythonMount = (args, send) => { const query = new URLSearchParams({ parentOrigin: window.location.origin, mode, lang: language }) if (visualizerMode) query.set("visualizer", visualizerMode) if (featuresOption) query.set("features", requestedFeatures.filter((name) => featureNames.includes(name)).join(",")) + // The course window's height, which the iframe can't see: while + // visualizing, the embed keeps one height (that of the tallest step), at + // most 80% of it - a taller step scrolls inside the visualizer. + query.set("windowHeight", String(window.innerHeight)) if (large) { query.set("size", "large") query.set("visualizerHeight", String(largeVisualizerHeight)) @@ -1080,6 +1084,12 @@ readers. `large` makes the code 20px (line height 1.6) and the visualizer at least 60% of the window, e.g. for the projector in presentation mode. +While stepping through a visualization, the block keeps one height, so the +course page doesn't move: the visualizer is as tall as the tallest step from +the start, and the console as tall as the output at the last step. The +visualizer is at most 80% of the course window; a taller step (e.g. a deep +recursion in «Kasten») scrolls inside it, following the current step. + A course builds its own profiles from these options as macros in its header, passing `@0` on so a block can add more options (a mode or library URLs):