@@ -18,6 +18,7 @@ import type {
1818import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js' ;
1919import * as ComputedStyle from '../../../models/computed_style/computed_style.js' ;
2020import * as Trace from '../../../models/trace/trace.js' ;
21+ import * as PanelsCommon from '../../../panels/common/common.js' ;
2122import * as Marked from '../../../third_party/marked/marked.js' ;
2223import * as Buttons from '../../../ui/components/buttons/buttons.js' ;
2324import * as Input from '../../../ui/components/input/input.js' ;
@@ -186,18 +187,10 @@ const UIStringsNotTranslate = {
186187 * @description Title used for revealing the performance trace.
187188 */
188189 revealTrace : 'Reveal trace' ,
189- /**
190- * @description Title for the computed styles widget.
191- */
192- computedStyles : 'Computed styles' ,
193190 /**
194191 * @description Title for the core web vitals widget.
195192 */
196193 coreVitals : 'Core Web Vitals' ,
197- /**
198- * @description Title for the styles widget.
199- */
200- styles : 'Styles' ,
201194 /**
202195 * @description Title for the LCP breakdown widget.
203196 */
@@ -694,7 +687,7 @@ interface WidgetMakerResponse {
694687 revealable : unknown ;
695688 customRevealTitle ?: Platform . UIString . LocalizedString ;
696689 // Can be null if the widget is only used to add the Reveal CTA.
697- title : Platform . UIString . LocalizedString | null ;
690+ title : Lit . LitTemplate | Platform . UIString . LocalizedString | null ;
698691}
699692
700693const nodeCache = new Map < Protocol . DOM . BackendNodeId , SDK . DOMModel . DOMNode > ( ) ;
@@ -741,7 +734,11 @@ async function makeComputedStyleWidget(widgetData: ComputedStyleAiWidget): Promi
741734 return {
742735 renderedWidget,
743736 revealable : new Elements . ElementsPanel . NodeComputedStyles ( domNodeForId ) ,
744- title : lockedString ( UIStringsNotTranslate . computedStyles ) ,
737+ title : html `< devtools-widget
738+ ${ widget ( PanelsCommon . DOMLinkifier . DOMNodeLink , {
739+ node : domNodeForId ,
740+ } ) }
741+ > </ devtools-widget > ` ,
745742 } ;
746743}
747744
@@ -778,7 +775,11 @@ async function makeStylePropertiesWidget(widgetData: StylePropertiesAiWidget): P
778775 return {
779776 renderedWidget,
780777 revealable : domNodeForId ,
781- title : lockedString ( UIStringsNotTranslate . styles ) ,
778+ title : html `< devtools-widget
779+ ${ widget ( PanelsCommon . DOMLinkifier . DOMNodeLink , {
780+ node : domNodeForId ,
781+ } ) }
782+ > </ devtools-widget > ` ,
782783 } ;
783784}
784785
0 commit comments