Repository navigation
Embed: fill the iframe, scroll the code inside, report the natural height (P53b) - #61
Open
cedricvogel-leo wants to merge 1 commit into
Open
cedricvogel-leo wants to merge 1 commit into
cedricvogel-leo wants to merge 1 commit into
Conversation
…ight (P53b) The embed no longer caps its visualizer at 80% of a window height measured once at load. It fills its iframe, whose height the parent sets (the LiaScript macro: at most 80% of the course's visible height): a taller step scrolls the visualizer's code area between the step bar and the footer, a taller output the console, and only those give way. glpython:resize reports the content's natural height, also while the iframe is smaller or taller, and whether the visualizer is open (optional field, for "large"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P53b, the editor half. The macro half is glpython-edu/glpython-liascript (separate PR). Merge this one first: it deploys the embed, and the new macro relies on it.
What was wrong
I checked this in the real LiaScript player at 1440×900. The element that scrolls the course is
.lia-slide__container, 772 px visible below LiaScript's 78 px top bar. The embed was 962 px tall:So the stepper and the footer could never be in view together. The P53 footer was inside the capped area; causes 1 and 2 were the real ones.
Change
src/embed/style.css). A taller step scrolls.visualizer-view, between the step bar and the footer, which stay in view. Without the visualizer, a long output scrolls the console. Only those two give way; the bars and the output panel keep their height. ThewindowHeight/visualizerHeightcaps are gone (the parameters are ignored).glpython:resizereports the natural height (naturalHeightinsrc/embed/App.tsx): the root with the code area and the console at their content's height. A clipped embed doesn't stay small, and a stretched one (large) doesn't stay big. It also reportsvisualizing(new optional field, no version bump: old parents ignore it, and the macro treats a missing field as before). The report also watches the content, since the root keeps its size while filling the iframe.demo.htmlcaps the iframe at 80 % of the window, like the macro..embed-app; the protocol type only gains an optional field.Checks
lint(only the knowncursorwarning), both builds,test:protocol,runtime,hints,layout,tree,svg,consoleall pass.test:console:?cap=).cap=720.EOFError(a race in the check).evalandvisual, Run, Tests): the same heights as before (189/377 px, 201 px).🤖 Generated with Claude Code