Skip to content

Conversation

@kumilingus
Copy link
Contributor

@kumilingus kumilingus commented Jan 29, 2026

Summary

  • Ensure options passed to Graph methods are forwarded to both batch:start and batch:stop events
  • Previously some methods passed options to startBatch but not stopBatch, causing inconsistent event data
  • Methods fixed: clear(), removeCells(), removeCell(), syncCells(), _replaceCell(), transferCellEmbeds(), transferCellConnectedLinks()

Test plan

  • Added tests for all affected methods verifying options are passed to both batch events
  • Run yarn test-client -- --file=test/jointjs/graph.js

🤖 Generated with Claude Code

…sistently

Ensure that options passed to Graph methods are forwarded to both
batch:start and batch:stop events. Previously some methods passed
options to startBatch but not stopBatch, or vice versa.

Methods fixed:
- clear()
- removeCells()
- removeCell()
- syncCells()
- _replaceCell()
- transferCellEmbeds()
- transferCellConnectedLinks()

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an inconsistency in the dia.Graph class where options passed to various methods were not being consistently forwarded to both batch:start and batch:stop events. Previously, some methods only passed options to startBatch but not stopBatch, causing incomplete event data.

Changes:

  • Fixed 7 methods to consistently pass options to both batch events: clear(), removeCells(), removeCell(), syncCells(), _replaceCell(), transferCellEmbeds(), and transferCellConnectedLinks()
  • Added comprehensive test coverage for all affected methods plus existing correctly-implemented methods (addCells() and setDefaultLayer())

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/joint-core/src/dia/Graph.mjs Fixed 7 methods to pass options parameter to both startBatch() and stopBatch() calls consistently
packages/joint-core/test/jointjs/graph.js Added comprehensive test suite with 9 tests verifying options are passed to both batch events for all relevant methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kumilingus kumilingus merged commit e707753 into clientIO:master Jan 30, 2026
9 checks passed
@kumilingus kumilingus deleted the fix/batch-events-options branch January 30, 2026 12:47
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.

2 participants