Repository navigation
fix(connectors.jumpover): redraw jumps after an async paper renders the batch - #3633
Merged
Geliogabalus merged 10 commits intoDec 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The connector’s completion logic misses unmount-only and silent renders, leaving _jumpOverPending set and jumps stale or missing; both cases need a reliable completion mechanism and regression tests.
1 open issue
What changed in this PR
This PR addresses #3612 by correcting jumpover connector redraw timing on async papers and avoiding creation of hidden link views.
Changes:
- Defer jump calculations until scheduled rendering completes, drawing affected links without jumps in the meantime.
- Look up existing link views without initializing hidden ones.
- Add async-rendering regression tests and patch changesets for both fixes.
| File | Description |
|---|---|
packages/joint-core/test/jointjs/connectors.js |
Adds tests for updated crossings and hidden link views. |
packages/joint-core/src/connectors/jumpover.mjs |
Defers jump redraws and uses non-creating view lookups. |
.changeset/jumpover-hidden-link-views.md |
Documents the hidden-view fix. |
.changeset/jumpover-async-batch.md |
Documents the async batch crossing fix. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The auxiliary updater is not disposed during paper teardown, retaining the paper, graph, and detached DOM, while a reset can discard its queued update and leave replacement links permanently without jumps until another batch ends.
2 open issues
1 resolved since last review
Review effort: Balanced
…ate is scheduled, clear it on reset
…ates after the links
kumilingus
marked this pull request as draft
December 1, 2026 18:18
Geliogabalus
reviewed
Dec 2, 2026
Geliogabalus
requested changes
Dec 2, 2026
…the links The updater requests the connector updates of the links with a priority after its own, and dia.Paper reads the priorities again after each one, so updateViews() of a frozen paper draws the jumps and render:done is triggered once per batch. The paper does not mount the objects that are not views and does not pass them to onViewUpdate().
Geliogabalus
approved these changes
Dec 2, 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
With an async paper, the
jumpoverconnector drew jumps at the old crossings of links changed in a batch. With lazy view management, it also created views for links that are not visible.batch:stop, the connector requests aCONNECTORupdate of every jumpover link. On an async paper, the links still have their updates scheduled, so the flag is merged into them and each link is updated once, in the order its update was scheduled. A link updated before another one read that link's old route. Now, on an async paper, the connector requests an update of an object that the paper updates after the links (dia.Papernow also updates objects that are not views, marked with an internal symbol and implementingconfirmUpdate(); internal for now, see dia.Paper: run a function once the scheduled updates are done #3636). The paper does not mount these objects and does not pass them toonViewUpdate(). Until it is updated, the links are drawn without jumps. Then it requests the connector updates of the links with a priority after its own, so the jumps are drawn in the same update, once the routes of all the links are known. It runs with the paper's update loop: not while the paper is frozen, withupdateViews(), also when the paper renders silently, and also after a batch that only hides links.dia.Paperread the priorities of the scheduled updates once per update, so the views requested during an update with a priority that had no updates before were updated only in the next one (andupdateViews()left them scheduled). The priorities are now read again after each one.paper.findViewByModel(), which turns the placeholders of links outside the viewport into views. They are now looked up withpaper.getCellView(), so a link without a view has no lines to jump over.Tradeoff: on an async paper, the links changed in a batch are updated twice in the same update (the route, then the jumps). A chain of links connected to other links can be updated after the jumps are computed, and such links may still be drawn with jumps at old crossings.
Test plan
test/jointjs/connectors.js(jumpover connector>async paper):jumps are drawn at the crossings of the links changed in a batch: the example from connectors.jumpover: jumps drawn at outdated crossings with an async paper #3612; the jump at the new crossing after the firstrender:done, which is triggered once; only the link views are mounted.updateViews() of a frozen paper draws the jumps: no updates are left.onViewUpdate() is called for views only.no views are created for the links that are not visible: lazy view management with hidden links before the visible ones.a frozen paper draws the jumps once it is unfrozen.the jumps are drawn when the paper renders silently.the jumps are redrawn after a batch that only hides a link.the jumps are drawn after a reset that drops the scheduled update.y = 100) and so does the hidden link views test (views created for the hidden links).npx grunt shell:rollup-test-bundle karma:joint: 2256 passed.npx eslinton the changed files: clean.Fixes #3612