Repository navigation
P17: «In IDE öffnen ▾» – open the block as a copy in the IDE - #18
Merged
Merged
Conversation
A split button in the button row (feature "ide", on by default) opens the block's current program - every file, its libraries and the file that runs - as a copy in the glpython IDE in a new tab, as an IDE share link. Its ▾ menu copies that link («IDE-Link kopieren» → «Link kopiert ✓»), or shows it in a field to copy by hand where the clipboard isn't available. The link is built and copied within the tap's own handler, as iPad Safari requires, with lz-string 1.5.0 (the IDE's) loaded once per page in advance. A link longer than GitHub Pages accepts (8192 characters of path and query) carries the project in the fragment. check-macro.mjs now also flags "@<digit>" right after a letter, digit or "-./": LiaScript replaces it with a macro argument even inside a URL, as it did with ".../lz-string@1.5.0/...". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Package P17: learners can hand in a solution without copying code.
What learners see. A new split button at the end of the button row:
language: en: «Open in IDE», «Copy IDE link», «Link copied ✓».The link. It is the IDE's share-link format:
?project=+ lz-string-compressed{v: 1, name, mainFile, files}.mainFile.iPad Safari. The link is built and copied synchronously inside the tap's own handler (
writeText, andwindow.openfor the tab). That's why lz-string 1.5.0 (the IDE's version, SRI-pinned, from jsDelivr) is loaded once per page in advance. The button stays disabled until it has loaded.Length limit. GitHub Pages answers
414above 8192 characters of path and query. That's a program of roughly 5,000–30,000 characters, depending on how well it compresses. A longer link carries the project in#project=instead, which isn't sent to the server. This needs glpython-edu/glpython-edu.github.io#14, which teaches the IDE to read the fragment. Merge that first. Links that fit keep?project=and work with the IDE as deployed today.features=. A new value,ide. It's on withoutfeatures=, and hidden invisualblocks. The README andexamples/profiles.mdadd it to erkunden and rezept, as the course will.A bug found on the way. LiaScript replaced the
@1in…/lz-string@1.5.0/…with the macro's argument (eval), so the script URL becamelz-stringeval.5.0. The URL now uses@, andcheck-macro.mjsnow flags@<digit>glued to a word ([\w.\/-]@[0-9]). Real placeholders always stand on their own, and nothing else in the macro matches.Tested in the hosted LiaScript player (this macro served locally), each link opened in a fresh browser profile and run:
?project=link, runs:Quadrat: 49helfer.py+main.py+test.py,main.pychosen in ▶ ▾Doppelt: 42features=run,reset#project=(as?project=: HTTP 414); runs with #14's IDE:Funktionen: 400 36writeTextrejects / no clipboard APIlanguage: ennode scripts/check-macro.mjspasses. iPad Safari itself I couldn't test (no device); the code follows its rule (copy and open inside the tap handler).🤖 Generated with Claude Code