Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Oct 6, 2025

Summary

Fixes issue where node size changes are not serialized by routing DOM-driven node bounds updates through a single CRDT operation so Vue node geometry stays synchronized with LiteGraph.

Changes

  • What: Added BatchUpdateBoundsOperation to the layout store, applied it via the existing Yjs pipeline, notified link sync to recompute touched nodes, and covered the path with a regression test

Review Focus

Correctness of the new batch operation when multiple nodes update simultaneously, especially remote replay/undo scenarios and link geometry recomputation.

┆Issue is synchronized with this Notion page by Unito

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

🎭 Playwright Test Results

Some tests failed

⏰ Completed at: 10/11/2025, 03:00:16 AM UTC

📈 Summary

  • Total Tests: 476
  • Passed: 426 ✅
  • Failed: 17 ❌
  • Flaky: 3 ⚠️
  • Skipped: 30 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 419 / ❌ 16 / ⚠️ 3 / ⏭️ 30
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 1 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 10/11/2025, 02:42:09 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@christian-byrne christian-byrne force-pushed the vue-node/fix-layout-mutation branch from 5f682ef to 1a14c1c Compare October 7, 2025 17:46
@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Oct 7, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive PR Review

This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.

Review Summary

PR: fix: emit layout change for batch node bounds (#5939)
Impact: 113 additions, 16 deletions across 4 files

Issue Distribution

  • Critical: 0
  • High: 0
  • Medium: 3
  • Low: 3

Category Breakdown

  • Architecture: 0 issues
  • Security: 0 issues
  • Performance: 2 issues
  • Code Quality: 4 issues

Key Findings

Architecture & Design

The implementation follows good CRDT patterns by routing DOM-driven node bounds updates through a single operation type. The new BatchUpdateBoundsOperation properly integrates with the existing Yjs-based layout store architecture and maintains consistency with other operation handlers.

Security Considerations

No security issues identified. The implementation properly validates node existence and doesn't expose any attack vectors.

Performance Impact

Two performance considerations:

  1. Spatial index updates in loops may cause performance degradation for large batch operations
  2. Storing previousBounds increases memory footprint during batch operations

Integration Points

The integration with useLinkLayoutSync correctly handles link recomputation for updated nodes. The test coverage adequately validates the new functionality.

Positive Observations

  • Good separation of concerns with dedicated operation type
  • Proper integration with existing CRDT pipeline
  • Comprehensive test coverage for the new functionality
  • Consistent error handling patterns with existing codebase
  • Clean type definitions for the new operation

Next Steps

  1. Address medium priority quality issues (null checks, type safety)
  2. Consider performance optimizations for large batch operations
  3. Replace arbitrary timeout in test with proper synchronization
  4. Validate OperationMeta interface usage in type definitions

This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.

@christian-byrne christian-byrne force-pushed the vue-node/fix-layout-mutation branch from 0f18640 to 5650ccb Compare October 8, 2025 02:52
@christian-byrne christian-byrne marked this pull request as ready for review October 8, 2025 02:52
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 8, 2025
@christian-byrne christian-byrne force-pushed the vue-node/fix-layout-mutation branch 3 times, most recently from bad2ec6 to 24d1d03 Compare October 9, 2025 20:31
DrJKL
DrJKL previously approved these changes Oct 10, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you said there was an issue you're still looking into, but I want this.

width: data.bounds.width,
height: data.bounds.height
})
ynode.set('bounds', data.bounds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still hate that these are separate properties

* More efficient than calling update() multiple times as it only invalidates cache once
*/
batchUpdate(updates: Array<{ nodeId: NodeId; bounds: Bounds }>): void {
for (const { nodeId, bounds } of updates) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really count as a batch if you do it for each item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batching because we don't rebuild the tree until after.

}
resize(screenSize)
// Set initial DOM size from layout store, but respect intrinsic content minimum
if (size.value && nodeContainerRef.value && transformState) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: guard clause?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But also, what happens if this boat gets missed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean exactly?

Comment on lines +16 to +33
const originalWidth = element.style.width
const originalHeight = element.style.height

// Temporarily set to auto to measure natural content size
element.style.width = 'auto'
element.style.height = 'auto'

const intrinsicRect = element.getBoundingClientRect()

// Restore original size
element.style.width = originalWidth
element.style.height = originalHeight

// Convert from screen coordinates to canvas coordinates
return {
width: intrinsicRect.width / scale,
height: intrinsicRect.height / scale
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's got to be a better way...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is used in multiple places and this PR centralizes so this is the shared location - so if we find a better way it will be very easy to swap implementations later.

@DrJKL DrJKL force-pushed the vue-node/fix-layout-mutation branch from 24d1d03 to fda0cb2 Compare October 10, 2025 05:37
@DrJKL
Copy link
Contributor

DrJKL commented Oct 10, 2025

/update-playwright

@github-actions
Copy link

Updating Playwright Expectations

@christian-byrne christian-byrne force-pushed the vue-node/fix-layout-mutation branch from fda0cb2 to 318a194 Compare October 11, 2025 02:40
@christian-byrne christian-byrne added the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 11, 2025
@github-actions github-actions bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 11, 2025
@christian-byrne christian-byrne merged commit e6534f1 into main Oct 11, 2025
2 checks passed
@christian-byrne christian-byrne deleted the vue-node/fix-layout-mutation branch October 11, 2025 03:47
arjansingh pushed a commit that referenced this pull request Oct 12, 2025
## Summary

Fixes issue where node size changes are not serialized by routing
DOM-driven node bounds updates through a single CRDT operation so Vue
node geometry stays synchronized with LiteGraph.

## Changes

- **What**: Added `BatchUpdateBoundsOperation` to the layout store,
applied it via the existing Yjs pipeline, notified link sync to
recompute touched nodes, and covered the path with a regression test

## Review Focus

Correctness of the new batch operation when multiple nodes update
simultaneously, especially remote replay/undo scenarios and link
geometry recomputation.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5939-fix-emit-layout-change-for-batch-node-bounds-2846d73d365081db8f8cca5bf7b85308)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <[email protected]>
arjansingh pushed a commit that referenced this pull request Oct 13, 2025
## Summary

Fixes issue where node size changes are not serialized by routing
DOM-driven node bounds updates through a single CRDT operation so Vue
node geometry stays synchronized with LiteGraph.

## Changes

- **What**: Added `BatchUpdateBoundsOperation` to the layout store,
applied it via the existing Yjs pipeline, notified link sync to
recompute touched nodes, and covered the path with a regression test

## Review Focus

Correctness of the new batch operation when multiple nodes update
simultaneously, especially remote replay/undo scenarios and link
geometry recomputation.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5939-fix-emit-layout-change-for-batch-node-bounds-2846d73d365081db8f8cca5bf7b85308)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <[email protected]>
@arjansingh arjansingh mentioned this pull request Oct 14, 2025
arjansingh added a commit that referenced this pull request Oct 14, 2025
## What's Changed

### 🚀 Features
- Add MediaAssetCard presentation components (#5878)
- Make Vue nodes' outputs/previews responsively sized and work with node
resizing (#5970)
- Allow connection to subgraphIOs in vue mode (#6016)
- Add distribution detection pattern (#6028)
- Make nodeData.widgets reactive (#6019)

### 🐛 Bug Fixes
- Fix FLOAT widget incrementing broken & disabled state styles on widget
number input (Vue) (#6036)
- Fix Vue node border styles in different states (executing, error,
selected) (#6018)
- Fix Vue node opacity conditions (user node opacity, bypass state,
muted state) (#6022)
- Fix: emit layout change for batch node bounds (#5939)
- Safer restoration of widgets_values on subgraph nodes (#6015)
- Fix(execution): reset progress state after runs to unfreeze tab
title/favicon (main) (#6026)
- Use type check instead of cast (#6041)

### 🎨 Style & Design
- [style] match widget border/outline styles with designs (#6021)
- [style] make Vue widget/slot/label width and spacing align with
designs (#6023)

### ♿ Accessibility
- Add aria labels on vue node widgets (#6032)

### 🔧 Maintenance
- [refactor] adjust Vue node fixtures to not be coupled to Litegraph
(#6033)
- [refactor] reorganize devtools test nodes into modules (#6020)

### 🧪 Testing
- [test] add browser test for control+a selection of Vue nodes (#6031)

### 🔄 CI/CD
- [ci] fix update locales workflow (#6017)

**Full Changelog**:
v1.29.1...v1.29.2

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6045-1-29-2-28c6d73d3650817a8c36fba944ce69a8)
by [Unito](https://www.unito.io)

---------

Co-authored-by: arjansingh <[email protected]>
Co-authored-by: github-actions <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:vue-migration claude-review Add to trigger a PR code review from Claude Code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants