diff --git a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-1-chromium-linux.png index 723eed1edb..5ff4121f19 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-2-chromium-linux.png index 1088f1fbff..99c1c8eb71 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-2-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-3-chromium-linux.png index acefc698fd..9b62640aa6 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-3-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Copy-paste-selection-with-LClick-drag-and-undo-3-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--68b8f-owLeft-then-paste-ket-from-clipboard-and-undo-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--68b8f-owLeft-then-paste-ket-from-clipboard-and-undo-1-chromium-linux.png index 207469f7a4..b1a95e8c44 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--68b8f-owLeft-then-paste-ket-from-clipboard-and-undo-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--68b8f-owLeft-then-paste-ket-from-clipboard-and-undo-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--fad51-owLeft-then-paste-ket-from-clipboard-and-undo-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--fad51-owLeft-then-paste-ket-from-clipboard-and-undo-2-chromium-linux.png index 207469f7a4..b1a95e8c44 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--fad51-owLeft-then-paste-ket-from-clipboard-and-undo-2-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Copy-And-Paste/sequence-mode-copy-paste.spec.ts-snapshots/Sequence-mode-copy-paste-for-edit-mode-Select--fad51-owLeft-then-paste-ket-from-clipboard-and-undo-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts index 61cb2a7d75..c0a0de0a94 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts @@ -17,6 +17,7 @@ import { clickOnCanvas, selectZoomInTool, selectZoomOutTool, + moveMouseAway, } from '@utils'; import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; import { @@ -100,10 +101,12 @@ test.describe('Sequence mode selection for edit mode', () => { await page.keyboard.press('ArrowRight'); } await page.keyboard.up('Shift'); + await moveMouseAway(page); await takeEditorScreenshot(page); await selectFlexLayoutModeTool(page); await selectSequenceLayoutModeTool(page); + await takeEditorScreenshot(page); }); @@ -116,6 +119,7 @@ test.describe('Sequence mode selection for edit mode', () => { await page.keyboard.press('ArrowLeft'); } await page.keyboard.up('Shift'); + await moveMouseAway(page); await takeEditorScreenshot(page); await page.keyboard.press('Backspace'); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-1-chromium-linux.png index 341978ecc9..5e3b451097 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-2-chromium-linux.png index 4cd9a42237..ae352fce71 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-2-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-LClick-drag-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-1-chromium-linux.png index 665d4fe96f..9657a66ce8 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-2-chromium-linux.png index f63a5867c1..204226ec47 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-2-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-3-chromium-linux.png index 94a9e4c01a..775c917d65 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-3-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-3-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-4-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-4-chromium-linux.png index 8aeb537ab4..61b9b27aa2 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-4-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowLeft-then-delete-and-undo-4-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowRight-button-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowRight-button-1-chromium-linux.png index 745fa51dbb..62e023c538 100644 Binary files a/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowRight-button-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-selection.spec.ts-snapshots/Sequence-mode-selection-for-edit-mode-Select-letters-with-Shift-ArrowRight-button-1-chromium-linux.png differ diff --git a/packages/ketcher-core/src/application/editor/modes/SequenceMode.ts b/packages/ketcher-core/src/application/editor/modes/SequenceMode.ts index 0e523082f5..00a450bb1a 100644 --- a/packages/ketcher-core/src/application/editor/modes/SequenceMode.ts +++ b/packages/ketcher-core/src/application/editor/modes/SequenceMode.ts @@ -128,6 +128,19 @@ export class SequenceMode extends BaseMode { zoom.scrollTo(firstMonomerPosition); } + if (this.isEditMode) { + const drawnStructuresElement = + document.querySelector('.drawn-structures'); + const isScrollToTheBottomNeeded = + drawnStructuresElement && + drawnStructuresElement.getBoundingClientRect().bottom > + window.innerHeight; + + if (isScrollToTheBottomNeeded) { + zoom.scrollToVerticalBottom(); + } + } + modelChanges.merge(command); return modelChanges;