@gitlab/duo-ui 10.8.2 → 10.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [10.10.0](https://gitlab.com/gitlab-org/duo-ui/compare/v10.9.0...v10.10.0) (2025-07-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * remove canceledRequestIds prop in Agentic Duo Chat ([5c34b99](https://gitlab.com/gitlab-org/duo-ui/commit/5c34b993ffd99cab36d5ae1694a591b9ee0ac5d9))
7
+
8
+ # [10.9.0](https://gitlab.com/gitlab-org/duo-ui/compare/v10.8.2...v10.9.0) (2025-07-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * Support workflow_end custom values ([53271a4](https://gitlab.com/gitlab-org/duo-ui/commit/53271a44e301117b7eff1be5c8efcd8f1d90a83b))
14
+
1
15
  ## [10.8.2](https://gitlab.com/gitlab-org/duo-ui/compare/v10.8.1...v10.8.2) (2025-07-17)
2
16
 
3
17
 
@@ -126,14 +126,6 @@ var script = {
126
126
  default: VIEW_TYPES.LIST,
127
127
  validator: value => [VIEW_TYPES.LIST, VIEW_TYPES.CHAT].includes(value)
128
128
  },
129
- /**
130
- * Array of RequestIds that have been canceled.
131
- */
132
- canceledRequestIds: {
133
- type: Array,
134
- required: false,
135
- default: () => []
136
- },
137
129
  /**
138
130
  * A non-recoverable error message to display in the chat.
139
131
  */
@@ -311,11 +303,8 @@ var script = {
311
303
  return this.prompt.toLowerCase().trim();
312
304
  },
313
305
  isStreaming() {
314
- var _this$lastMessage, _this$lastMessage2, _this$lastMessage2$ch, _this$lastMessage3, _this$lastMessage4;
315
- if (this.canceledRequestIds.includes((_this$lastMessage = this.lastMessage) === null || _this$lastMessage === void 0 ? void 0 : _this$lastMessage.requestId)) {
316
- return false;
317
- }
318
- return Boolean(((_this$lastMessage2 = this.lastMessage) === null || _this$lastMessage2 === void 0 ? void 0 : (_this$lastMessage2$ch = _this$lastMessage2.chunks) === null || _this$lastMessage2$ch === void 0 ? void 0 : _this$lastMessage2$ch.length) > 0 && !((_this$lastMessage3 = this.lastMessage) !== null && _this$lastMessage3 !== void 0 && _this$lastMessage3.content) || typeof ((_this$lastMessage4 = this.lastMessage) === null || _this$lastMessage4 === void 0 ? void 0 : _this$lastMessage4.chunkId) === 'number');
306
+ var _this$lastMessage, _this$lastMessage$chu, _this$lastMessage2, _this$lastMessage3;
307
+ return Boolean(((_this$lastMessage = this.lastMessage) === null || _this$lastMessage === void 0 ? void 0 : (_this$lastMessage$chu = _this$lastMessage.chunks) === null || _this$lastMessage$chu === void 0 ? void 0 : _this$lastMessage$chu.length) > 0 && !((_this$lastMessage2 = this.lastMessage) !== null && _this$lastMessage2 !== void 0 && _this$lastMessage2.content) || typeof ((_this$lastMessage3 = this.lastMessage) === null || _this$lastMessage3 === void 0 ? void 0 : _this$lastMessage3.chunkId) === 'number');
319
308
  },
320
309
  filteredSlashCommands() {
321
310
  return this.slashCommands.filter(c => c.name.toLowerCase().startsWith(this.caseInsensitivePrompt)).filter(c => {
@@ -656,7 +645,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
656
645
  },attrs:{"width":_vm.shouldRenderResizable ? _vm.dimensions.width : null,"height":_vm.shouldRenderResizable ? _vm.dimensions.height : null,"max-width":_vm.shouldRenderResizable ? _vm.dimensions.maxWidth : null,"max-height":_vm.shouldRenderResizable ? _vm.dimensions.maxHeight : null,"min-width":_vm.shouldRenderResizable ? _vm.dimensions.minWidth : null,"left":_vm.shouldRenderResizable ? _vm.dimensions.left : null,"top":_vm.shouldRenderResizable ? _vm.dimensions.top : null,"fit-parent":true,"min-height":_vm.shouldRenderResizable ? _vm.dimensions.minHeight : null,"active":_vm.shouldRenderResizable ? ['l', 't', 'lt'] : null},on:{"resize:end":_vm.updateSize}},[(!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block duo-chat gl-bottom-0 gl-max-h-full gl-flex gl-flex-col",class:{
657
646
  'resizable-content': _vm.shouldRenderResizable,
658
647
  'duo-chat-drawer': !_vm.shouldRenderResizable,
659
- },attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('duo-chat-header',{ref:"header",attrs:{"active-thread-id":_vm.activeThreadId,"title":_vm.isMultithreaded && _vm.currentView === 'list' ? _vm.$options.i18n.CHAT_HISTORY_TITLE : _vm.title,"subtitle":_vm.activeThreadTitleForView,"error":_vm.error,"is-multithreaded":_vm.isMultithreaded,"current-view":_vm.currentView,"should-render-resizable":_vm.shouldRenderResizable,"badge-type":_vm.isMultithreaded ? null : _vm.badgeType},on:{"go-back":_vm.onGoBack,"new-chat":_vm.onNewChat,"close":_vm.hideChat},scopedSlots:_vm._u([{key:"subheader",fn:function(){return [_vm._t("subheader")]},proxy:true}],null,true)}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-overflow-y-auto gl-flex gl-flex-col gl-flex-1 gl-flex-grow gl-bg-inherit gl-overscroll-contain",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingThrottled}},[(_vm.shouldShowThreadList)?_c('duo-chat-threads',{attrs:{"threads":_vm.threadList,"preferred-locale":_vm.preferredLocale},on:{"new-chat":_vm.onNewChat,"select-thread":_vm.onSelectThread,"delete-thread":_vm.onDeleteThread,"close":_vm.hideChat}}):_c('transition-group',{staticClass:"duo-chat-history gl-p-5 gl-mt-auto",attrs:{"mode":"out-in","tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('duo-chat-conversation',{key:("conversation-" + index),attrs:{"enable-code-insertion":_vm.enableCodeInsertion,"messages":conversation,"canceled-request-ids":_vm.canceledRequestIds,"show-delimiter":index > 0,"with-feedback":_vm.withFeedback,"is-tool-approval-processing":_vm.isToolApprovalProcessing},on:{"track-feedback":_vm.onTrackFeedback,"insert-code-snippet":_vm.onInsertCodeSnippet,"copy-code-snippet":_vm.onCopyCodeSnippet,"copy-message":_vm.onCopyMessage,"get-context-item-content":_vm.onGetContextItemContent,"approve-tool":_vm.onApproveToolCall,"deny-tool":_vm.onDenyToolCall,"open-file-path":_vm.onOpenFilePath}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('div',{key:"empty-state-message",staticClass:"duo-chat-message gl-rounded-bl-none gl-border-1 gl-border-solid gl-border-gray-50 gl-bg-gray-10 gl-p-4 gl-leading-20 gl-text-gray-900 gl-break-anywhere",attrs:{"data-testid":"gl-duo-chat-empty-state"}},[(_vm.emptyStateTitle)?_c('p',{staticClass:"gl-m-0",attrs:{"data-testid":"gl-duo-chat-empty-state-title"}},[_vm._v("\n "+_vm._s(_vm.emptyStateTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})],1)]:_vm._e(),_vm._v(" "),(_vm.isLoading)?_c('duo-chat-loader',{key:"loader",attrs:{"tool-name":_vm.toolName}}):_vm._e(),_vm._v(" "),_c('div',{key:"anchor",ref:"anchor",staticClass:"scroll-anchor"})],2)],1),_vm._v(" "),(_vm.isChatAvailable && !_vm.shouldShowThreadList)?_c('footer',{staticClass:"duo-chat-drawer-footer gl-border-0 gl-bg-default gl-pb-3 gl-shrink-0 gl-relative gl-z-2",class:{ 'duo-chat-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('div',{staticClass:"gl-relative gl-max-w-full"},[_vm._t("context-items-menu",null,{"isOpen":_vm.contextItemsMenuIsOpen,"onClose":_vm.closeContextItemsMenuOpen,"setRef":_vm.setContextItemsMenuRef,"focusPrompt":_vm.focusChatInput})],2),_vm._v(" "),_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [(_vm.canSubmit)?_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-full",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","data-testid":"chat-prompt-submit-button","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL}}):_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-full",attrs:{"icon":"stop","category":"primary","variant":"default","data-testid":"chat-prompt-cancel-button","aria-label":_vm.$options.i18n.CHAT_CANCEL_LABEL},on:{"click":_vm.cancelPrompt}})]},proxy:true}],null,false,3738248012)},[_c('div',{staticClass:"duo-chat-input gl-min-h-8 gl-max-w-full gl-grow gl-align-top",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands !gl-absolute gl-w-full -gl-translate-y-full gl-list-none gl-pl-0 gl-shadow-md",attrs:{"body-class":"!gl-p-2"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-flex gl-justify-between"},[_c('span',{staticClass:"gl-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-pl-3 gl-text-right gl-italic gl-text-subtle"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute !gl-h-full gl-rounded-br-none gl-rounded-tr-none !gl-bg-transparent !gl-py-4 !gl-shadow-none",class:{ 'gl-truncate': !_vm.prompt },attrs:{"disabled":!_vm.canSubmit,"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"autofocus":""},on:{"compositionend":_vm.compositionEnd},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)])],1),_vm._v(" "),_vm._t("footer-controls"),_vm._v(" "),_c('p',{staticClass:"gl-mb-0 gl-mt-3 gl-px-4 gl-text-sm gl-text-secondary"},[_vm._v("\n "+_vm._s(_vm.$options.i18n.CHAT_DISCLAMER)+"\n ")])],2):_vm._e()],1):_vm._e()])};
648
+ },attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('duo-chat-header',{ref:"header",attrs:{"active-thread-id":_vm.activeThreadId,"title":_vm.isMultithreaded && _vm.currentView === 'list' ? _vm.$options.i18n.CHAT_HISTORY_TITLE : _vm.title,"subtitle":_vm.activeThreadTitleForView,"error":_vm.error,"is-multithreaded":_vm.isMultithreaded,"current-view":_vm.currentView,"should-render-resizable":_vm.shouldRenderResizable,"badge-type":_vm.isMultithreaded ? null : _vm.badgeType},on:{"go-back":_vm.onGoBack,"new-chat":_vm.onNewChat,"close":_vm.hideChat},scopedSlots:_vm._u([{key:"subheader",fn:function(){return [_vm._t("subheader")]},proxy:true}],null,true)}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-overflow-y-auto gl-flex gl-flex-col gl-flex-1 gl-flex-grow gl-bg-inherit gl-overscroll-contain",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingThrottled}},[(_vm.shouldShowThreadList)?_c('duo-chat-threads',{attrs:{"threads":_vm.threadList,"preferred-locale":_vm.preferredLocale},on:{"new-chat":_vm.onNewChat,"select-thread":_vm.onSelectThread,"delete-thread":_vm.onDeleteThread,"close":_vm.hideChat}}):_c('transition-group',{staticClass:"duo-chat-history gl-p-5 gl-mt-auto",attrs:{"mode":"out-in","tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('duo-chat-conversation',{key:("conversation-" + index),attrs:{"enable-code-insertion":_vm.enableCodeInsertion,"messages":conversation,"show-delimiter":index > 0,"with-feedback":_vm.withFeedback,"is-tool-approval-processing":_vm.isToolApprovalProcessing},on:{"track-feedback":_vm.onTrackFeedback,"insert-code-snippet":_vm.onInsertCodeSnippet,"copy-code-snippet":_vm.onCopyCodeSnippet,"copy-message":_vm.onCopyMessage,"get-context-item-content":_vm.onGetContextItemContent,"approve-tool":_vm.onApproveToolCall,"deny-tool":_vm.onDenyToolCall,"open-file-path":_vm.onOpenFilePath}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('div',{key:"empty-state-message",staticClass:"duo-chat-message gl-rounded-bl-none gl-border-1 gl-border-solid gl-border-gray-50 gl-bg-gray-10 gl-p-4 gl-leading-20 gl-text-gray-900 gl-break-anywhere",attrs:{"data-testid":"gl-duo-chat-empty-state"}},[(_vm.emptyStateTitle)?_c('p',{staticClass:"gl-m-0",attrs:{"data-testid":"gl-duo-chat-empty-state-title"}},[_vm._v("\n "+_vm._s(_vm.emptyStateTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})],1)]:_vm._e(),_vm._v(" "),(_vm.isLoading)?_c('duo-chat-loader',{key:"loader",attrs:{"tool-name":_vm.toolName}}):_vm._e(),_vm._v(" "),_c('div',{key:"anchor",ref:"anchor",staticClass:"scroll-anchor"})],2)],1),_vm._v(" "),(_vm.isChatAvailable && !_vm.shouldShowThreadList)?_c('footer',{staticClass:"duo-chat-drawer-footer gl-border-0 gl-bg-default gl-pb-3 gl-shrink-0 gl-relative gl-z-2",class:{ 'duo-chat-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('div',{staticClass:"gl-relative gl-max-w-full"},[_vm._t("context-items-menu",null,{"isOpen":_vm.contextItemsMenuIsOpen,"onClose":_vm.closeContextItemsMenuOpen,"setRef":_vm.setContextItemsMenuRef,"focusPrompt":_vm.focusChatInput})],2),_vm._v(" "),_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [(_vm.canSubmit)?_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-full",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","data-testid":"chat-prompt-submit-button","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL}}):_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-full",attrs:{"icon":"stop","category":"primary","variant":"default","data-testid":"chat-prompt-cancel-button","aria-label":_vm.$options.i18n.CHAT_CANCEL_LABEL},on:{"click":_vm.cancelPrompt}})]},proxy:true}],null,false,3738248012)},[_c('div',{staticClass:"duo-chat-input gl-min-h-8 gl-max-w-full gl-grow gl-align-top",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands !gl-absolute gl-w-full -gl-translate-y-full gl-list-none gl-pl-0 gl-shadow-md",attrs:{"body-class":"!gl-p-2"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-flex gl-justify-between"},[_c('span',{staticClass:"gl-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-pl-3 gl-text-right gl-italic gl-text-subtle"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute !gl-h-full gl-rounded-br-none gl-rounded-tr-none !gl-bg-transparent !gl-py-4 !gl-shadow-none",class:{ 'gl-truncate': !_vm.prompt },attrs:{"disabled":!_vm.canSubmit,"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"autofocus":""},on:{"compositionend":_vm.compositionEnd},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)])],1),_vm._v(" "),_vm._t("footer-controls"),_vm._v(" "),_c('p',{staticClass:"gl-mb-0 gl-mt-3 gl-px-4 gl-text-sm gl-text-secondary"},[_vm._v("\n "+_vm._s(_vm.$options.i18n.CHAT_DISCLAMER)+"\n ")])],2):_vm._e()],1):_vm._e()])};
660
649
  var __vue_staticRenderFns__ = [];
661
650
 
662
651
  /* style */
@@ -28,7 +28,8 @@ var script = {
28
28
  },
29
29
  canceledRequestIds: {
30
30
  type: Array,
31
- required: true
31
+ required: false,
32
+ default: () => []
32
33
  },
33
34
  /**
34
35
  * Whether the insertCode feature should be available.
@@ -9,8 +9,26 @@ var script = {
9
9
  AgentMessage,
10
10
  GlButton
11
11
  },
12
- workflowEndMessage: {
13
- content: "Review the changes. To improve the implementation, create another workflow and describe the specific changes you'd like to see."
12
+ props: {
13
+ endMessage: {
14
+ required: false,
15
+ type: String,
16
+ default: "Review the changes. To improve the implementation, create another workflow and describe the specific changes you'd like to see."
17
+ },
18
+ action: {
19
+ required: false,
20
+ type: Object,
21
+ default: null
22
+ }
23
+ },
24
+ computed: {
25
+ route() {
26
+ return this.action && Object.keys(this.action).length > 0 ? undefined : this.$options.newRoute;
27
+ },
28
+ buttonText() {
29
+ var _this$action;
30
+ return ((_this$action = this.action) === null || _this$action === void 0 ? void 0 : _this$action.text) || 'New workflow';
31
+ }
14
32
  },
15
33
  newRoute: {
16
34
  name: WORKFLOW_NEW_APP
@@ -21,9 +39,9 @@ var script = {
21
39
  const __vue_script__ = script;
22
40
 
23
41
  /* template */
24
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('agent-message',{attrs:{"message":_vm.$options.workflowEndMessage},scopedSlots:_vm._u([{key:"message",fn:function(ref){
42
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('agent-message',{attrs:{"message":{ content: _vm.endMessage }},scopedSlots:_vm._u([{key:"message",fn:function(ref){
25
43
  var content = ref.content;
26
- return [_c('p',[_vm._v("\n "+_vm._s(content)+"\n ")]),_vm._v(" "),_c('gl-button',{staticClass:"gl-mt-4",attrs:{"to":_vm.$options.newRoute}},[_vm._v("New workflow")])]}}])})};
44
+ return [_c('p',[_vm._v("\n "+_vm._s(content)+"\n ")]),_vm._v(" "),_c('gl-button',{staticClass:"gl-mt-4",attrs:{"to":_vm.route},on:{"click":function($event){return _vm.$emit('new-flow')}}},[_vm._v(_vm._s(_vm.buttonText))])]}}])})};
27
45
  var __vue_staticRenderFns__ = [];
28
46
 
29
47
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/duo-ui",
3
- "version": "10.8.2",
3
+ "version": "10.10.0",
4
4
  "description": "Duo UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -100,7 +100,7 @@
100
100
  "@gitlab/eslint-plugin": "21.2.0",
101
101
  "@gitlab/fonts": "^1.3.0",
102
102
  "@gitlab/stylelint-config": "6.2.2",
103
- "@gitlab/svgs": "^3.139.0",
103
+ "@gitlab/svgs": "^3.140.0",
104
104
  "@gitlab/ui": "latest",
105
105
  "@jest/test-sequencer": "^29.7.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
@@ -16,7 +16,6 @@ consumer component.
16
16
  :is-loading="isLoading"
17
17
  :is-chat-available="isChatAvailable"
18
18
  :predefined-prompts="predefinedPrompts"
19
- :canceled-request-ids="cancelledRequestIds"
20
19
  :tool-name="toolName"
21
20
  :empty-state-title="emptyStateTitle"
22
21
  :empty-state-description="emptyStateDescription"
@@ -90,7 +89,6 @@ export default {
90
89
  error: null,
91
90
  isLoading: false,
92
91
  toolName: '',
93
- cancelledRequestIds: []
94
92
  }
95
93
  },
96
94
  provide: {
@@ -112,8 +110,6 @@ export default {
112
110
  }
113
111
  methods: {
114
112
  onChatCancel() {
115
- // pushing last requestId of messages to canceled Request Ids
116
- this.cancelledRequestIds.push(this.messages[this.messages.length - 1].requestId);
117
113
  this.isLoading = false;
118
114
  },
119
115
  onChatHidden() {
@@ -128,11 +124,7 @@ export default {
128
124
  ...
129
125
  },
130
126
  onAiResponse(data) {
131
- // check if requestId was not cancelled
132
- if (requestId && !this.cancelledRequestIds.includes(data.requestId)) {
133
- this.messages = data
134
- }
135
-
127
+ this.messages = data
136
128
  this.isLoading = false;
137
129
  },
138
130
  onAiResponseError(error) {
@@ -182,14 +182,7 @@ export default {
182
182
  default: VIEW_TYPES.LIST,
183
183
  validator: (value) => [VIEW_TYPES.LIST, VIEW_TYPES.CHAT].includes(value),
184
184
  },
185
- /**
186
- * Array of RequestIds that have been canceled.
187
- */
188
- canceledRequestIds: {
189
- type: Array,
190
- required: false,
191
- default: () => [],
192
- },
185
+
193
186
  /**
194
187
  * A non-recoverable error message to display in the chat.
195
188
  */
@@ -370,9 +363,6 @@ export default {
370
363
  return this.prompt.toLowerCase().trim();
371
364
  },
372
365
  isStreaming() {
373
- if (this.canceledRequestIds.includes(this.lastMessage?.requestId)) {
374
- return false;
375
- }
376
366
  return Boolean(
377
367
  (this.lastMessage?.chunks?.length > 0 && !this.lastMessage?.content) ||
378
368
  typeof this.lastMessage?.chunkId === 'number'
@@ -790,7 +780,6 @@ export default {
790
780
  :key="`conversation-${index}`"
791
781
  :enable-code-insertion="enableCodeInsertion"
792
782
  :messages="conversation"
793
- :canceled-request-ids="canceledRequestIds"
794
783
  :show-delimiter="index > 0"
795
784
  :with-feedback="withFeedback"
796
785
  :is-tool-approval-processing="isToolApprovalProcessing"
@@ -30,7 +30,8 @@ export default {
30
30
  },
31
31
  canceledRequestIds: {
32
32
  type: Array,
33
- required: true,
33
+ required: false,
34
+ default: () => [],
34
35
  },
35
36
  /**
36
37
  * Whether the insertCode feature should be available.
@@ -10,9 +10,28 @@ export default {
10
10
  AgentMessage,
11
11
  GlButton,
12
12
  },
13
- workflowEndMessage: {
14
- content:
15
- "Review the changes. To improve the implementation, create another workflow and describe the specific changes you'd like to see.",
13
+ props: {
14
+ endMessage: {
15
+ required: false,
16
+ type: String,
17
+ default:
18
+ "Review the changes. To improve the implementation, create another workflow and describe the specific changes you'd like to see.",
19
+ },
20
+ action: {
21
+ required: false,
22
+ type: Object,
23
+ default: null,
24
+ },
25
+ },
26
+ computed: {
27
+ route() {
28
+ return this.action && Object.keys(this.action).length > 0
29
+ ? undefined
30
+ : this.$options.newRoute;
31
+ },
32
+ buttonText() {
33
+ return this.action?.text || 'New workflow';
34
+ },
16
35
  },
17
36
  newRoute: {
18
37
  name: WORKFLOW_NEW_APP,
@@ -20,13 +39,12 @@ export default {
20
39
  };
21
40
  </script>
22
41
  <template>
23
- <agent-message :message="$options.workflowEndMessage">
42
+ <agent-message :message="{ content: endMessage }">
24
43
  <template #message="{ content }">
25
44
  <p>
26
45
  {{ content }}
27
46
  </p>
28
-
29
- <gl-button :to="$options.newRoute" class="gl-mt-4">New workflow</gl-button>
47
+ <gl-button :to="route" class="gl-mt-4" @click="$emit('new-flow')">{{ buttonText }}</gl-button>
30
48
  </template>
31
49
  </agent-message>
32
50
  </template>