Merge pull request #31035 from overleaf/mg-context-menu-analytics

Add analytics event for context menu, comment, track changes, and jump to location

GitOrigin-RevId: 8412cc3c8039cd1582ccee20b162b4bef4467dea
This commit is contained in:
Malik Glossop
2026-03-06 09:14:26 +00:00
committed by Copybot
parent ab5be2261b
commit a293474c0c
14 changed files with 203 additions and 48 deletions
@@ -23,6 +23,7 @@ import {
deleteToVisualLineStart,
} from './visual-line-selection'
import { emitShortcutEvent } from '@/features/source-editor/extensions/toolbar/utils/analytics'
import { sendMB } from '@/infrastructure/event-tracking'
const toggleReviewPanel = () => {
window.dispatchEvent(new Event('ui.toggle-review-panel'))
@@ -30,6 +31,9 @@ const toggleReviewPanel = () => {
}
const addNewCommentFromKbdShortcut = () => {
sendMB('add-comment', {
location: 'shortcut',
})
window.dispatchEvent(new Event('add-new-review-comment'))
return true
}
@@ -5,6 +5,7 @@ import {
openSearchPanel,
searchPanelOpen,
} from '@codemirror/search'
import { sendMB } from '@/infrastructure/event-tracking'
import { toggleRanges, wrapRanges } from '../../commands/ranges'
import {
ancestorListType,
@@ -163,7 +164,10 @@ export const toggleSearch: Command = view => {
return true
}
export const addComment = () => {
export const addComment = (location: string) => {
sendMB('add-comment', {
location,
})
window.dispatchEvent(new Event('add-new-review-comment'))
}