fix(paper): preserve pending update flags when cell is hidden during updateViewsBatch#3256
Open
Geliogabalus wants to merge 4 commits intoclientIO:masterfrom
Open
fix(paper): preserve pending update flags when cell is hidden during updateViewsBatch#3256Geliogabalus wants to merge 4 commits intoclientIO:masterfrom
Geliogabalus wants to merge 4 commits intoclientIO:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a joint.dia.Paper view-management edge case where scheduled update flags (e.g., translate/transform updates) could be lost when a view becomes hidden during updateViewsBatch, causing stale state when the view is later re-mounted.
Changes:
- Preserve pending view update flags when a mounted view is unmounted due to
cellVisibilityduringupdateViewsBatch. - Add a regression test covering “hide during update → re-mount → ensure transform reflects the latest position”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/joint-core/src/dia/Paper.mjs | Ensures unmounted-queue scheduled flags are merged even when the view transitions from mounted → unmounted during updateViewsBatch. |
| packages/joint-core/test/jointjs/dia/Paper.js | Adds a QUnit test intended to reproduce and prevent the stale-transform regression. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kumilingus
approved these changes
Apr 1, 2026
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.
Summary
updateViewsBatch, thecurrentFlag(e.g. a translate flag) was discarded — onlyFLAG_INSERTwas stored in the unmounted list viaregisterUnmountedViewtransformattribute retained the old position)_mergeUnmountedViewScheduledUpdates(cid, currentFlag)outside theelsebranch so it runs for both the mounted and already-unmounted cases, consistent with how the already-unmounted path already workedTest plan
packages/joint-coretests:cd packages/joint-core && grunt test:server --file=test/jointjs/dia/Paper.js'propagate updates flag when the cell is hidden during the update'— moves a rect to a position that triggers unmount, then re-mounts it and checks thetransformattribute reflects the new position🤖 Generated with Claude Code