@@ -3,16 +3,19 @@ import styled from '@emotion/styled';
3
3
import classNames from 'classnames' ;
4
4
5
5
import { Alert } from 'sentry/components/core/alert' ;
6
+ import { Link } from 'sentry/components/core/link' ;
6
7
import EmptyMessage from 'sentry/components/emptyMessage' ;
7
8
import { useReplayContext } from 'sentry/components/replays/replayContext' ;
8
9
import { IconChevron , IconFire , IconMegaphone } from 'sentry/icons' ;
9
- import { t } from 'sentry/locale' ;
10
+ import { t , tct } from 'sentry/locale' ;
10
11
import { space } from 'sentry/styles/space' ;
11
12
import { trackAnalytics } from 'sentry/utils/analytics' ;
13
+ import { TabKey } from 'sentry/utils/replays/hooks/useActiveReplayTab' ;
12
14
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers' ;
13
15
import { useReplayReader } from 'sentry/utils/replays/playback/providers/replayReaderProvider' ;
14
16
import useCurrentHoverTime from 'sentry/utils/replays/playback/providers/useCurrentHoverTime' ;
15
17
import type { ReplayFrame } from 'sentry/utils/replays/types' ;
18
+ import { useLocation } from 'sentry/utils/useLocation' ;
16
19
import useOrganization from 'sentry/utils/useOrganization' ;
17
20
import BreadcrumbRow from 'sentry/views/replays/detail/breadcrumbs/breadcrumbRow' ;
18
21
import TimestampButton from 'sentry/views/replays/detail/timestampButton' ;
@@ -104,7 +107,9 @@ function ChapterRow({
104
107
className ?: string ;
105
108
} ) {
106
109
const replay = useReplayReader ( ) ;
107
- const { currentTime} = useReplayContext ( ) ;
110
+ const { currentTime, setCurrentTime} = useReplayContext ( ) ;
111
+ const organization = useOrganization ( ) ;
112
+ const location = useLocation ( ) ;
108
113
const { onClickTimestamp} = useCrumbHandlers ( ) ;
109
114
const [ currentHoverTime ] = useCurrentHoverTime ( ) ;
110
115
const [ isHovered , setIsHovered ] = useState ( false ) ;
@@ -115,8 +120,6 @@ function ChapterRow({
115
120
const hasOccurred = currentTime >= startOffset ;
116
121
const isBeforeHover = currentHoverTime === undefined || currentHoverTime >= startOffset ;
117
122
118
- const organization = useOrganization ( ) ;
119
-
120
123
return (
121
124
< ChapterWrapper
122
125
data-has-error = { Boolean ( error ) }
@@ -174,8 +177,34 @@ function ChapterRow({
174
177
< div >
175
178
{ ! breadcrumbs . length && (
176
179
< 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
+ }
179
208
) }
180
209
</ EmptyMessage >
181
210
) }
0 commit comments