@@ -5,14 +5,21 @@ import {
5
5
List as ReactVirtualizedList ,
6
6
ListRowProps ,
7
7
} from 'react-virtualized' ;
8
+ import styled from '@emotion/styled' ;
8
9
10
+ import Alert from 'sentry/components/alert' ;
11
+ import { Button } from 'sentry/components/button' ;
12
+ import ExternalLink from 'sentry/components/links/externalLink' ;
9
13
import Placeholder from 'sentry/components/placeholder' ;
10
14
import JumpButtons from 'sentry/components/replays/jumpButtons' ;
11
15
import { useReplayContext } from 'sentry/components/replays/replayContext' ;
12
16
import useJumpButtons from 'sentry/components/replays/useJumpButtons' ;
13
- import { t } from 'sentry/locale' ;
17
+ import { IconClose } from 'sentry/icons' ;
18
+ import { t , tct } from 'sentry/locale' ;
19
+ import { space } from 'sentry/styles/space' ;
14
20
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers' ;
15
21
import useExtractedDomNodes from 'sentry/utils/replays/hooks/useExtractedDomNodes' ;
22
+ import useDismissAlert from 'sentry/utils/useDismissAlert' ;
16
23
import useOrganization from 'sentry/utils/useOrganization' ;
17
24
import useVirtualizedInspector from 'sentry/views/replays/detail//useVirtualizedInspector' ;
18
25
import BreadcrumbFilters from 'sentry/views/replays/detail/breadcrumbs/breadcrumbFilters' ;
@@ -27,6 +34,8 @@ import TabItemContainer from 'sentry/views/replays/detail/tabItemContainer';
27
34
import useVirtualizedList from 'sentry/views/replays/detail/useVirtualizedList' ;
28
35
import useVirtualListDimentionChange from 'sentry/views/replays/detail/useVirtualListDimentionChange' ;
29
36
37
+ const LOCAL_STORAGE_KEY = 'replay-details-mask-config-instructions-dismissed' ;
38
+
30
39
// Ensure this object is created once as it is an input to
31
40
// `useVirtualizedList`'s memoization
32
41
const cellMeasurer = {
@@ -35,6 +44,7 @@ const cellMeasurer = {
35
44
} ;
36
45
37
46
function Breadcrumbs ( ) {
47
+ const { dismiss, isDismissed} = useDismissAlert ( { key : LOCAL_STORAGE_KEY } ) ;
38
48
const { currentTime, replay} = useReplayContext ( ) ;
39
49
const organization = useOrganization ( ) ;
40
50
const hasPerfTab = organization . features . includes ( 'session-replay-trace-table' ) ;
@@ -126,6 +136,27 @@ function Breadcrumbs() {
126
136
< FilterLoadingIndicator isLoading = { isFetchingExtractions || isFetchingTraces } >
127
137
< BreadcrumbFilters frames = { frames } { ...filterProps } />
128
138
</ FilterLoadingIndicator >
139
+ { isDismissed ? null : (
140
+ < StyledAlert
141
+ type = "info"
142
+ showIcon
143
+ trailingItems = {
144
+ < Button
145
+ aria-label = { t ( 'Dismiss banner' ) }
146
+ icon = { < IconClose /> }
147
+ onClick = { dismiss }
148
+ size = "zero"
149
+ borderless
150
+ />
151
+ }
152
+ >
153
+ { tct ( 'Learn how to unmask text (****) and unblock media [link:here].' , {
154
+ link : (
155
+ < ExternalLink href = "https://docs.sentry.io/platforms/javascript/session-replay/privacy/" />
156
+ ) ,
157
+ } ) }
158
+ </ StyledAlert >
159
+ ) }
129
160
< TabItemContainer data-test-id = "replay-details-breadcrumbs-tab" >
130
161
{ frames ? (
131
162
< AutoSizer onResize = { updateList } >
@@ -172,4 +203,8 @@ function Breadcrumbs() {
172
203
) ;
173
204
}
174
205
206
+ const StyledAlert = styled ( Alert ) `
207
+ margin-bottom: ${ space ( 1 ) } ;
208
+ ` ;
209
+
175
210
export default Breadcrumbs ;
0 commit comments