1
1
import { Avatar , defineGkElement } from '@gitkraken/shared-web-components' ;
2
- import type { PropertyValueMap } from 'lit' ;
2
+ import type { PropertyValueMap , TemplateResult } from 'lit' ;
3
3
import { css , html , nothing } from 'lit' ;
4
4
import { customElement , property , state } from 'lit/decorators.js' ;
5
5
import { repeat } from 'lit/directives/repeat.js' ;
6
6
import { when } from 'lit/directives/when.js' ;
7
+ import type { GenerateCommitsCommandArgs } from '../../../../commands/generateRebase' ;
8
+ import { createCommandLink } from '../../../../system/commands' ;
7
9
import { equalsIgnoreCase } from '../../../../system/string' ;
8
- import type { DraftState , State , Wip } from '../../../commitDetails/protocol' ;
10
+ import type { DraftState , Wip } from '../../../commitDetails/protocol' ;
9
11
import type { TreeItemAction , TreeItemBase } from '../../shared/components/tree/base' ;
10
12
import type { File } from './gl-details-base' ;
11
13
import { GlDetailsBase } from './gl-details-base' ;
@@ -30,9 +32,6 @@ export class GlWipDetails extends GlDetailsBase {
30
32
@property ( { type : Object } )
31
33
wip ?: Wip ;
32
34
33
- @property ( { type : Object } )
34
- orgSettings ?: State [ 'orgSettings' ] ;
35
-
36
35
@property ( { type : Object } )
37
36
draftState ?: DraftState ;
38
37
@@ -123,6 +122,45 @@ export class GlWipDetails extends GlDetailsBase {
123
122
return 'Working Changes' ;
124
123
}
125
124
125
+ protected override renderChangedFilesActions ( ) : TemplateResult < 1 > | undefined {
126
+ if ( ! this . files ?. length ) return undefined ;
127
+
128
+ if ( this . preferences ?. aiEnabled && this . orgSettings ?. ai ) {
129
+ return html `< div class ="section section--actions ">
130
+ < p class ="button-container ">
131
+ < span class ="button-group button-group--single ">
132
+ < gl-button
133
+ full
134
+ .href =${ createCommandLink ( 'gitlens.ai.generateCommits' , {
135
+ repoPath : this . wip ?. repo . path ,
136
+ source : { source : 'inspect' } ,
137
+ } as GenerateCommitsCommandArgs ) }
138
+ tooltip ="Generate Commits with AI (Preview) — organize working changes into meaningful commits"
139
+ .tooltipPlacement=${ 'top' }
140
+ > Commit with AI (Preview)< code-icon icon ="sparkle " slot ="prefix "> </ code-icon
141
+ > </ gl-button >
142
+ </ span >
143
+ </ p >
144
+ < p class ="button-container ">
145
+ < span class ="button-group button-group--single ">
146
+ < gl-button appearance ="secondary " full href ="command:workbench.view.scm "
147
+ > Commit via SCM < code-icon rotate ="45 " icon ="arrow-up " slot ="prefix "> </ code-icon
148
+ > </ gl-button >
149
+ </ span >
150
+ </ p >
151
+ </ div > ` ;
152
+ }
153
+ return html `< div class ="section section--actions ">
154
+ < p class ="button-container ">
155
+ < span class ="button-group button-group--single ">
156
+ < gl-button full href ="command:workbench.view.scm "
157
+ > Commit via SCM < code-icon rotate ="45 " icon ="arrow-up " slot ="suffix "> </ code-icon
158
+ > </ gl-button >
159
+ </ span >
160
+ </ p >
161
+ </ div > ` ;
162
+ }
163
+
126
164
private renderSecondaryAction ( ) {
127
165
if ( ! this . draftsEnabled || this . inReview ) return undefined ;
128
166
0 commit comments