Skip to content

Refactor Blockly Interface to V2 Standards - #171

Open
brettfxio wants to merge 2 commits into
mainfrom
refactor-blockly-v2-standards-14956375615490280516
Open

Refactor Blockly Interface to V2 Standards#171
brettfxio wants to merge 2 commits into
mainfrom
refactor-blockly-v2-standards-14956375615490280516

Conversation

@brettfxio

Copy link
Copy Markdown
Contributor

This PR refactors the current Blockly implementation to clean up the interface to our 3D engine.

Key changes include:

  1. Value-returning creation blocks: All blocks that create objects (Ground, Box, Sphere, Light, Camera, Audio, UI, Particles) now return a reference instead of using an internal variable field. This allows users to use Blockly's native variable system (e.g., set myBox to create box).
  2. Polymorphic blocks: Consolidated separate blocks for boxes, spheres, etc., into a single create_primitive block and a single create_light block with dropdown selection.
  3. Engine Modernization: Updated BabylonSceneManager to accept these references in all transformation and property-setting methods.
  4. ID Standardization: Internally, all engine objects now use a standardized unique ID (prefixed with id_), while the user interaction remains abstract via variables.
  5. Toolbox Reorganization: Cleaned up the toolbox into intuitive categories: Essentials, Create, Transform, World, Events, UI, Audio.
  6. Demo Workspace: Included _workspaces/v2-standards-demo.md to showcase the new standards in action.
  7. Test Improvements: Updated tests/critical.spec.js and exposed global APIs to ensure automated tests are more robust against UI overlays and asynchronous loading.

PR created automatically by Jules for task 14956375615490280516 started by @brettfxio

- Implement Value-Block-First architecture for object creation.
- Consolidate Primitives and Lights into polymorphic blocks with dropdowns.
- Update BabylonSceneManager to support direct object references.
- Standardize ID generation using 'id_' prefix and random UIDs.
- Reorganize Toolbox into functional categories.
- Add V2 Standards Demo workspace.
- Define ORDER_AWAIT and ORDER_FUNCTION_CALL for reliable code generation.
- Add intensity support to createLight and create_light block.
- Refactor Assets, Particles, and UI blocks to return references.
- Update Playwright tests with robust initialization logic.

Co-authored-by: brettfxio <105930054+brettfxio@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Implement Value-Block-First architecture for object creation.
- Consolidate Primitives and Lights into polymorphic blocks with dropdowns.
- Update BabylonSceneManager to support direct object references and intensity for lights.
- Standardize ID generation using 'id_' prefix and random UIDs for all creation blocks.
- Reorganize Toolbox into functional categories (Essentials, Create, Transform, World, Events, UI, Audio).
- Remove standard 'text' block to enforce asset/variable usage for strings.
- Add V2 Standards Demo workspace at `_workspaces/v2-standards-demo.md`.
- Define ORDER_AWAIT and ORDER_FUNCTION_CALL for reliable code generation.
- Refactor Assets, Particles, and UI blocks to return references.
- Update Playwright tests (critical and collision) with robust initialization logic and new block types.

Co-authored-by: brettfxio <105930054+brettfxio@users.noreply.github.com>
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