diff --git a/packages/e2e-tests/helpers/comments.ts b/packages/e2e-tests/helpers/comments.ts index 8de0d76ea6e..ecfc1b41560 100644 --- a/packages/e2e-tests/helpers/comments.ts +++ b/packages/e2e-tests/helpers/comments.ts @@ -163,6 +163,11 @@ export async function addVisualComment( async () => { const element = page.locator("#graphics"); await element.click({ position: { x, y } }); + + await selectContextMenuItem(page, { + contextMenuItemTestName: "ContextMenuItem-AddComment", + contextMenuTestId: "ContextMenu-Video", + }); }, "visual", text diff --git a/src/ui/components/Video/Video.tsx b/src/ui/components/Video/Video.tsx index 121c49c2f5d..b9567399a38 100644 --- a/src/ui/components/Video/Video.tsx +++ b/src/ui/components/Video/Video.tsx @@ -100,15 +100,7 @@ export default function Video() { const dispatch = useAppDispatch(); const panel = useAppSelector(getSelectedPrimaryPanel); - const { addComment, contextMenu, onContextMenu } = useVideoContextMenu(); - - const onClick = (event: MouseEvent) => { - dispatch(stopPlayback()); - - if (nodePickerStatus == "disabled") { - addComment(event); - } - }; + const { contextMenu, onContextMenu: onClick } = useVideoContextMenu(); const showBeforeAfterTestStepToggles = panel === "cypress"; @@ -124,7 +116,7 @@ export default function Video() { - + {/* Graphics that are relative to the rendered screenshot go here; this container is automatically positioned to align with the screenshot */}
diff --git a/src/ui/components/Video/useVideoContextMenu.tsx b/src/ui/components/Video/useVideoContextMenu.tsx index abe0e3aefcd..8a97eff50a6 100644 --- a/src/ui/components/Video/useVideoContextMenu.tsx +++ b/src/ui/components/Video/useVideoContextMenu.tsx @@ -156,12 +156,6 @@ export default function useVideoContextMenu() { }, [contextMenu, hideMenu, isPlaying]); return { - addComment: (e: React.MouseEvent) => - addComment({ - pageX: e.pageX, - pageY: e.pageY, - position: getPositionForAddingComment(e), - }), contextMenu, onContextMenu, };