11import { css , html , LitElement , nothing } from 'lit' ;
22import { customElement , property } from 'lit/decorators.js' ;
33import { when } from 'lit/directives/when.js' ;
4+ import type { Commands } from '../../../../../constants.commands' ;
45import type { GitPausedOperationStatus } from '../../../../../git/models/pausedOperationStatus' ;
56import { pausedOperationStatusStringsByType } from '../../../../../git/utils/pausedOperationStatus.utils' ;
67import { createCommandLink } from '../../../../../system/commands' ;
@@ -14,9 +15,11 @@ export class GlMergeConflictWarning extends LitElement {
1415 static override styles = [
1516 css `
1617 .status {
18+ box-sizing: border-box;
1719 display: flex;
1820 align-items: center;
1921 gap: 0.6rem;
22+ width: 100%;
2023 max-width: 100%;
2124 margin-block: 0;
2225 background-color: var(--vscode-gitlens-decorations\\.statusMergingOrRebasingForegroundColor);
@@ -31,14 +34,16 @@ export class GlMergeConflictWarning extends LitElement {
3134 }
3235
3336 .label {
34- flex-grow: 1;
37+ flex: 1;
38+ min-width: 0;
3539 white-space: nowrap;
3640 overflow: hidden;
3741 text-overflow: ellipsis;
3842 }
3943
4044 .icon,
41- .steps {
45+ .steps,
46+ .actions {
4247 flex: none;
4348 }
4449
@@ -57,37 +62,41 @@ export class GlMergeConflictWarning extends LitElement {
5762 @property ( { type : Object } )
5863 pausedOpStatus ?: GitPausedOperationStatus ;
5964
65+ @property ( )
66+ skipCommand = 'gitlens.home.skipPausedOperation' ;
67+
68+ @property ( )
69+ continueCommand = 'gitlens.home.continuePausedOperation' ;
70+
71+ @property ( )
72+ abortCommand = 'gitlens.home.abortPausedOperation' ;
73+
74+ @property ( )
75+ openEditorCommand = 'gitlens.home.openRebaseEditor' ;
76+
6077 private get onSkipUrl ( ) {
61- return createCommandLink ( 'gitlens.home.skipPausedOperation' , {
62- operation : this . pausedOpStatus ,
63- } ) ;
78+ return createCommandLink ( this . skipCommand as Commands , this . pausedOpStatus ) ;
6479 }
6580
6681 private get onContinueUrl ( ) {
67- return createCommandLink ( 'gitlens.home.continuePausedOperation' , {
68- operation : this . pausedOpStatus ,
69- } ) ;
82+ return createCommandLink ( this . continueCommand as Commands , this . pausedOpStatus ) ;
7083 }
7184
7285 private get onAbortUrl ( ) {
73- return createCommandLink ( 'gitlens.home.abortPausedOperation' , {
74- operation : this . pausedOpStatus ,
75- } ) ;
86+ return createCommandLink ( this . abortCommand as Commands , this . pausedOpStatus ) ;
7687 }
7788
7889 private get onOpenEditorUrl ( ) {
79- return createCommandLink ( 'gitlens.home.openRebaseEditor' , {
80- operation : this . pausedOpStatus ,
81- } ) ;
90+ return createCommandLink ( this . openEditorCommand as Commands , this . pausedOpStatus ) ;
8291 }
8392
8493 override render ( ) {
8594 if ( this . pausedOpStatus == null ) return nothing ;
8695
8796 return html `
88- < span class ="status ">
97+ < span class ="status " part =" base " >
8998 < code-icon icon ="warning " class ="icon "> </ code-icon >
90- ${ this . renderStatus ( this . pausedOpStatus ) }
99+ ${ this . renderStatus ( this . pausedOpStatus ) } ${ this . renderActions ( ) }
91100 </ span >
92101 ` ;
93102 }
@@ -96,15 +105,14 @@ export class GlMergeConflictWarning extends LitElement {
96105 if ( pausedOpStatus . type !== 'rebase' ) {
97106 const strings = pausedOperationStatusStringsByType [ pausedOpStatus . type ] ;
98107 return html `< span class ="label "
99- > ${ this . conflicts ? strings . conflicts : strings . label }
100- < code-icon
101- icon ="${ pausedOpStatus . incoming . refType === 'branch' ? 'git-branch' : 'git-commit' } "
102- class ="icon "
103- > </ code-icon >
104- ${ getReferenceLabel ( pausedOpStatus . incoming , { expand : false , icon : false } ) }
105- ${ strings . directionality }
106- ${ getReferenceLabel ( pausedOpStatus . current , { expand : false , icon : false } ) } </ span
107- > ${ this . renderActions ( ) } ` ;
108+ > ${ this . conflicts ? strings . conflicts : strings . label }
109+ < code-icon
110+ icon ="${ pausedOpStatus . incoming . refType === 'branch' ? 'git-branch' : 'git-commit' } "
111+ class ="icon "
112+ > </ code-icon >
113+ ${ getReferenceLabel ( pausedOpStatus . incoming , { expand : false , icon : false } ) } ${ strings . directionality }
114+ ${ getReferenceLabel ( pausedOpStatus . current , { expand : false , icon : false } ) } </ span
115+ > ` ;
108116 }
109117
110118 const started = pausedOpStatus . steps . total > 0 ;
@@ -124,15 +132,15 @@ export class GlMergeConflictWarning extends LitElement {
124132 ? html `< span class ="steps "
125133 > (${ pausedOpStatus . steps . current . number } /${ pausedOpStatus . steps . total } )</ span
126134 > `
127- : nothing } ${ this . renderActions ( ) } `;
135+ : nothing } `;
128136 }
129137
130138 private renderActions ( ) {
131139 if ( this . pausedOpStatus == null ) return nothing ;
132140
133141 const status = this . pausedOpStatus . type ;
134142
135- return html `< action-nav >
143+ return html `< action-nav class =" actions " >
136144 ${ when (
137145 status !== 'revert' && ! ( status === 'rebase' && this . conflicts ) ,
138146 ( ) => html `
0 commit comments