Skip to content

JS Editor: add missing block coverage Phase 2#5898

Open
zealot-zew wants to merge 1 commit intosugarlabs:masterfrom
zealot-zew:Missing-Blocks-on-JS-editor-2
Open

JS Editor: add missing block coverage Phase 2#5898
zealot-zew wants to merge 1 commit intosugarlabs:masterfrom
zealot-zew:Missing-Blocks-on-JS-editor-2

Conversation

@zealot-zew
Copy link
Contributor

@zealot-zew zealot-zew commented Feb 24, 2026

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 for true / false toggles.

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 as mouse.BOTTOMPOS.
  • camera: Exposed in JS as mouse.CAMERA.
  • camera: Full integration for camera-related logic.

Images:
image

Previous Work: PR #5834

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
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant