11import { Avatar , defineGkElement } from '@gitkraken/shared-web-components' ;
2- import type { PropertyValueMap } from 'lit' ;
2+ import type { PropertyValueMap , TemplateResult } from 'lit' ;
33import { css , html , nothing } from 'lit' ;
44import { customElement , property , state } from 'lit/decorators.js' ;
55import { repeat } from 'lit/directives/repeat.js' ;
66import { when } from 'lit/directives/when.js' ;
7+ import type { GenerateCommitsCommandArgs } from '../../../../commands/generateRebase' ;
8+ import { createCommandLink } from '../../../../system/commands' ;
79import { equalsIgnoreCase } from '../../../../system/string' ;
8- import type { DraftState , State , Wip } from '../../../commitDetails/protocol' ;
10+ import type { DraftState , Wip } from '../../../commitDetails/protocol' ;
911import type { TreeItemAction , TreeItemBase } from '../../shared/components/tree/base' ;
1012import type { File } from './gl-details-base' ;
1113import { GlDetailsBase } from './gl-details-base' ;
@@ -30,9 +32,6 @@ export class GlWipDetails extends GlDetailsBase {
3032 @property ( { type : Object } )
3133 wip ?: Wip ;
3234
33- @property ( { type : Object } )
34- orgSettings ?: State [ 'orgSettings' ] ;
35-
3635 @property ( { type : Object } )
3736 draftState ?: DraftState ;
3837
@@ -123,6 +122,45 @@ export class GlWipDetails extends GlDetailsBase {
123122 return 'Working Changes' ;
124123 }
125124
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+
126164 private renderSecondaryAction ( ) {
127165 if ( ! this . draftsEnabled || this . inReview ) return undefined ;
128166
0 commit comments