44
55import '../../ui/legacy/legacy.js' ;
66import '../../ui/components/markdown_view/markdown_view.js' ;
7+ import '../../ui/components/spinners/spinners.js' ;
78
89import * as Host from '../../core/host/host.js' ;
910import * as i18n from '../../core/i18n/i18n.js' ;
@@ -25,6 +26,10 @@ const UIStringsNotTranslate = {
2526 *@description Text displayed for showing change summary view.
2627 */
2728 changeSummary : 'Changes summary' ,
29+ /**
30+ *@description Loading text displayed as a summary title when the patch suggestion is getting loaded
31+ */
32+ loadingPatchSuggestion : 'Applying to workspace…' ,
2833 /**
2934 *@description Button text for staging changes to workspace.
3035 */
@@ -81,14 +86,14 @@ export class PatchWidget extends UI.Widget.Widget {
8186 if ( ! input . changeSummary ) {
8287 return ;
8388 }
89+
8490 render (
8591 html `
8692 < details class ="change-summary ">
8793 < summary >
88- < devtools-icon class ="difference-icon " .name =${ 'pen-spark' }
89- > </ devtools-icon >
94+ ${ input . patchSuggestionLoading ? html `< devtools-spinner > </ devtools-spinner > ` : html `< devtools-icon class ="difference-icon " .name =${ 'pen-spark' } > </ devtools-icon > ` }
9095 < span class ="header-text ">
91- ${ lockedString ( UIStringsNotTranslate . changeSummary ) }
96+ ${ input . patchSuggestionLoading ? lockedString ( UIStringsNotTranslate . loadingPatchSuggestion ) : lockedString ( UIStringsNotTranslate . changeSummary ) }
9297 </ span >
9398 < devtools-icon
9499 class ="arrow "
@@ -100,7 +105,7 @@ export class PatchWidget extends UI.Widget.Widget {
100105 .codeLang =${ 'css' }
101106 .displayNotice=${ true }
102107 > </ devtools-code-block >
103- < div class ="workspace ">
108+ ${ ! input . patchSuggestionLoading ? html ` < div class ="workspace ">
104109 < div class ="change-workspace ">
105110 < div class ="selected-folder ">
106111 ${ lockedString ( UIStringsNotTranslate . selectedFolder ) } ${ input . projectName }
@@ -117,9 +122,9 @@ export class PatchWidget extends UI.Widget.Widget {
117122 @click =${ input . onApplyToWorkspace }
118123 .jslogContext =${ 'stage-to-workspace' }
119124 .variant=${ Buttons . Button . Variant . OUTLINED } >
120- ${ ! input . patchSuggestionLoading ? lockedString ( UIStringsNotTranslate . applyToWorkspace ) : lockedString ( UIStringsNotTranslate . loading ) }
125+ ${ lockedString ( UIStringsNotTranslate . applyToWorkspace ) }
121126 </ devtools-button >
122- </ div >
127+ </ div > ` : nothing }
123128 ${ input . patchSuggestion ? html `< div class ="patch-tmp-message ">
124129 ${ input . patchSuggestion }
125130 </ div > ` : nothing }
0 commit comments