JS Editor: add missing block coverage Phase 2#5898
Open
zealot-zew wants to merge 1 commit intosugarlabs:masterfrom
Open
JS Editor: add missing block coverage Phase 2#5898zealot-zew wants to merge 1 commit intosugarlabs:masterfrom
zealot-zew wants to merge 1 commit intosugarlabs:masterfrom
Conversation
And Logical "and" operations && Arg Uses values passed into actions actionArgs[n] Boolean True/False toggles true / false Bottom Pos Gets the bottom boundary mouse.BOTTOMPOS Box / Box 1 / Box 2 Variable storage mouse.getBox() / mouse.setBox() Camera Accesses camera properties mouse.CAMERA
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
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.
Summary
This PR significantly enhances the JavaScript Editor by bridging the gap between manual coding and visual blocks. It introduces robust handling for variable names (Boxes) with spaces/punctuation and fully enables "round-trip" support for Action arguments. Most importantly, it restores and wires several essential blocks into the JS export and conversion pipeline.
Newly Supported & Restored Blocks
The following blocks are now fully functional. They generate clean JavaScript and, more importantly, convert back from JS into Blocks accurately:
Logic Blocks:
and/or: Now correctly map to&&and||.boolean: Full support fortrue/falsetoggles.Variable & Argument Blocks:
box,box1,box2: Enhanced to support names with spaces and special characters.arg: Correctly identifies and maps values passed into Actions.System & Position Blocks:
bottompos: Exposed in JS asmouse.BOTTOMPOS.camera: Exposed in JS asmouse.CAMERA.camera: Full integration for camera-related logic.Images:

Previous Work: PR #5834