Use pre-fixed jigsaw_v2 HTML and expand test coverage#385
Merged
blink1073 merged 2 commits intoCalysto:mainfrom Mar 15, 2026
Merged
Use pre-fixed jigsaw_v2 HTML and expand test coverage#385blink1073 merged 2 commits intoCalysto:mainfrom
blink1073 merged 2 commits intoCalysto:mainfrom
Conversation
Moves the cross-origin postMessage fixes out of the magic and into the upstream HTML files (calysto.github.io/jigsaw_v2), so no runtime patching is needed. Expands tests to cover all three languages and write to tmp_path.
Use pathlib.Path (not pytest.TempPathFactory) for tmp_path fixture annotation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #385 +/- ##
==========================================
- Coverage 90.86% 90.79% -0.08%
==========================================
Files 51 51
Lines 2957 2943 -14
Branches 414 414
==========================================
- Hits 2687 2672 -15
Misses 190 190
- Partials 80 81 +1
🚀 New features to boost your workflow:
|
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.
References
Follow up to #375
Description
Moves the cross-origin postMessage fixes out of
jigsaw_magic.pyand into the upstream HTML source files (now served fromcalysto.github.io/jigsaw_v2/). The magic no longer needs to patch downloaded HTML at runtime — it only fills in thewindow.__jigsaw_saved_xml__placeholder that is already baked into the v2 files.Changes
_fix_cross_origin()function fromjigsaw_magic.py(~127 lines)jigsaw/tojigsaw_v2/_fix_cross_origin()call with a single targeted string replacement for the saved-XML placeholderscripts/reproduce_196.py(referenced the now-removed function)Processing,Python,Testtest_jigsaw_html_contentto assert postMessage helpers are present and nowindow.parentproperty assignments remaintmp_path(no files written to the repo directory)teardown()functionBackwards-incompatible changes
None
Testing
just test tests/magics/test_jigsaw_magic.py— 10/10 tests pass across all three languages.AI usage