@@ -30,6 +30,7 @@ export class MDNPlayground extends L10nMixin(LitElement) {
3030
3131 static properties = {
3232 _gistID : { state : true } ,
33+ _showReportHintBanner : { state : true } ,
3334 } ;
3435
3536 constructor ( ) {
@@ -38,6 +39,8 @@ export class MDNPlayground extends L10nMixin(LitElement) {
3839 this . _autoRun = true ;
3940 /** @type {string | undefined } */
4041 this . _gistId = undefined ;
42+ /** @type {boolean } */
43+ this . _showReportHintBanner = false ;
4144 }
4245
4346 /** @type {Ref<MDNPlayController> } */
@@ -188,6 +191,7 @@ ${"```"}`,
188191
189192 if ( idParam ) {
190193 this . _gistId = idParam ;
194+ this . _showReportHintBanner = true ;
191195 }
192196
193197 const { srcPrefix : srcPrefixState , code } =
@@ -255,7 +259,12 @@ ${"```"}`,
255259 this . requestUpdate ( ) ;
256260 }
257261
262+ _dismissReportHintBanner ( ) {
263+ this . _showReportHintBanner = false ;
264+ }
265+
258266 _reportOpen ( ) {
267+ this . _dismissReportHintBanner ( ) ;
259268 this . _reportModal . value ?. showModal ( ) ;
260269 }
261270
@@ -282,6 +291,21 @@ ${"```"}`,
282291 this . _user . run ( ) ;
283292 }
284293
294+ _renderReportHintBanner ( ) {
295+ return html `< div class ="playground__runner-report-hint-banner ">
296+ < button class ="report-hint-button " @click =${ this . _reportOpen } >
297+ Seeing something inappropriate?
298+ </ button >
299+ < button
300+ class ="report-hint-close-button "
301+ @click =${ this . _dismissReportHintBanner }
302+ aria-label =${ this . l10n `Close report hint banner` }
303+ >
304+ < span > X</ span >
305+ </ button >
306+ </ div > ` ;
307+ }
308+
285309 render ( ) {
286310 const { code, initialCode } = this . _controller . value ?? { } ;
287311 const hasCode = Object . values ( code ?? { } ) . some ( Boolean ) ;
@@ -356,10 +380,8 @@ ${"```"}`,
356380 </ details >
357381 </ section >
358382 < section class ="playground__runner-console ">
359- ${ this . _gistId
360- ? html `< mdn-button @click =${ this . _reportOpen } variant ="plain">
361- Seeing something inappropriate?
362- </ mdn-button > `
383+ ${ this . _gistId && this . _showReportHintBanner
384+ ? html `${ this . _renderReportHintBanner ( ) } `
363385 : nothing }
364386 < mdn-play-runner > </ mdn-play-runner >
365387 < div class ="playground__console ">
0 commit comments