diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.tsx index bba7c150e3..75c840133a 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.tsx @@ -10,6 +10,7 @@ import { Placement } from 'react-bootstrap/types' import useSynctex from '../hooks/use-synctex' import { useFeatureFlag } from '@/shared/context/split-test-context' import OLSpinner from '@/shared/components/ol/ol-spinner' +import { sendMB } from '@/infrastructure/event-tracking' const GoToCodeButton = memo(function GoToCodeButton({ syncToCode, @@ -35,6 +36,10 @@ const GoToCodeButton = memo(function GoToCodeButton({ } const syncToCodeWithButton = useCallback(() => { + sendMB('jump-to-location', { + method: 'arrow', + direction: 'pdf-location-in-code', + }) syncToCode({ visualOffset: 72 }) }, [syncToCode]) @@ -85,6 +90,14 @@ const GoToPdfButton = memo(function GoToPdfButton({ 'detach-synctex-control': !!isDetachLayout, }) + const handleSyncToPdf = useCallback(() => { + sendMB('jump-to-location', { + method: 'arrow', + direction: 'code-location-in-pdf', + }) + syncToPdf() + }, [syncToPdf]) + let buttonIcon = null if (syncToPdfInFlight) { buttonIcon = @@ -104,7 +117,7 @@ const GoToPdfButton = memo(function GoToPdfButton({ void }>( >() const [visible, setVisible] = useState(false) + const handleAddCommentClick = useCallback(() => { + sendMB('add-comment', { + location: 'tooltip', + }) + onAddComment() + }, [onAddComment]) + const changesInSelection = useMemo(() => { return (ranges?.changes ?? []).filter(({ op }) => { const opFrom = op.p @@ -219,7 +227,7 @@ const ReviewTooltipMenuContent = memo<{ onAddComment: () => void }>( >