@@ -28,6 +28,11 @@ const UIStrings = {
2828 * @description The title of the button after it was pressed and the text was copied to clipboard.
2929 */
3030 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' ,
3136} as const ;
3237
3338const str_ = i18n . i18n . registerUIStrings ( 'panels/changes/CombinedDiffView.ts' , UIStrings ) ;
@@ -53,6 +58,7 @@ type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
5358function renderSingleDiffView ( singleDiffViewInput : SingleDiffViewInput ) : Lit . TemplateResult {
5459 const { fileName, fileUrl, mimeType, icon, diff, copied, onCopy, onFileNameClick} = singleDiffViewInput ;
5560
61+ // clang-format off
5662 return html `
5763 < details open >
5864 < summary >
@@ -62,24 +68,27 @@ function renderSingleDiffView(singleDiffViewInput: SingleDiffViewInput): Lit.Tem
6268 < button class ="file-name-link " @click =${ ( ) => onFileNameClick ( fileUrl ) } > ${ fileName } </ button >
6369 </ div >
6470 < 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 }
7482 </ div >
7583 </ summary >
76- < div class =' diff-view-container ' >
84+ < div class =" diff-view-container " >
7785 < devtools-diff-view
7886 .data =${ { diff, mimeType} as DiffView . DiffView . DiffViewData } >
7987 </ devtools-diff-view >
8088 </ div >
8189 </ details >
8290 ` ;
91+ // clang-format on
8392}
8493
8594export class CombinedDiffView extends UI . Widget . Widget {
0 commit comments