Skip to content

#10856 – Fix unable to connect two or more monomers to atom in a row - #11075

Merged
AlexeyGirin merged 2 commits into
masterfrom
10856-unable-to-connect-two-or-more-monomers-to-atom-in-a-row
Aug 18, 2026
Merged

#10856 – Fix unable to connect two or more monomers to atom in a row#11075
AlexeyGirin merged 2 commits into
masterfrom
10856-unable-to-connect-two-or-more-monomers-to-atom-in-a-row

Conversation

@la-nuta

@la-nuta la-nuta commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Closes #10856

How the feature works? / How did you fix the issue?

Root cause: After AtomRenderer.update() removed and rebuilt its SVG children, the hover contour (hoverElement) was not recreated. The hover contour is the only hit-testable element for connection detection, so once it was gone any subsequent attempt to connect a monomer to the same atom silently found nothing and failed. Additionally, remove() did not clear the stale hoverElement reference, so show() could not recreate it in the new SVG root.

Fix: In update(), call this.hoverElement = this.appendHover() after clearing the existing elements so the hit target is always present. In remove(), set this.hoverElement = undefined so the stale reference is cleared and show() rebuilds it from scratch in the correct root.

Verification: Opened the macromolecules editor, placed a small molecule atom, connected one monomer to it via R1, then connected a second monomer to the same atom — both connections succeeded and the structure rendered correctly. Confirmed that hover highlighting and single-monomer connections still work normally.

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

@la-nuta
la-nuta force-pushed the 10856-unable-to-connect-two-or-more-monomers-to-atom-in-a-row branch from cccc6f5 to d1313e9 Compare August 10, 2026 12:11
Anna Marfel and others added 2 commits August 12, 2026 17:34
Recreate hover contour after atom update and clear stale ref on remove
so the hit-testable element is always present in the current SVG root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la-nuta
la-nuta force-pushed the 10856-unable-to-connect-two-or-more-monomers-to-atom-in-a-row branch from d1313e9 to 7aa3f3f Compare August 12, 2026 14:34
@AlexeyGirin
AlexeyGirin merged commit ea95487 into master Aug 18, 2026
19 checks passed
@AlexeyGirin
AlexeyGirin deleted the 10856-unable-to-connect-two-or-more-monomers-to-atom-in-a-row branch August 18, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to connect two (or more) monomers to atom in a row

3 participants