Skip to content

Commit 90f5cdf

Browse files
1 parent 7e9059e commit 90f5cdf

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

static/app/views/replays/detail/ai/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {useCallback} from 'react';
12
import styled from '@emotion/styled';
23

34
import {Alert} from 'sentry/components/core/alert';
@@ -11,6 +12,7 @@ import {t} from 'sentry/locale';
1112
import {space} from 'sentry/styles/space';
1213
import type {ApiQueryKey} from 'sentry/utils/queryClient';
1314
import {useApiQuery} from 'sentry/utils/queryClient';
15+
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers';
1416
import useOrganization from 'sentry/utils/useOrganization';
1517
import useProjectFromId from 'sentry/utils/useProjectFromId';
1618
import BreadcrumbRow from 'sentry/views/replays/detail/breadcrumbs/breadcrumbRow';
@@ -50,9 +52,17 @@ export default function Ai() {
5052

5153
function AiContent() {
5254
const organization = useOrganization();
53-
const {replay} = useReplayContext();
55+
const {replay, setCurrentTime} = useReplayContext();
5456
const replayRecord = replay?.getReplay();
5557
const project = useProjectFromId({project_id: replayRecord?.project_id});
58+
const {onClickTimestamp} = useCrumbHandlers();
59+
const onClickChapterTimestamp = useCallback(
60+
(event: React.MouseEvent<Element>, start: number) => {
61+
event.stopPropagation();
62+
setCurrentTime(start - (replay?.getStartTimestampMs() ?? 0));
63+
},
64+
[replay, setCurrentTime]
65+
);
5666

5767
const {
5868
data: summaryData,
@@ -155,6 +165,9 @@ function AiContent() {
155165
<TimestampButton
156166
startTimestampMs={replay?.getStartTimestampMs() ?? 0}
157167
timestampMs={start}
168+
onClick={event => {
169+
onClickChapterTimestamp(event, start);
170+
}}
158171
/>
159172
</ReplayTimestamp>
160173
</SummaryTitle>
@@ -167,7 +180,7 @@ function AiContent() {
167180
<BreadcrumbRow
168181
frame={breadcrumb}
169182
index={j}
170-
onClick={() => {}}
183+
onClick={onClickTimestamp}
171184
onInspectorExpanded={() => {}}
172185
onShowSnippet={() => {}}
173186
showSnippet={false}

0 commit comments

Comments
 (0)