feat: bidirectional-sync - #18
Open
ericgozzi wants to merge 4 commits into
Open
Conversation
… edit Mirrors frontend edits back to the backend's live COMPAS objects instead of only receiving updates from it: - Transform gizmo drag/rotate on a picked object now sends the world-space delta to the backend on release (dispatch: object_transform), computed against the object's matrix as of drag-start so it's correct regardless of whether the frontend's placement convention for that object is identity or absolute. Also guards against a continuously self-animating object (e.g. a spinning torus) rebuilding the mesh out from under an active drag. - New "Add object" toolbar control (AddObjectButton.vue) sends create_geometry for Box/Sphere/Point, spawned at the camera's current orbit target. - New "Material" toolbar control (MaterialButton.vue) streams color/ metalness/roughness edits (material_edit) for the picked object, with local instant preview. - New reactive store field pickedObjectGuid, since nothing previously exposed the current pick selection to Vue components. Requires the paired compas_threejs backend changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Explains the transform-gizmo delta math, the two bugs found and fixed while building it (wrong matrix convention, a spinning object fighting its own drag), the new create_geometry/material_edit UI, and the new pickedObjectGuid store field, for a future agent to pick up without re-deriving it. Pairs with the equivalent doc in the compas_threejs backend repo. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ericgozzi
marked this pull request as ready for review
August 19, 2026 13:08
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.
This pull request introduces a new "Objects" toolbar group in the UI, enabling users to add new geometry (box, sphere, point) and edit object materials (color, metalness, roughness) directly from the frontend. These actions now send messages to the backend to mutate live Python objects, making the viewer bidirectional for object creation and material editing. The implementation includes new UI components, supporting methods in
ViewerRuntime, and documentation.UI Enhancements:
AddObjectGroupto the main toolbar, grouping the newAddObjectButtonandMaterialButtonfor object creation and material editing. (Toolbar.vue,AddObjectGroup.vue,index.ts) [1] [2] [3]AddObjectButton.vue: a popover UI to select geometry type and parameters, callingcreateGeometry()on add. (AddObjectButton.vue)MaterialButton.vue: a popover UI for editing the selected object's color, metalness, and roughness, disabled unless an object is picked. (MaterialButton.vue)Bidirectional Backend Communication:
createGeometry(type, params)toViewerRuntime, sending acreate_geometrymessage to the backend to create new objects at the camera's target. (viewer_runtime.ts)getMaterialSnapshot(guid)andsetMaterial(guid, fields)to read and update material properties both locally and on the backend viamaterial_editmessages. (viewer_runtime.ts)viewer_runtime.ts) [1] [2]Documentation:
BIDIRECTIONAL_SYNC.mdexplaining the new bidirectional sync architecture, message formats, and UI integration. (BIDIRECTIONAL_SYNC.md)Checklist
npm run checkis green (formatting, lint, types, unit tests, both builds).npm run test:browserandnpm run test:packagepass.