@@ -8,9 +8,11 @@ import {useReplayContext} from 'sentry/components/replays/replayContext';
8
8
import { IconChevron , IconFire , IconMegaphone } from 'sentry/icons' ;
9
9
import { t } from 'sentry/locale' ;
10
10
import { space } from 'sentry/styles/space' ;
11
+ import { trackAnalytics } from 'sentry/utils/analytics' ;
11
12
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers' ;
12
13
import useCurrentHoverTime from 'sentry/utils/replays/playback/providers/useCurrentHoverTime' ;
13
14
import type { ReplayFrame } from 'sentry/utils/replays/types' ;
15
+ import useOrganization from 'sentry/utils/useOrganization' ;
14
16
import BreadcrumbRow from 'sentry/views/replays/detail/breadcrumbs/breadcrumbRow' ;
15
17
import TimestampButton from 'sentry/views/replays/detail/timestampButton' ;
16
18
@@ -107,6 +109,8 @@ function ChapterRow({
107
109
const hasOccurred = currentTime >= startOffset ;
108
110
const isBeforeHover = currentHoverTime === undefined || currentHoverTime >= startOffset ;
109
111
112
+ const organization = useOrganization ( ) ;
113
+
110
114
return (
111
115
< ChapterWrapper
112
116
className = { classNames ( className , {
@@ -119,7 +123,16 @@ function ChapterRow({
119
123
onMouseEnter = { ( ) => setIsHovered ( true ) }
120
124
onMouseLeave = { ( ) => setIsHovered ( false ) }
121
125
>
122
- < Chapter error = { error } feedback = { feedback } >
126
+ < Chapter
127
+ error = { error }
128
+ feedback = { feedback }
129
+ onClick = { ( ) =>
130
+ trackAnalytics ( 'replay.ai-summary.chapter-clicked' , {
131
+ chapter_type : error ? 'error' : feedback ? 'feedback' : undefined ,
132
+ organization,
133
+ } )
134
+ }
135
+ >
123
136
< ChapterIconWrapper >
124
137
{ error ? (
125
138
isHovered ? (
0 commit comments