Skip to content

Fix Rule Builder Node Transformation Reactivity#169

Open
Sendipad wants to merge 2 commits into
developfrom
fix-loop-node-action-creation-7133967333703839786
Open

Fix Rule Builder Node Transformation Reactivity#169
Sendipad wants to merge 2 commits into
developfrom
fix-loop-node-action-creation-7133967333703839786

Conversation

@Sendipad

Copy link
Copy Markdown
Owner

Fixed a critical bug where adding an action node within a Loop (or other scaffolded contexts) failed to transform from a placeholder to the selected action type.

Key technical improvements:

  1. Atomic State Updates: Switched from Array.prototype.splice and in-place property mutations to an atomic .map() reassignment for the nodes array in the Pinia store. This ensures that Vue 3's reactivity system and Vue Flow's internal watchers correctly detect and propagate the structural change of the node.
  2. Improved Entropy: Updated generateShortId to produce 8-character IDs instead of 4. This significantly reduces the risk of ID collisions when the builder programmatically scaffolds multiple nodes simultaneously (e.g., during Loop body creation).
  3. Robust Terminal Handling: Integrated terminal action logic (like clearing downstream connections) directly into the new node object's initialization, ensuring consistent graph state during the transformation process.

PR created automatically by Jules for task 7133967333703839786 started by @Sendipad

- Replaced deep mutation with atomic `.map()` update in `ActionZone.vue` to ensure Vue 3 reactivity correctly triggers on node type changes.
- Increased node ID length from 4 to 8 characters in `schema_utils.js` to prevent collisions during rapid scaffolding.
- Ensured terminal action cleanup is applied atomically during node upgrade.
@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.

- Fixed issue where scaffolded placeholder nodes (e.g., inside Loop body) failed to transform into real actions upon clicking 'Create'.
- Replaced deep object mutation with atomic `store.nodes.splice` in `ActionZone.vue` to ensure Pinia and Vue Flow correctly detect the type transformation.
- Increased node ID length from 4 to 8 characters in `schema_utils.js` to reduce collision risks during rapid node scaffolding.
- Added `upgrade_selector_node` utility to `useGraphStore` for future programmatic node transformations.
- Ensured terminal action cleanup (removing outgoing edges) is applied correctly during transformation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant