@gitlab/duo-ui 10.17.0 → 10.17.2
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 +15 -0
- package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +1 -1
- package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.js +2 -2
- package/dist/components/chat/components/duo_chat_message/message_types/message_tool.js +4 -4
- package/package.json +1 -1
- package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +2 -2
- package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +1 -2
- package/src/components/chat/components/duo_chat_message/message_types/message_tool.vue +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [10.17.2](https://gitlab.com/gitlab-org/duo-ui/compare/v10.17.1...v10.17.2) (2025-08-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Correct esc key behavior for context menu interactions ([5b71efe](https://gitlab.com/gitlab-org/duo-ui/commit/5b71efe70d3df7e0ecd752dfbae74414d32d0720))
|
|
7
|
+
|
|
8
|
+
## [10.17.1](https://gitlab.com/gitlab-org/duo-ui/compare/v10.17.0...v10.17.1) (2025-08-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* adjust command output to return as object ([ff49372](https://gitlab.com/gitlab-org/duo-ui/commit/ff493724efdf3473ca6daaf8b9828be4308341dd))
|
|
14
|
+
* rollback object format and use tool_request.content ([9b8d758](https://gitlab.com/gitlab-org/duo-ui/commit/9b8d75869f813b2f081a505429b1a3ed087f891f))
|
|
15
|
+
|
|
1
16
|
# [10.17.0](https://gitlab.com/gitlab-org/duo-ui/compare/v10.16.3...v10.17.0) (2025-08-21)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -233,7 +233,7 @@ var script = {
|
|
|
233
233
|
const __vue_script__ = script;
|
|
234
234
|
|
|
235
235
|
/* template */
|
|
236
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"gl-mb-3",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"primary-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e(),_vm._v(" "),(_vm.open)?_c('div',{attrs:{"tabindex":"0","data-testid":"context-item-menu-wrapper"},on:{"
|
|
236
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"gl-mb-3",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"primary-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e(),_vm._v(" "),(_vm.open)?_c('div',{attrs:{"tabindex":"0","data-testid":"context-item-menu-wrapper"},on:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEsc.apply(null, arguments)}}},[_c('gl-card',{staticClass:"slash-commands !gl-absolute gl-bottom-0 gl-w-full gl-pl-0 gl-shadow-md",attrs:{"body-class":"!gl-p-2","data-testid":"context-item-menu"}},[_c('div',{staticClass:"gl-mb-2 gl-flex"},[(_vm.selectedCategory)?_c('gl-button',{staticClass:"!gl-shadow-none",attrs:{"size":"small","icon":"chevron-lg-left","aria-label":"Go back","data-testid":"context-item-menu-back-button"},on:{"click":function($event){return _vm.handleEsc()}}}):_vm._e(),_vm._v(" "),_c('gl-button',{staticClass:"gl-ml-auto !gl-shadow-none",attrs:{"size":"small","icon":"close","aria-label":"Close menu","data-testid":"context-item-menu-close-button"},on:{"click":function($event){return _vm.closeMenu()}}})],1),_vm._v(" "),(_vm.showCategorySelection)?_c('duo-chat-context-item-menu-category-items',{attrs:{"active-index":_vm.activeIndex,"categories":_vm.categories},on:{"select":_vm.selectCategory,"active-index-change":function($event){_vm.activeIndex = $event;}}}):_c('duo-chat-context-item-menu-search-items',{attrs:{"active-index":_vm.activeIndex,"category":_vm.selectedCategory,"loading":_vm.loading,"error":_vm.error,"results":_vm.results},on:{"select":_vm.selectItem,"keyup":function($event){$event.stopPropagation();return _vm.handleKeyUp.apply(null, arguments)},"active-index-change":function($event){_vm.activeIndex = $event;}},model:{value:(_vm.searchQuery),callback:function ($$v) {_vm.searchQuery=$$v;},expression:"searchQuery"}}),_vm._v(" "),(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"!gl-mb-0 gl-mt-2 gl-max-h-13 gl-overflow-y-auto",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"in-menu-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e()],1)],1):_vm._e()],1)};
|
|
237
237
|
var __vue_staticRenderFns__ = [];
|
|
238
238
|
|
|
239
239
|
/* style */
|
|
@@ -98,11 +98,11 @@ var script = {
|
|
|
98
98
|
const __vue_script__ = script;
|
|
99
99
|
|
|
100
100
|
/* template */
|
|
101
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-max-h-31 gl-overflow-y-scroll"},[(_vm.loading)?_c('duo-chat-context-item-menu-search-items-loading',{attrs:{"rows":_vm.numLoadingItems}}):(_vm.error)?_c('gl-alert',{staticClass:"gl-m-3",attrs:{"variant":"danger","dismissible":false,"data-testid":"search-results-error"}},[_vm._v("\n "+_vm._s(_vm.error)+"\n ")]):(_vm.showEmptyState)?_c('div',{staticClass:"gl-rounded-base gl-p-3 gl-text-center gl-text-secondary",attrs:{"data-testid":"search-results-empty-state"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.emptyStateMessage)+"\n ")]):_c('ul',{staticClass:"gl-mb-1 gl-list-none gl-flex-row gl-pl-0"},_vm._l((_vm.results),function(contextItem,index){return _c('gl-dropdown-item',{key:contextItem.id,staticClass:"duo-chat-context-search-result-item",class:{
|
|
101
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{on:{"keyup":_vm.handleKeyUp}},[_c('div',{staticClass:"gl-max-h-31 gl-overflow-y-scroll"},[(_vm.loading)?_c('duo-chat-context-item-menu-search-items-loading',{attrs:{"rows":_vm.numLoadingItems}}):(_vm.error)?_c('gl-alert',{staticClass:"gl-m-3",attrs:{"variant":"danger","dismissible":false,"data-testid":"search-results-error"}},[_vm._v("\n "+_vm._s(_vm.error)+"\n ")]):(_vm.showEmptyState)?_c('div',{staticClass:"gl-rounded-base gl-p-3 gl-text-center gl-text-secondary",attrs:{"data-testid":"search-results-empty-state"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.emptyStateMessage)+"\n ")]):_c('ul',{staticClass:"gl-mb-1 gl-list-none gl-flex-row gl-pl-0"},_vm._l((_vm.results),function(contextItem,index){return _c('gl-dropdown-item',{key:contextItem.id,staticClass:"duo-chat-context-search-result-item",class:{
|
|
102
102
|
'active-command': _vm.isActiveItem(contextItem, index),
|
|
103
103
|
'gl-cursor-not-allowed [&>button]:focus-within:!gl-shadow-none':
|
|
104
104
|
!contextItem.metadata.enabled,
|
|
105
|
-
},attrs:{"id":("dropdown-item-" + index),"tabindex":!contextItem.metadata.enabled ? -1 : undefined,"data-testid":"search-result-item"},on:{"click":function($event){return _vm.selectItem(contextItem)}}},[_c('div',{on:{"mouseenter":function($event){return _vm.setActiveIndex(index)}}},[_c('duo-chat-context-item-menu-search-item',{class:{ 'gl-text-secondary': !contextItem.metadata.enabled },attrs:{"context-item":contextItem,"category":_vm.category,"data-testid":"search-result-item-details"}})],1)])}),1)],1),_vm._v(" "),_c('gl-form-input',{ref:"contextMenuSearchInput",attrs:{"value":_vm.searchQuery,"placeholder":_vm.searchInputPlaceholder,"autofocus":"","data-testid":"context-menu-search-input"},on:{"input":function($event){return _vm.$emit('update:searchQuery', $event)}
|
|
105
|
+
},attrs:{"id":("dropdown-item-" + index),"tabindex":!contextItem.metadata.enabled ? -1 : undefined,"data-testid":"search-result-item"},on:{"click":function($event){return _vm.selectItem(contextItem)}}},[_c('div',{on:{"mouseenter":function($event){return _vm.setActiveIndex(index)}}},[_c('duo-chat-context-item-menu-search-item',{class:{ 'gl-text-secondary': !contextItem.metadata.enabled },attrs:{"context-item":contextItem,"category":_vm.category,"data-testid":"search-result-item-details"}})],1)])}),1)],1),_vm._v(" "),_c('gl-form-input',{ref:"contextMenuSearchInput",attrs:{"value":_vm.searchQuery,"placeholder":_vm.searchInputPlaceholder,"autofocus":"","data-testid":"context-menu-search-input"},on:{"input":function($event){return _vm.$emit('update:searchQuery', $event)}}})],1)};
|
|
106
106
|
var __vue_staticRenderFns__ = [];
|
|
107
107
|
|
|
108
108
|
/* style */
|
|
@@ -95,9 +95,9 @@ var script = {
|
|
|
95
95
|
var _this$message$tool_in4;
|
|
96
96
|
return (_this$message$tool_in4 = this.message.tool_info) === null || _this$message$tool_in4 === void 0 ? void 0 : _this$message$tool_in4.name;
|
|
97
97
|
},
|
|
98
|
-
|
|
99
|
-
var _this$message$tool_in5;
|
|
100
|
-
return (_this$message$tool_in5 = this.message.tool_info) === null || _this$message$tool_in5 === void 0 ? void 0 : _this$message$tool_in5.tool_response;
|
|
98
|
+
toolResponseContent() {
|
|
99
|
+
var _this$message$tool_in5, _this$message$tool_in6;
|
|
100
|
+
return (_this$message$tool_in5 = this.message.tool_info) === null || _this$message$tool_in5 === void 0 ? void 0 : (_this$message$tool_in6 = _this$message$tool_in5.tool_response) === null || _this$message$tool_in6 === void 0 ? void 0 : _this$message$tool_in6.content;
|
|
101
101
|
},
|
|
102
102
|
toolWorkingDirectory() {
|
|
103
103
|
return this.workingDirectory;
|
|
@@ -119,7 +119,7 @@ const __vue_script__ = script;
|
|
|
119
119
|
/* template */
|
|
120
120
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('base-message',{attrs:{"message":_vm.message},scopedSlots:_vm._u([{key:"message",fn:function(ref){
|
|
121
121
|
var content = ref.content;
|
|
122
|
-
return [(_vm.hasCommandOutput)?_c('message-tool-command-output',{attrs:{"command-header":_vm.$options.i18n.RAN_TERMINAL_COMMAND,"command-action":_vm.toolName,"command-output":_vm.
|
|
122
|
+
return [(_vm.hasCommandOutput)?_c('message-tool-command-output',{attrs:{"command-header":_vm.$options.i18n.RAN_TERMINAL_COMMAND,"command-action":_vm.toolName,"command-output":_vm.toolResponseContent,"working-directory":_vm.toolWorkingDirectory}}):_c('div',{staticClass:"gl-flex gl-items-baseline !gl-text-subtle"},[_c('div',{staticClass:"gl-mr-3 gl-flex-shrink-0"},[_c('gl-icon',{attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-flex-1"},[_c('div',{staticClass:"gl-mb-2"},[_c('span',{attrs:{"data-testid":"tool-message-content"}},[_vm._v(_vm._s(content))])]),_vm._v(" "),(_vm.projectId)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-project-info"}},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.PROJECT_LABEL)+":")]),_vm._v(" "),_c('span',{staticClass:"gl-ml-2",attrs:{"data-testid":"tool-message-project-id"}},[_vm._v(_vm._s(_vm.projectId))])]):_vm._e(),_vm._v(" "),(_vm.branchName)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-branch-info"}},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.BRANCH_LABEL)+":")]),_vm._v(" "),_c('span',{staticClass:"gl-ml-2",attrs:{"data-testid":"tool-message-branch-name"}},[_vm._v(_vm._s(_vm.branchName))])]):_vm._e(),_vm._v(" "),(_vm.startBranch)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-start-branch-info"}},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.START_BRANCH_LABEL)+":")]),_vm._v(" "),_c('span',{staticClass:"gl-ml-2",attrs:{"data-testid":"tool-message-start-branch-name"}},[_vm._v(_vm._s(_vm.startBranch))])]):_vm._e(),_vm._v(" "),(_vm.commitMessage)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-commit-message-info"}},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.COMMIT_MESSAGE_LABEL)+":")]),_vm._v(" "),_c('span',{staticClass:"gl-ml-2",attrs:{"data-testid":"tool-message-commit-message-text"}},[_vm._v(_vm._s(_vm.commitMessage))])]):_vm._e(),_vm._v(" "),(_vm.hasActions)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-actions-section"}},[_c('div',{staticClass:"gl-mb-2"},[_c('span',{staticClass:"gl-font-weight-bold",attrs:{"data-testid":"tool-message-actions-label"}},[_vm._v(_vm._s(_vm.$options.i18n.ACTION_LABEL)+"s:")])]),_vm._v(" "),_vm._l((_vm.toolArgs.actions),function(action,index){return _c('div',{key:index,staticClass:"gl-rounded gl-border gl-mb-3 gl-ml-4 gl-border-subtle gl-p-3",attrs:{"data-testid":"tool-message-action-item"}},[_c('div',{staticClass:"gl-mb-2"},[_c('span',{staticClass:"gl-font-weight-bold",attrs:{"data-testid":"tool-message-action-type"}},[_vm._v(_vm._s(action.action))])]),_vm._v(" "),(action.file_path)?_c('div',{staticClass:"gl-mb-2"},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.FILE_PATH_LABEL)+":")]),_vm._v(" "),_c('gl-link',{staticClass:"gl-markdown file-path-link gl-ml-2 gl-break-all",attrs:{"data-testid":"tool-message-action-file-path-link"},on:{"click":function($event){$event.preventDefault();return _vm.onOpenFilePath(action.file_path)}}},[_c('code',[_vm._v(_vm._s(action.file_path))])])],1):_vm._e(),_vm._v(" "),(action.content)?_c('div',{staticClass:"gl-mb-2",attrs:{"data-testid":"tool-message-action-content"}},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.CONTENT_LABEL)+":")]),_vm._v(" "),_c('pre',{staticClass:"gl-rounded gl-mt-2 gl-overflow-auto gl-bg-subtle gl-p-2 gl-text-sm",attrs:{"data-testid":"tool-message-action-content-text"}},[_vm._v(_vm._s(action.content))])]):_vm._e()])})],2):(_vm.messageFilePath)?_c('div',{staticClass:"gl-mb-2"},[_c('span',{staticClass:"gl-font-weight-bold"},[_vm._v(_vm._s(_vm.$options.i18n.FILE_PATH_LABEL)+":")]),_vm._v(" "),_c('gl-link',{staticClass:"gl-markdown file-path-link gl-ml-2 gl-break-all",attrs:{"data-testid":"tool-message-file-path-link"},on:{"click":function($event){$event.preventDefault();return _vm.onOpenFilePath(_vm.messageFilePath)}}},[_c('code',[_vm._v(_vm._s(_vm.messageFilePath))])])],1):_vm._e()])])]}}])})};
|
|
123
123
|
var __vue_staticRenderFns__ = [];
|
|
124
124
|
|
|
125
125
|
/* style */
|
package/package.json
CHANGED
|
@@ -251,7 +251,7 @@ export default {
|
|
|
251
251
|
@remove="removeItem"
|
|
252
252
|
@get-content="onGetContextItemContent"
|
|
253
253
|
/>
|
|
254
|
-
<div v-if="open" tabindex="0" data-testid="context-item-menu-wrapper" @
|
|
254
|
+
<div v-if="open" tabindex="0" data-testid="context-item-menu-wrapper" @keyup.esc="handleEsc">
|
|
255
255
|
<gl-card
|
|
256
256
|
class="slash-commands !gl-absolute gl-bottom-0 gl-w-full gl-pl-0 gl-shadow-md"
|
|
257
257
|
body-class="!gl-p-2"
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
:error="error"
|
|
294
294
|
:results="results"
|
|
295
295
|
@select="selectItem"
|
|
296
|
-
@keyup="handleKeyUp"
|
|
296
|
+
@keyup.stop="handleKeyUp"
|
|
297
297
|
@active-index-change="activeIndex = $event"
|
|
298
298
|
/>
|
|
299
299
|
<duo-chat-context-item-selections
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
};
|
|
100
100
|
</script>
|
|
101
101
|
<template>
|
|
102
|
-
<div>
|
|
102
|
+
<div @keyup="handleKeyUp">
|
|
103
103
|
<div class="gl-max-h-31 gl-overflow-y-scroll">
|
|
104
104
|
<duo-chat-context-item-menu-search-items-loading v-if="loading" :rows="numLoadingItems" />
|
|
105
105
|
<gl-alert
|
|
@@ -151,7 +151,6 @@ export default {
|
|
|
151
151
|
autofocus
|
|
152
152
|
data-testid="context-menu-search-input"
|
|
153
153
|
@input="$emit('update:searchQuery', $event)"
|
|
154
|
-
@keyup="handleKeyUp"
|
|
155
154
|
/>
|
|
156
155
|
</div>
|
|
157
156
|
</template>
|
|
@@ -93,8 +93,8 @@ export default {
|
|
|
93
93
|
toolName() {
|
|
94
94
|
return this.message.tool_info?.name;
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
return this.message.tool_info?.tool_response;
|
|
96
|
+
toolResponseContent() {
|
|
97
|
+
return this.message.tool_info?.tool_response?.content;
|
|
98
98
|
},
|
|
99
99
|
toolWorkingDirectory() {
|
|
100
100
|
return this.workingDirectory;
|
|
@@ -117,7 +117,7 @@ export default {
|
|
|
117
117
|
v-if="hasCommandOutput"
|
|
118
118
|
:command-header="$options.i18n.RAN_TERMINAL_COMMAND"
|
|
119
119
|
:command-action="toolName"
|
|
120
|
-
:command-output="
|
|
120
|
+
:command-output="toolResponseContent"
|
|
121
121
|
:working-directory="toolWorkingDirectory"
|
|
122
122
|
/>
|
|
123
123
|
<div v-else class="gl-flex gl-items-baseline !gl-text-subtle">
|