Skip to content

#5225 After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas#8915

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-idt-tooltip-alias
Closed

#5225 After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas#8915
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-idt-tooltip-alias

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 15, 2025

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

When pasting IDT format from clipboard, the server converts it to KET. The returned KET templates lack library-specific properties like idtAliases, causing preview tooltips to show nothing while library-added monomers work correctly.

Solution: Enrich KET templates with library data during deserialization.

Added two functions in monomerToDrawingEntity.ts:

  • getLibraryMonomerTemplate() - Looks up library template by ID/alias
  • enrichTemplateWithLibraryData() - Merges library properties (idtAliases, aliasHELM, etc.) into KET template

Modified templateToMonomerProps() to call enrichment before extracting properties:

export function templateToMonomerProps(template: IKetMonomerTemplate) {
  // Enrich the template with library data before extracting props
  const enrichedTemplate = enrichTemplateWithLibraryData(template);
  
  return {
    // ... properties now include idtAliases from library
    idtAliases: enrichedTemplate.idtAliases,
    // ...
  };
}

Now pasted monomers inherit idtAliases from library templates, making tooltips consistent across both paste and library workflows.

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
Original prompt

This section details on the original issue you should resolve

<issue_title>After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas</issue_title>
<issue_description>Case 1:
Steps to Reproduce

  1. Go to Macromolecules mode.
  2. Click on the “A” (layout switch) button in the top panel.
Image
  1. Then click the “Flex layout” button(the branching icon).
Image
  1. Clear Canvas.
  2. Click on Open Structure.
Image
  1. Choose Paste From Clipboard.
  2. Click on "Ket"
Image
  1. Choose IDT from the dropdown menu and input: /55HydMe-dC/.
Image
  1. Hover mouse over nucleotide to get preview tooltip on main screen.

Case 2:
Steps to Reproduce

  1. Go to Macromolecules mode.
  2. Click on the “A” (layout switch) button in the top panel.
Image
  1. Then click the “Flex layout” button(the branching icon).
Image
  1. Clear Canvas.
  2. Click on Open Structure.
Image
  1. Choose Paste From Clipboard.
  2. Click on "Ket"
  3. Choose IDT from the dropdown menu and input: /3ThioMC3-D/Image
  4. Hover mouse over CHEM SS3 to get preview tooltip on main screen

Actual behavior
After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas. But when we select same monomer from library and add it to canvas IDT alias is shown.
2024-08-07_11h08_08

image

Expected behavior
After pasting from the clipboard, the IDT preview tooltip show the IDT alias on the canvas
2024-08-07_11h22_38

image

Desktop:

  • OS: Windows 11
  • Browser Chrome
  • Version 124.0.6367.79 (Official Build) (64-bit) and (127.0.6533.122) x 64

Ketcher version
[Version 2.24.0-rc.1]
Indigo version
[Version 1.23.0-rc.1]

Additional context
Bug found when testing:
#4880
#5078
#4926</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 15, 2025 10:34
Co-authored-by: NikitaKuzminn <87386879+NikitaKuzminn@users.noreply.github.com>
Co-authored-by: NikitaKuzminn <87386879+NikitaKuzminn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix IDT preview tooltip alias in Macromolecules mode Fix IDT alias not showing in preview tooltip after clipboard paste Dec 15, 2025
Copilot AI requested a review from NikitaKuzminn December 15, 2025 10:45
@AlexeyGirin AlexeyGirin closed this Jan 5, 2026
@AlexeyGirin AlexeyGirin reopened this Jan 5, 2026
@AlexeyGirin AlexeyGirin marked this pull request as ready for review January 5, 2026 17:12
@AlexeyGirin AlexeyGirin requested review from rrodionov91 and removed request for NataliaLoginova, NikitaKuzminn, Zhirnoff and svvald January 5, 2026 17:13
@AlexeyGirin AlexeyGirin changed the title Fix IDT alias not showing in preview tooltip after clipboard paste #5225 After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas Jan 13, 2026
@AlexeyGirin
Copy link
Copy Markdown
Collaborator

Problem on indigo side

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.

After pasting from the clipboard, the IDT preview tooltip does not show the IDT alias on the canvas

3 participants