Skip to content

fix(joint-react): do not hide links connected to other links - #3478

Merged
zbynekstara merged 2 commits into
clientIO:masterfrom
kumilingus:fix/react-link-to-link-visibility
Aug 24, 2026
Merged

fix(joint-react): do not hide links connected to other links#3478
zbynekstara merged 2 commits into
clientIO:masterfrom
kumilingus:fix/react-link-to-link-visibility

Conversation

@kumilingus

Copy link
Copy Markdown
Contributor

Problem

The react paper hides a freshly inserted link view (visibility: hidden) until its end views are "ready" — portal-rendered elements are empty until their React content mounts, so a link pointing at them would otherwise dangle in the void.

The readiness check (isLinkEndReady → isElementReady → getElementView(id)) only ever resolves the end id among elements. When a link's end is another link (e.g. a BPMN annotation attached to a flow), the end never becomes ready and the link stays hidden forever — checkPendingLinks re-checks with the same test on every element insert, so it never recovers.

Fix

A link end never needs to be waited for — only elements render asynchronously. isLinkEndReady now returns true when the end cell is a link.

Elements without portals are unaffected (already handled per view by isElementReady — a view with no portal node is ready), so mixed portal/portal-less diagrams keep working.

Tests

  • link connected to another link is not hidden
  • a chain of link-to-link connections is not hidden
  • links between portal-less elements are not hidden

🤖 Generated with Claude Code

The paper hides a freshly inserted link view until its end views are
'ready' (portal-rendered elements are empty until their React content
mounts). The readiness check resolved the end id via getElementView()
only, so an end pointing at another link never became ready and the link
stayed hidden forever.

Only elements can render asynchronously — a link end never needs to be
waited for.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 a Joint React PaperView issue where links whose source/target is another link could remain permanently hidden because the “link-end readiness” logic only considered elements as valid end targets. The change aligns the readiness check with actual async rendering behavior (only elements can be portal-delayed) and adds coverage to prevent regressions.

Changes:

  • Treat link ends that reference a link cell as immediately “ready” (do not hide the newly inserted link view).
  • Add Jest tests covering link-to-link endpoints, chained link-to-link endpoints, and portal-less element scenarios.
  • Add a patch changeset for @joint/react.

Reviewed changes

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

File Description
packages/joint-react/src/mvc/paper.ts Updates isLinkEndReady to return ready when the end cell is a link, preventing permanent hiding for link-to-link connections.
packages/joint-react/src/mvc/tests/paper-portal-selector.test.ts Adds regression tests ensuring link-to-link and portal-less link scenarios are not hidden.
.changeset/light-moons-wonder.md Publishes the fix as a patch release for @joint/react.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/joint-react/src/mvc/paper.ts Outdated
@zbynekstara
zbynekstara merged commit 22422ef into clientIO:master Aug 24, 2026
3 checks passed
kumilingus added a commit to clientIO/joint-demos that referenced this pull request Aug 24, 2026
Aligns all @joint/* dependencies at 4.3.2 (a version mismatch duplicates
@joint/plus and breaks class identity, e.g. the Selection frames value)
and removes the render:done workaround for link-to-link visibility —
fixed upstream in clientIO/joint#3478.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kumilingus added a commit to clientIO/joint-demos that referenced this pull request Aug 24, 2026
The release contains the link-to-link visibility fix (clientIO/joint#3478),
so the render:done unhide workaround is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

4 participants