@@ -28,6 +28,11 @@ const UIStrings = {
28
28
* @description The title of the button after it was pressed and the text was copied to clipboard.
29
29
*/
30
30
copied : 'Copied to clipboard' ,
31
+ /**
32
+ * @description The title of the copy file to clipboard button
33
+ * @example {index.css} PH1
34
+ */
35
+ copyFile : 'Copy file {PH1} to clipboard' ,
31
36
} as const ;
32
37
33
38
const str_ = i18n . i18n . registerUIStrings ( 'panels/changes/CombinedDiffView.ts' , UIStrings ) ;
@@ -53,6 +58,7 @@ type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
53
58
function renderSingleDiffView ( singleDiffViewInput : SingleDiffViewInput ) : Lit . TemplateResult {
54
59
const { fileName, fileUrl, mimeType, icon, diff, copied, onCopy, onFileNameClick} = singleDiffViewInput ;
55
60
61
+ // clang-format off
56
62
return html `
57
63
< details open >
58
64
< summary >
@@ -62,24 +68,27 @@ function renderSingleDiffView(singleDiffViewInput: SingleDiffViewInput): Lit.Tem
62
68
< button class ="file-name-link " @click =${ ( ) => onFileNameClick ( fileUrl ) } > ${ fileName } </ button >
63
69
</ div >
64
70
< div class ="summary-right ">
65
- ${ copied ? html `< span class ="copied "> ${ i18nString ( UIStrings . copied ) } </ span > ` : html `
66
- < devtools-button
67
- title =${ 'Copy' }
68
- .size =${ Buttons . Button . Size . SMALL }
69
- .iconName=${ 'copy' }
70
- .jslogContext=${ 'combined-diff-view.copy' }
71
- .variant=${ Buttons . Button . Variant . ICON }
72
- @click=${ ( ) => onCopy ( fileUrl ) } > </ devtools-button >
73
- ` }
71
+ < devtools-button
72
+ title =${ i18nString ( UIStrings . copyFile , { PH1 : fileName } ) }
73
+ .size =${ Buttons . Button . Size . SMALL }
74
+ .iconName=${ 'copy' }
75
+ .jslogContext=${ 'combined-diff-view.copy' }
76
+ .variant=${ Buttons . Button . Variant . ICON }
77
+ @click=${ ( ) => onCopy ( fileUrl ) }
78
+ > </ devtools-button >
79
+ ${ copied
80
+ ? html `< span class ="copied "> ${ i18nString ( UIStrings . copied ) } </ span > `
81
+ : Lit . nothing }
74
82
</ div >
75
83
</ summary >
76
- < div class =' diff-view-container ' >
84
+ < div class =" diff-view-container " >
77
85
< devtools-diff-view
78
86
.data =${ { diff, mimeType} as DiffView . DiffView . DiffViewData } >
79
87
</ devtools-diff-view >
80
88
</ div >
81
89
</ details >
82
90
` ;
91
+ // clang-format on
83
92
}
84
93
85
94
export class CombinedDiffView extends UI . Widget . Widget {
0 commit comments