Skip to content

Commit 6e0ef03

Browse files
ref(replay): add links to console/network tabs on ai summary (#96153)
followup to #96049 the link goes to the new tab at the timestamp of the chapter: https://github.com/user-attachments/assets/1d544c86-6524-4540-810d-353a720fab66
1 parent 0761667 commit 6e0ef03

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

static/app/components/replays/replayContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ interface ReplayPlayerContextProps extends HighlightCallbacks {
9999
restart: () => void;
100100

101101
/**
102-
* Jump the video to a specific time
102+
* Jump the video to a specific time. Input is in ms.
103103
*/
104104
setCurrentTime: (time: number) => void;
105105

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

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ import styled from '@emotion/styled';
33
import classNames from 'classnames';
44

55
import {Alert} from 'sentry/components/core/alert';
6+
import {Link} from 'sentry/components/core/link';
67
import EmptyMessage from 'sentry/components/emptyMessage';
78
import {useReplayContext} from 'sentry/components/replays/replayContext';
89
import {IconChevron, IconFire, IconMegaphone} from 'sentry/icons';
9-
import {t} from 'sentry/locale';
10+
import {t, tct} from 'sentry/locale';
1011
import {space} from 'sentry/styles/space';
1112
import {trackAnalytics} from 'sentry/utils/analytics';
13+
import {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab';
1214
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers';
1315
import {useReplayReader} from 'sentry/utils/replays/playback/providers/replayReaderProvider';
1416
import useCurrentHoverTime from 'sentry/utils/replays/playback/providers/useCurrentHoverTime';
1517
import type {ReplayFrame} from 'sentry/utils/replays/types';
18+
import {useLocation} from 'sentry/utils/useLocation';
1619
import useOrganization from 'sentry/utils/useOrganization';
1720
import BreadcrumbRow from 'sentry/views/replays/detail/breadcrumbs/breadcrumbRow';
1821
import TimestampButton from 'sentry/views/replays/detail/timestampButton';
@@ -104,7 +107,9 @@ function ChapterRow({
104107
className?: string;
105108
}) {
106109
const replay = useReplayReader();
107-
const {currentTime} = useReplayContext();
110+
const {currentTime, setCurrentTime} = useReplayContext();
111+
const organization = useOrganization();
112+
const location = useLocation();
108113
const {onClickTimestamp} = useCrumbHandlers();
109114
const [currentHoverTime] = useCurrentHoverTime();
110115
const [isHovered, setIsHovered] = useState(false);
@@ -115,8 +120,6 @@ function ChapterRow({
115120
const hasOccurred = currentTime >= startOffset;
116121
const isBeforeHover = currentHoverTime === undefined || currentHoverTime >= startOffset;
117122

118-
const organization = useOrganization();
119-
120123
return (
121124
<ChapterWrapper
122125
data-has-error={Boolean(error)}
@@ -174,8 +177,34 @@ function ChapterRow({
174177
<div>
175178
{!breadcrumbs.length && (
176179
<EmptyMessage>
177-
{t(
178-
'No breadcrumbs for this chapter, but there may be console logs or network requests that occurred during this window.'
180+
{tct(
181+
'No breadcrumbs for this chapter, but there may be [consoleLogs: console logs] or [networkRequests: network requests] that occurred during this window.',
182+
{
183+
consoleLogs: (
184+
<Link
185+
to={{
186+
pathname: location.pathname,
187+
query: {
188+
t_main: TabKey.CONSOLE,
189+
t: startOffset / 1000,
190+
},
191+
}}
192+
onClick={() => setCurrentTime(startOffset)}
193+
/>
194+
),
195+
networkRequests: (
196+
<Link
197+
to={{
198+
pathname: location.pathname,
199+
query: {
200+
t_main: TabKey.NETWORK,
201+
t: startOffset / 1000,
202+
},
203+
}}
204+
onClick={() => setCurrentTime(startOffset)}
205+
/>
206+
),
207+
}
179208
)}
180209
</EmptyMessage>
181210
)}

0 commit comments

Comments
 (0)