Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save/load Multi-tail Arrow to/from ket #5104

Closed
Tracked by #4861
yauhen-karmyzau opened this issue Jul 15, 2024 · 2 comments
Closed
Tracked by #4861

Save/load Multi-tail Arrow to/from ket #5104

yauhen-karmyzau opened this issue Jul 15, 2024 · 2 comments
Assignees
Labels
MMPK Scope for Pathway reactions, View-only mode, Static images, Custom buttons and Ketcher API changes Multi-Tailed Arrow Tool Test Cases Written Test cases has been written for that issue

Comments

@yauhen-karmyzau
Copy link
Collaborator

yauhen-karmyzau commented Jul 15, 2024

As a User, I want to be able to load and save multi-tail arrows to and from KET, so that I can preserve my work and continue working on complex diagrams across multiple sessions.

The arrow should be saved in the following format:

            {
                "type": "multi-tailed-arrow",
                "data": {
                    "head": {
                        "position": { 
                             "x": 12.1806,
                             "y": 10.9876,
                        } 
                    },
                    "spine": {
                        "pos": [ 
                             {
                                 "x": 9.1976,
                                 "y": 8.8159
                             },
                             {
                                 "x": 9.1976,
                                 "y": 14.1234
                             }
                        ] 
                    },
                    "tails": {
                         "pos": [
                            {
                                "x": 7.9901,
                                "y": 8.8159
                            },
                            {
                                "x": 7.9901,
                                "y": 10.5923
                            },
                            {
                                "x": 7.9901,
                                "y": 14.1234
                            }
                         ] 
                    },
                    "zOrder": 0
                }
            }

As multi-tailed arrows can only be aligned horizontally with current implementation, the following invariants apply:

  • X coordinates for all tails should be the same;
  • X coordinate for both spine ends should be the same;
  • Two Y coordinates of the spine ends should be equal to min and max Y coordinates of the tails;

zOrder is not used at the moment and should always be set to 0.
Also "z": 0 coordinate will be in Json as for other elements after X and Y.

Acceptance Criteria:

  1. A user should be able to save a diagram containing a multi-tail arrow to KET. The saved file should accurately represent the state of the diagram, including the position, size, and structure of the multi-tail arrow.
  2. A user should be able to load a diagram containing a multi-tail arrow from a KET file. The loaded diagram should accurately represent the state of the diagram as it was when saved, including the position, size, and structure of the multi-tail arrow.
  3. The application should handle any errors during the loading or saving process gracefully, providing the user with clear error messages and, if possible, guidance on how to resolve the issue.**
  • Load Validations from KET format:
    • X coordinates for all tails should be the same;
    • X coordinate for both spine ends should be the same;
    • Two Y coordinates of the spine ends should be equal to min and max Y coordinates of the tails;
    • Minimal possible sizes for spine - 0.5, tail - 0.4, head - 0.5
    • Head can't be positioned in rounded region of spine 0.15 from both ends
    • Minimal distance between tails - 0.35
  • Save Validation to KET format - TBD
  • Save Validations to not KET Format - OUT OF SCOPE, it will be implemented in scope of Warning or error messages appear when the user tries to save a Multi-Tailed Arrow to inappropriate formats #5338
  1. User can perform basic actions with Multi-Tail Arrows:
  • User can Undo (Ctrl + Z)/Redo (Ctrl + Shift + Z) actions (loading from file, copy/paste) with multi-tails arrows;
  • User can Copy (Ctrl + C)/Cut (Ctrl + X)/Paste (Ctrl + V) multi-tails on the Canvas;
@yauhen-karmyzau yauhen-karmyzau added MMPK Scope for Pathway reactions, View-only mode, Static images, Custom buttons and Ketcher API changes Multi-Tailed Arrow Tool labels Jul 15, 2024
daniil-sloboda added a commit that referenced this issue Aug 13, 2024
daniil-sloboda added a commit that referenced this issue Aug 19, 2024
daniil-sloboda added a commit that referenced this issue Aug 19, 2024
@ivanmaslow ivanmaslow added the Test Cases Written Test cases has been written for that issue label Aug 19, 2024
daniil-sloboda added a commit that referenced this issue Aug 28, 2024
daniil-sloboda added a commit that referenced this issue Aug 28, 2024
daniil-sloboda added a commit that referenced this issue Aug 29, 2024
daniil-sloboda added a commit that referenced this issue Aug 29, 2024
daniil-sloboda added a commit that referenced this issue Aug 30, 2024
daniil-sloboda added a commit that referenced this issue Aug 30, 2024
rrodionov91 pushed a commit that referenced this issue Sep 2, 2024
rrodionov91 pushed a commit that referenced this issue Sep 2, 2024
@ivanmaslow
Copy link
Collaborator

Exploratory testing is completed on RC Remote environment:

  • Ketcher [Version 2.25.0-rc.1] Build at 2024-09-03; 15:37:29
  • Indigo Version 1.24.0-rc.1.0-gb8f099851-x86_64-linux-gnu-11.2.1
  • Windows 11 Enterprise
  • Chrome Version 128.0.6613.120 (Official Build) (64-bit)

The following checks were performed, tests are updated:

  • Single/Several Multi-Tailed Arrows with correct positions and coordinates can be saved/loaded to/from KET file separately or together with chemical elements:
    • Example of Json for default Multi-Tailed arrow:
      image
    • How it looks like after loading on Canvas:
      image
  • Multi-Tailed Arrow can be added to Canvas from the KET file as a new project, by adding to Canvas, from the clipboard;
  • Correct preview of Multi-Tailed on Save/Load of KET file in Json;
  • Loading of corrupted KET file with Multi-Tailed Arrows (wrong fields, wrong coordinates of spine, head, tails)
  • Switching from Micro to Macro and back on Canvas with Multi-Tailed Arrows;
  • Undo/Redo of adding Multi-Tailed Arrow;
  • Zoom actions with Multi-Tailed Arrow on Canvas;

Defects below are detected and fixed:

This defect will be fixed in Ketcher 2.25.0-rc.2:

@ivanmaslow
Copy link
Collaborator

In scope of this task we are going to change validations for minimal sizes - #5761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MMPK Scope for Pathway reactions, View-only mode, Static images, Custom buttons and Ketcher API changes Multi-Tailed Arrow Tool Test Cases Written Test cases has been written for that issue
Projects
None yet
Development

No branches or pull requests

3 participants