@gitlab/duo-ui 15.9.0 → 15.10.1
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/dist/components/agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback.js +24 -147
- package/dist/components/agentic_chat/components/agentic_feedback_panel/agentic_feedback_panel.js +185 -0
- package/dist/components/chat/components/duo_chat_message/duo_chat_message.js +21 -2
- package/dist/components/chat/components/duo_chat_threads/duo_chat_threads.js +45 -6
- package/dist/components/chat/components/message_action_bar/message_action_bar.js +43 -0
- package/dist/components/chat/constants.js +2 -1
- package/dist/components/chat/mock_data.js +60 -100
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +1 -1
- package/src/components/agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback.scss +2 -2
- package/src/components/agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback.vue +35 -233
- package/src/components/agentic_chat/components/agentic_feedback_panel/agentic_feedback_panel.vue +228 -0
- package/src/components/chat/components/duo_chat_message/duo_chat_message.vue +64 -33
- package/src/components/chat/components/duo_chat_threads/duo_chat_threads.vue +56 -3
- package/src/components/chat/components/message_action_bar/message_action_bar.vue +11 -0
- package/src/components/chat/constants.js +2 -0
- package/src/components/chat/mock_data.js +60 -110
- package/translations.js +3 -0
package/dist/components/agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback.js
CHANGED
|
@@ -1,175 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GlButton, GlIcon, GlFormTextarea, GlForm, GlTooltipDirective } from '@gitlab/ui';
|
|
1
|
+
import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui';
|
|
3
2
|
import { translate } from '@gitlab/ui/dist/utils/i18n';
|
|
4
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
4
|
|
|
6
5
|
const i18n = {
|
|
7
6
|
THANKS: translate('AgenticBinaryFeedback.thanks', 'Thanks for the feedback!'),
|
|
8
7
|
THUMBS_UP: translate('AgenticBinaryFeedback.thumbsUp', 'Helpful'),
|
|
9
|
-
THUMBS_DOWN: translate('AgenticBinaryFeedback.thumbsDown', 'Not helpful')
|
|
10
|
-
TELL_US_MORE: translate('AgenticBinaryFeedback.tellUsMore', 'Tell us more'),
|
|
11
|
-
SUBMIT: translate('AgenticBinaryFeedback.submit', 'Submit'),
|
|
12
|
-
BACK: translate('AgenticBinaryFeedback.back', 'Back'),
|
|
13
|
-
CLOSE: translate('AgenticBinaryFeedback.close', 'Close'),
|
|
14
|
-
FEEDBACK_PLACEHOLDER: translate('AgenticBinaryFeedback.placeholder', 'Share your feedback...'),
|
|
15
|
-
THUMBS_UP_HEADER: translate('AgenticBinaryFeedback.thumbsUpHeader', 'What made this helpful?'),
|
|
16
|
-
THUMBS_DOWN_HEADER: translate('AgenticBinaryFeedback.thumbsDownHeader', 'What would have been more helpful?'),
|
|
17
|
-
TOO_GENERIC: translate('AgenticBinaryFeedback.tooGeneric', 'Too generic'),
|
|
18
|
-
MISSING_STEPS: translate('AgenticBinaryFeedback.missingSteps', 'Missing steps'),
|
|
19
|
-
WRONG_CONTEXT: translate('AgenticBinaryFeedback.wrongContext', 'Wrong context'),
|
|
20
|
-
OUTDATED_INCORRECT: translate('AgenticBinaryFeedback.outdatedIncorrect', 'Outdated/incorrect'),
|
|
21
|
-
SOLVED_PROBLEM: translate('AgenticBinaryFeedback.solvedProblem', 'Solved my problem'),
|
|
22
|
-
SAVED_TIME: translate('AgenticBinaryFeedback.savedTime', 'Saved me time'),
|
|
23
|
-
GOOD_EXAMPLES: translate('AgenticBinaryFeedback.goodExamples', 'Good examples'),
|
|
24
|
-
ACCURATE_INFO: translate('AgenticBinaryFeedback.accurateInfo', 'Accurate information')
|
|
25
|
-
};
|
|
26
|
-
const thumbsDownReasons = [{
|
|
27
|
-
key: 'too_generic',
|
|
28
|
-
label: i18n.TOO_GENERIC
|
|
29
|
-
}, {
|
|
30
|
-
key: 'missing_steps',
|
|
31
|
-
label: i18n.MISSING_STEPS
|
|
32
|
-
}, {
|
|
33
|
-
key: 'wrong_context',
|
|
34
|
-
label: i18n.WRONG_CONTEXT
|
|
35
|
-
}, {
|
|
36
|
-
key: 'outdated_incorrect',
|
|
37
|
-
label: i18n.OUTDATED_INCORRECT
|
|
38
|
-
}, {
|
|
39
|
-
key: 'tell_us_more',
|
|
40
|
-
label: i18n.TELL_US_MORE,
|
|
41
|
-
isCustom: true
|
|
42
|
-
}];
|
|
43
|
-
const thumbsUpReasons = [{
|
|
44
|
-
key: 'solved_problem',
|
|
45
|
-
label: i18n.SOLVED_PROBLEM
|
|
46
|
-
}, {
|
|
47
|
-
key: 'saved_time',
|
|
48
|
-
label: i18n.SAVED_TIME
|
|
49
|
-
}, {
|
|
50
|
-
key: 'good_examples',
|
|
51
|
-
label: i18n.GOOD_EXAMPLES
|
|
52
|
-
}, {
|
|
53
|
-
key: 'accurate_info',
|
|
54
|
-
label: i18n.ACCURATE_INFO
|
|
55
|
-
}, {
|
|
56
|
-
key: 'tell_us_more',
|
|
57
|
-
label: i18n.TELL_US_MORE,
|
|
58
|
-
isCustom: true
|
|
59
|
-
}];
|
|
60
|
-
const FEEDBACK_VIEW = {
|
|
61
|
-
CLOSED: 'closed',
|
|
62
|
-
REASON_LIST: 'reason_list',
|
|
63
|
-
TELL_US_MORE: 'tell_us_more'
|
|
8
|
+
THUMBS_DOWN: translate('AgenticBinaryFeedback.thumbsDown', 'Not helpful')
|
|
64
9
|
};
|
|
65
10
|
var script = {
|
|
66
11
|
name: 'AgenticBinaryFeedback',
|
|
67
12
|
i18n,
|
|
68
|
-
thumbsUpReasons,
|
|
69
|
-
thumbsDownReasons,
|
|
70
13
|
components: {
|
|
71
14
|
GlButton,
|
|
72
|
-
GlIcon
|
|
73
|
-
GlFormTextarea,
|
|
74
|
-
GlForm
|
|
15
|
+
GlIcon
|
|
75
16
|
},
|
|
76
17
|
directives: {
|
|
77
18
|
GlTooltip: GlTooltipDirective
|
|
78
19
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
20
|
+
props: {
|
|
21
|
+
feedbackChoice: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false,
|
|
24
|
+
default: null,
|
|
25
|
+
validator: value => value === null || ['thumbs_up', 'thumbs_down'].includes(value)
|
|
26
|
+
},
|
|
27
|
+
submitted: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: false,
|
|
30
|
+
default: false
|
|
31
|
+
}
|
|
86
32
|
},
|
|
87
33
|
computed: {
|
|
88
34
|
isThumbsUp() {
|
|
89
|
-
return this.
|
|
35
|
+
return this.feedbackChoice === 'thumbs_up';
|
|
90
36
|
},
|
|
91
37
|
isThumbsDown() {
|
|
92
|
-
return this.
|
|
93
|
-
},
|
|
94
|
-
reasonOptions() {
|
|
95
|
-
return this.isThumbsUp ? this.$options.thumbsUpReasons : this.$options.thumbsDownReasons;
|
|
96
|
-
},
|
|
97
|
-
reasonHeader() {
|
|
98
|
-
return this.isThumbsUp ? this.$options.i18n.THUMBS_UP_HEADER : this.$options.i18n.THUMBS_DOWN_HEADER;
|
|
99
|
-
},
|
|
100
|
-
isOverCharacterLimit() {
|
|
101
|
-
return this.customFeedback.length > 140;
|
|
102
|
-
},
|
|
103
|
-
trimmedFeedback() {
|
|
104
|
-
return this.customFeedback.trim();
|
|
105
|
-
},
|
|
106
|
-
isTextareaValid() {
|
|
107
|
-
return this.trimmedFeedback.length === 0 ? null : !this.isOverCharacterLimit;
|
|
108
|
-
},
|
|
109
|
-
canSubmitCustomFeedback() {
|
|
110
|
-
return this.trimmedFeedback.length > 0 && !this.isOverCharacterLimit;
|
|
38
|
+
return this.feedbackChoice === 'thumbs_down';
|
|
111
39
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (remaining >= 0) {
|
|
115
|
-
return remaining === 1 ? `${remaining} character remaining` : `${remaining} characters remaining`;
|
|
116
|
-
}
|
|
117
|
-
const over = Math.abs(remaining);
|
|
118
|
-
return over === 1 ? `${over} character over limit` : `${over} characters over limit`;
|
|
40
|
+
showButtons() {
|
|
41
|
+
return !this.feedbackChoice && !this.submitted;
|
|
119
42
|
},
|
|
120
|
-
|
|
121
|
-
return this.
|
|
122
|
-
},
|
|
123
|
-
isReasonListVisible() {
|
|
124
|
-
return this.feedbackView === FEEDBACK_VIEW.REASON_LIST;
|
|
125
|
-
},
|
|
126
|
-
isTellUsMoreVisible() {
|
|
127
|
-
return this.feedbackView === FEEDBACK_VIEW.TELL_US_MORE;
|
|
43
|
+
showSelectedIcon() {
|
|
44
|
+
return this.feedbackChoice && !this.submitted;
|
|
128
45
|
}
|
|
129
46
|
},
|
|
130
47
|
methods: {
|
|
131
48
|
selectFeedbackType(type) {
|
|
132
|
-
this
|
|
133
|
-
this.feedbackView = FEEDBACK_VIEW.REASON_LIST;
|
|
134
|
-
this.customFeedback = '';
|
|
135
|
-
this.scrollToDropdown();
|
|
136
|
-
},
|
|
137
|
-
scrollToDropdown() {
|
|
138
|
-
nextTick(() => {
|
|
139
|
-
var _this$$refs$dropdown, _el$scrollIntoView;
|
|
140
|
-
const el = ((_this$$refs$dropdown = this.$refs.dropdown) === null || _this$$refs$dropdown === void 0 ? void 0 : _this$$refs$dropdown.$el) || this.$refs.dropdown;
|
|
141
|
-
el === null || el === void 0 ? void 0 : (_el$scrollIntoView = el.scrollIntoView) === null || _el$scrollIntoView === void 0 ? void 0 : _el$scrollIntoView.call(el, {
|
|
142
|
-
behavior: 'smooth',
|
|
143
|
-
block: 'nearest'
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
selectReason(reason) {
|
|
148
|
-
if (reason.isCustom) {
|
|
149
|
-
this.feedbackView = FEEDBACK_VIEW.TELL_US_MORE;
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
this.submitFeedback(reason.key);
|
|
153
|
-
},
|
|
154
|
-
submitCustomFeedback() {
|
|
155
|
-
this.submitFeedback(`custom_${this.customFeedback.trim()}`);
|
|
156
|
-
},
|
|
157
|
-
submitFeedback(feedbackReason) {
|
|
158
|
-
this.$emit('feedback', {
|
|
159
|
-
feedbackType: this.feedbackType,
|
|
160
|
-
feedbackReason
|
|
161
|
-
});
|
|
162
|
-
this.feedbackView = FEEDBACK_VIEW.CLOSED;
|
|
163
|
-
this.feedbackSubmitted = true;
|
|
164
|
-
},
|
|
165
|
-
goBackToReasons() {
|
|
166
|
-
this.feedbackView = FEEDBACK_VIEW.REASON_LIST;
|
|
167
|
-
this.customFeedback = '';
|
|
168
|
-
},
|
|
169
|
-
closeDropdown() {
|
|
170
|
-
this.feedbackView = FEEDBACK_VIEW.CLOSED;
|
|
171
|
-
this.customFeedback = '';
|
|
172
|
-
this.feedbackType = null;
|
|
49
|
+
this.$emit('select-type', type);
|
|
173
50
|
}
|
|
174
51
|
}
|
|
175
52
|
};
|
|
@@ -178,7 +55,7 @@ var script = {
|
|
|
178
55
|
const __vue_script__ = script;
|
|
179
56
|
|
|
180
57
|
/* template */
|
|
181
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"agentic-binary-feedback gl-flex gl-items-center gl-gap-2"
|
|
58
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"agentic-binary-feedback gl-flex gl-items-center gl-gap-2"},[(_vm.showButtons)?[_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"title":_vm.$options.i18n.THUMBS_UP,"aria-label":_vm.$options.i18n.THUMBS_UP,"icon":"thumb-up","category":"tertiary","size":"small","data-testid":"thumb-up-button"},on:{"click":function($event){return _vm.selectFeedbackType('thumbs_up')}}}),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"title":_vm.$options.i18n.THUMBS_DOWN,"aria-label":_vm.$options.i18n.THUMBS_DOWN,"icon":"thumb-down","category":"tertiary","size":"small","data-testid":"thumb-down-button"},on:{"click":function($event){return _vm.selectFeedbackType('thumbs_down')}}})]:(_vm.showSelectedIcon)?_c('div',{staticClass:"gl-flex gl-h-6 gl-items-center"},[_c('gl-icon',{class:_vm.isThumbsUp ? 'gl-text-success' : 'gl-text-danger',attrs:{"name":_vm.isThumbsUp ? 'thumb-up' : 'thumb-down',"size":16,"data-testid":"selected-thumb-icon"}})],1):(_vm.submitted)?_c('div',{staticClass:"gl-relative gl-flex gl-items-center gl-gap-2",attrs:{"data-testid":"feedback-given"}},[_c('div',{staticClass:"feedback-colored-icon",attrs:{"data-testid":"feedback-colored-icon"}},[(_vm.isThumbsUp)?_c('gl-icon',{staticClass:"gl-text-success",attrs:{"name":"thumb-up","size":16,"data-testid":"thumb-up-icon-success"}}):(_vm.isThumbsDown)?_c('gl-icon',{staticClass:"gl-text-danger",attrs:{"name":"thumb-down","size":16,"data-testid":"thumb-down-icon-danger"}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"feedback-thanks gl-m-l-0 gl-w-0 gl-overflow-hidden gl-whitespace-nowrap gl-opacity-0",attrs:{"data-testid":"feedback-thanks"}},[_c('gl-icon',{staticClass:"gl-text-success",attrs:{"name":"check-xs","size":16,"data-testid":"check-icon"}}),_vm._v(" "),_c('span',{staticClass:"gl-text-sm gl-text-subtle"},[_vm._v(_vm._s(_vm.$options.i18n.THANKS))])],1)]):_vm._e()],2)};
|
|
182
59
|
var __vue_staticRenderFns__ = [];
|
|
183
60
|
|
|
184
61
|
/* style */
|
|
@@ -211,4 +88,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
211
88
|
);
|
|
212
89
|
|
|
213
90
|
export default __vue_component__;
|
|
214
|
-
export {
|
|
91
|
+
export { i18n };
|
package/dist/components/agentic_chat/components/agentic_feedback_panel/agentic_feedback_panel.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { GlButton, GlFormTextarea, GlForm } from '@gitlab/ui';
|
|
2
|
+
import { translate } from '@gitlab/ui/dist/utils/i18n';
|
|
3
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
const i18n = {
|
|
6
|
+
TELL_US_MORE: translate('AgenticBinaryFeedback.tellUsMore', 'Tell us more'),
|
|
7
|
+
SUBMIT: translate('AgenticBinaryFeedback.submit', 'Submit'),
|
|
8
|
+
BACK: translate('AgenticBinaryFeedback.back', 'Back'),
|
|
9
|
+
CLOSE: translate('AgenticBinaryFeedback.close', 'Close'),
|
|
10
|
+
FEEDBACK_PLACEHOLDER: translate('AgenticBinaryFeedback.placeholder', 'Share your feedback...'),
|
|
11
|
+
THUMBS_UP_HEADER: translate('AgenticBinaryFeedback.thumbsUpHeader', 'What made this helpful?'),
|
|
12
|
+
THUMBS_DOWN_HEADER: translate('AgenticBinaryFeedback.thumbsDownHeader', 'What would have been more helpful?'),
|
|
13
|
+
TOO_GENERIC: translate('AgenticBinaryFeedback.tooGeneric', 'Too generic'),
|
|
14
|
+
MISSING_STEPS: translate('AgenticBinaryFeedback.missingSteps', 'Missing steps'),
|
|
15
|
+
WRONG_CONTEXT: translate('AgenticBinaryFeedback.wrongContext', 'Wrong context'),
|
|
16
|
+
OUTDATED_INCORRECT: translate('AgenticBinaryFeedback.outdatedIncorrect', 'Outdated/incorrect'),
|
|
17
|
+
SOLVED_PROBLEM: translate('AgenticBinaryFeedback.solvedProblem', 'Solved my problem'),
|
|
18
|
+
SAVED_TIME: translate('AgenticBinaryFeedback.savedTime', 'Saved me time'),
|
|
19
|
+
GOOD_EXAMPLES: translate('AgenticBinaryFeedback.goodExamples', 'Good examples'),
|
|
20
|
+
ACCURATE_INFO: translate('AgenticBinaryFeedback.accurateInfo', 'Accurate information')
|
|
21
|
+
};
|
|
22
|
+
const PANEL_VIEW = {
|
|
23
|
+
REASON_LIST: 'reason_list',
|
|
24
|
+
TELL_US_MORE: 'tell_us_more'
|
|
25
|
+
};
|
|
26
|
+
const thumbsDownReasons = [{
|
|
27
|
+
key: 'too_generic',
|
|
28
|
+
label: i18n.TOO_GENERIC
|
|
29
|
+
}, {
|
|
30
|
+
key: 'missing_steps',
|
|
31
|
+
label: i18n.MISSING_STEPS
|
|
32
|
+
}, {
|
|
33
|
+
key: 'wrong_context',
|
|
34
|
+
label: i18n.WRONG_CONTEXT
|
|
35
|
+
}, {
|
|
36
|
+
key: 'outdated_incorrect',
|
|
37
|
+
label: i18n.OUTDATED_INCORRECT
|
|
38
|
+
}, {
|
|
39
|
+
key: 'tell_us_more',
|
|
40
|
+
label: i18n.TELL_US_MORE,
|
|
41
|
+
isCustom: true
|
|
42
|
+
}];
|
|
43
|
+
const thumbsUpReasons = [{
|
|
44
|
+
key: 'solved_problem',
|
|
45
|
+
label: i18n.SOLVED_PROBLEM
|
|
46
|
+
}, {
|
|
47
|
+
key: 'saved_time',
|
|
48
|
+
label: i18n.SAVED_TIME
|
|
49
|
+
}, {
|
|
50
|
+
key: 'good_examples',
|
|
51
|
+
label: i18n.GOOD_EXAMPLES
|
|
52
|
+
}, {
|
|
53
|
+
key: 'accurate_info',
|
|
54
|
+
label: i18n.ACCURATE_INFO
|
|
55
|
+
}, {
|
|
56
|
+
key: 'tell_us_more',
|
|
57
|
+
label: i18n.TELL_US_MORE,
|
|
58
|
+
isCustom: true
|
|
59
|
+
}];
|
|
60
|
+
const CHARACTER_LIMIT = 140;
|
|
61
|
+
var script = {
|
|
62
|
+
name: 'AgenticFeedbackPanel',
|
|
63
|
+
i18n,
|
|
64
|
+
thumbsUpReasons,
|
|
65
|
+
thumbsDownReasons,
|
|
66
|
+
components: {
|
|
67
|
+
GlButton,
|
|
68
|
+
GlFormTextarea,
|
|
69
|
+
GlForm
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
feedbackType: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: true,
|
|
75
|
+
validator: value => ['thumbs_up', 'thumbs_down'].includes(value)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
panelView: PANEL_VIEW.REASON_LIST,
|
|
81
|
+
customFeedback: ''
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
computed: {
|
|
85
|
+
isThumbsUp() {
|
|
86
|
+
return this.feedbackType === 'thumbs_up';
|
|
87
|
+
},
|
|
88
|
+
reasonOptions() {
|
|
89
|
+
return this.isThumbsUp ? this.$options.thumbsUpReasons : this.$options.thumbsDownReasons;
|
|
90
|
+
},
|
|
91
|
+
reasonHeader() {
|
|
92
|
+
return this.isThumbsUp ? this.$options.i18n.THUMBS_UP_HEADER : this.$options.i18n.THUMBS_DOWN_HEADER;
|
|
93
|
+
},
|
|
94
|
+
isOverCharacterLimit() {
|
|
95
|
+
return this.customFeedback.length > CHARACTER_LIMIT;
|
|
96
|
+
},
|
|
97
|
+
trimmedFeedback() {
|
|
98
|
+
return this.customFeedback.trim();
|
|
99
|
+
},
|
|
100
|
+
isTextareaValid() {
|
|
101
|
+
return this.trimmedFeedback.length === 0 ? null : !this.isOverCharacterLimit;
|
|
102
|
+
},
|
|
103
|
+
canSubmitCustomFeedback() {
|
|
104
|
+
return this.trimmedFeedback.length > 0 && !this.isOverCharacterLimit;
|
|
105
|
+
},
|
|
106
|
+
characterCountText() {
|
|
107
|
+
const remaining = CHARACTER_LIMIT - this.customFeedback.length;
|
|
108
|
+
if (remaining >= 0) {
|
|
109
|
+
return remaining === 1 ? `${remaining} character remaining` : `${remaining} characters remaining`;
|
|
110
|
+
}
|
|
111
|
+
const over = Math.abs(remaining);
|
|
112
|
+
return over === 1 ? `${over} character over limit` : `${over} characters over limit`;
|
|
113
|
+
},
|
|
114
|
+
isReasonListVisible() {
|
|
115
|
+
return this.panelView === PANEL_VIEW.REASON_LIST;
|
|
116
|
+
},
|
|
117
|
+
isTellUsMoreVisible() {
|
|
118
|
+
return this.panelView === PANEL_VIEW.TELL_US_MORE;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
methods: {
|
|
122
|
+
selectReason(reason) {
|
|
123
|
+
if (reason.isCustom) {
|
|
124
|
+
this.panelView = PANEL_VIEW.TELL_US_MORE;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.$emit('submit', {
|
|
128
|
+
feedbackType: this.feedbackType,
|
|
129
|
+
feedbackReason: reason.key
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
submitCustomFeedback() {
|
|
133
|
+
this.$emit('submit', {
|
|
134
|
+
feedbackType: this.feedbackType,
|
|
135
|
+
feedbackReason: `custom_${this.customFeedback.trim()}`
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
goBackToReasons() {
|
|
139
|
+
this.panelView = PANEL_VIEW.REASON_LIST;
|
|
140
|
+
this.customFeedback = '';
|
|
141
|
+
},
|
|
142
|
+
close() {
|
|
143
|
+
this.$emit('close');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/* script */
|
|
149
|
+
const __vue_script__ = script;
|
|
150
|
+
|
|
151
|
+
/* template */
|
|
152
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"agentic-feedback-panel gl-border gl-mt-2 gl-rounded-lg gl-border-default gl-bg-subtle gl-p-3",attrs:{"data-testid":"feedback-reason-dropdown"}},[_c('div',{staticClass:"gl-mb-3 gl-flex gl-items-center gl-justify-between gl-gap-2"},[_c('p',{staticClass:"gl-m-0 gl-text-sm gl-font-bold",attrs:{"data-testid":"reason-header"}},[_vm._v("\n "+_vm._s(_vm.reasonHeader)+"\n ")]),_vm._v(" "),_c('div',{staticClass:"gl-flex gl-shrink-0 gl-items-center gl-gap-1"},[(_vm.isTellUsMoreVisible)?_c('gl-button',{attrs:{"icon":"go-back","category":"tertiary","size":"small","aria-label":_vm.$options.i18n.BACK,"data-testid":"back-button"},on:{"click":_vm.goBackToReasons}}):_vm._e(),_vm._v(" "),_c('gl-button',{staticClass:"gl-mr-[-5px]",attrs:{"icon":"close","category":"tertiary","size":"small","aria-label":_vm.$options.i18n.CLOSE,"data-testid":"close-dropdown-button"},on:{"click":_vm.close}})],1)]),_vm._v(" "),(_vm.isReasonListVisible)?_c('div',{staticClass:"gl-flex gl-flex-wrap gl-gap-2",attrs:{"data-testid":"reason-buttons"}},_vm._l((_vm.reasonOptions),function(reason){return _c('gl-button',{key:reason.key,staticClass:"gl-rounded-full",attrs:{"category":"secondary","size":"small","icon":reason.isCustom ? 'pencil' : undefined,"data-testid":("reason-" + (reason.key))},on:{"click":function($event){return _vm.selectReason(reason)}}},[_vm._v("\n "+_vm._s(reason.label)+"\n ")])}),1):_vm._e(),_vm._v(" "),(_vm.isTellUsMoreVisible)?_c('div',{staticClass:"gl-flex gl-w-full gl-flex-col gl-gap-3",attrs:{"data-testid":"tell-us-more-view"}},[_c('gl-form',{staticClass:"gl-flex gl-w-full gl-flex-col gl-gap-3",on:{"submit":function($event){$event.preventDefault();_vm.canSubmitCustomFeedback ? _vm.submitCustomFeedback() : null;}}},[_c('gl-form-textarea',{attrs:{"state":_vm.isTextareaValid,"placeholder":_vm.$options.i18n.FEEDBACK_PLACEHOLDER,"rows":3,"max-rows":5,"data-testid":"custom-feedback-textarea"},model:{value:(_vm.customFeedback),callback:function ($$v) {_vm.customFeedback=$$v;},expression:"customFeedback"}}),_vm._v(" "),_c('div',{staticClass:"gl-flex gl-items-center gl-justify-between"},[_c('gl-button',{attrs:{"variant":"confirm","size":"small","type":"submit","data-testid":"submit-custom-feedback-button"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.SUBMIT)+"\n ")]),_vm._v(" "),_c('span',{staticClass:"gl-text-sm",class:_vm.isOverCharacterLimit ? 'gl-text-danger' : 'gl-text-subtle',attrs:{"data-testid":"character-count"}},[_vm._v("\n "+_vm._s(_vm.characterCountText)+"\n ")])],1)],1)],1):_vm._e()])};
|
|
153
|
+
var __vue_staticRenderFns__ = [];
|
|
154
|
+
|
|
155
|
+
/* style */
|
|
156
|
+
const __vue_inject_styles__ = undefined;
|
|
157
|
+
/* scoped */
|
|
158
|
+
const __vue_scope_id__ = undefined;
|
|
159
|
+
/* module identifier */
|
|
160
|
+
const __vue_module_identifier__ = undefined;
|
|
161
|
+
/* functional template */
|
|
162
|
+
const __vue_is_functional_template__ = false;
|
|
163
|
+
/* style inject */
|
|
164
|
+
|
|
165
|
+
/* style inject SSR */
|
|
166
|
+
|
|
167
|
+
/* style inject shadow dom */
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
const __vue_component__ = __vue_normalize__(
|
|
172
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
173
|
+
__vue_inject_styles__,
|
|
174
|
+
__vue_script__,
|
|
175
|
+
__vue_scope_id__,
|
|
176
|
+
__vue_is_functional_template__,
|
|
177
|
+
__vue_module_identifier__,
|
|
178
|
+
false,
|
|
179
|
+
undefined,
|
|
180
|
+
undefined,
|
|
181
|
+
undefined
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
export default __vue_component__;
|
|
185
|
+
export { PANEL_VIEW, i18n, thumbsDownReasons, thumbsUpReasons };
|
|
@@ -6,6 +6,8 @@ import { SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED, MESSAGE_MODEL_ROLES } from '.
|
|
|
6
6
|
import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources';
|
|
7
7
|
import { concatUntilEmpty, copyToClipboard } from '../utils';
|
|
8
8
|
import AgenticBinaryFeedback from '../../../agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback';
|
|
9
|
+
import AgenticFeedbackPanel from '../../../agentic_chat/components/agentic_feedback_panel/agentic_feedback_panel';
|
|
10
|
+
import MessageActionBar from '../message_action_bar/message_action_bar';
|
|
9
11
|
import MessageFeedback from './message_feedback';
|
|
10
12
|
import MarkdownRenderer from './markdown_renderer';
|
|
11
13
|
import { CopyCodeElement } from './copy_code_element';
|
|
@@ -28,8 +30,10 @@ var script = {
|
|
|
28
30
|
},
|
|
29
31
|
components: {
|
|
30
32
|
AgenticBinaryFeedback,
|
|
33
|
+
AgenticFeedbackPanel,
|
|
31
34
|
DocumentationSources,
|
|
32
35
|
DuoChatContextItemSelections,
|
|
36
|
+
MessageActionBar,
|
|
33
37
|
MessageFeedback,
|
|
34
38
|
MessageMap,
|
|
35
39
|
GlIcon,
|
|
@@ -115,7 +119,9 @@ var script = {
|
|
|
115
119
|
// imperatively set up watcher on message
|
|
116
120
|
messageChunks: [],
|
|
117
121
|
selectedContextItemsDefaultCollapsed: SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED,
|
|
118
|
-
copied: false
|
|
122
|
+
copied: false,
|
|
123
|
+
feedbackChoice: null,
|
|
124
|
+
feedbackSubmitted: false
|
|
119
125
|
};
|
|
120
126
|
},
|
|
121
127
|
computed: {
|
|
@@ -295,6 +301,16 @@ var script = {
|
|
|
295
301
|
e.classList.remove(DUO_CODE_SCRIM_TOP_CLASS);
|
|
296
302
|
}
|
|
297
303
|
},
|
|
304
|
+
onFeedbackTypeSelected(type) {
|
|
305
|
+
this.feedbackChoice = type;
|
|
306
|
+
},
|
|
307
|
+
onFeedbackPanelSubmit(payload) {
|
|
308
|
+
this.feedbackSubmitted = true;
|
|
309
|
+
this.logEvent(payload);
|
|
310
|
+
},
|
|
311
|
+
onFeedbackPanelClose() {
|
|
312
|
+
this.feedbackChoice = null;
|
|
313
|
+
},
|
|
298
314
|
async copyMessage() {
|
|
299
315
|
try {
|
|
300
316
|
await copyToClipboard(this.message.content, this.$el);
|
|
@@ -325,7 +341,10 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
|
|
|
325
341
|
'duo-chat-message-complete': _vm.isDoneStreaming,
|
|
326
342
|
},on:{"insert-code-snippet":_vm.onInsertCodeSnippet,"copy-code-snippet":_vm.onCopyCodeSnippet}},[(_vm.error)?_c('div',{ref:"error-message",staticClass:"duo-chat-message-with-error gl-flex gl-bg-feedback-danger gl-p-4"},[(_vm.error)?_c('gl-icon',{staticClass:"error-icon !gl-mt-1 gl-mr-3 gl-shrink-0 gl-text-danger",attrs:{"aria-label":_vm.$options.i18n.MESSAGE_ERROR,"name":"error","size":16,"data-testid":"error"}}):_vm._e(),_vm._v(" "),(_vm.error)?_c('markdown-renderer',{ref:"error-message",staticClass:"duo-chat-message-error",attrs:{"markdown":_vm.renderedError,"trusted-urls":_vm.trustedUrls}}):_vm._e()],1):(_vm.isAssistantMessage || _vm.isUserMessage)?[_c('div',{staticClass:"gl-sr-only"},[_vm._v("\n "+_vm._s(_vm.isUserMessage ? _vm.$options.i18n.FROM_ME : _vm.$options.i18n.FROM_DUO)+"\n ")]),_vm._v(" "),(_vm.displaySelectedContextItems && _vm.isAssistantMessage)?_c('duo-chat-context-item-selections',{attrs:{"selections":_vm.selectedContextItems,"title":_vm.selectedContextItemsTitle,"default-collapsed":_vm.selectedContextItemsDefaultCollapsed,"variant":"assistant"},on:{"get-content":_vm.onGetContextItemContent}}):_vm._e(),_vm._v(" "),_c('markdown-renderer',{ref:"content",staticClass:"duo-chat-message",class:{
|
|
327
343
|
'gl-bg-feedback-info gl-p-4 gl-text-feedback-info': _vm.isUserMessage,
|
|
328
|
-
},attrs:{"is-html":_vm.hasContentHtml,"markdown":_vm.messageContent,"trusted-urls":_vm.trustedUrls}}),_vm._v(" "),(_vm.sources)?_c('documentation-sources',{attrs:{"sources":_vm.sources}}):_vm._e(),_vm._v(" "),(_vm.isAssistantMessage)?_c('
|
|
344
|
+
},attrs:{"is-html":_vm.hasContentHtml,"markdown":_vm.messageContent,"trusted-urls":_vm.trustedUrls}}),_vm._v(" "),(_vm.sources)?_c('documentation-sources',{attrs:{"sources":_vm.sources}}):_vm._e(),_vm._v(" "),(_vm.isAssistantMessage)?[_c('message-action-bar',[(_vm.isChunkAndNotCancelled)?_c('gl-animated-loader-icon',{attrs:{"is-on":true}}):_vm._e(),_vm._v(" "),(_vm.shouldShowFeedbackLink && _vm.isBinaryFeedbackEnabled)?[(_vm.showBinaryFeedback)?_c('agentic-binary-feedback',{attrs:{"feedback-choice":_vm.feedbackChoice,"submitted":_vm.feedbackSubmitted,"data-testid":"agentic-feedback-latest"},on:{"select-type":_vm.onFeedbackTypeSelected}}):_c('div',{staticClass:"agentic-feedback-hover-wrapper",class:{
|
|
345
|
+
'-gl-mr-3 gl-w-0 gl-overflow-hidden gl-opacity-0':
|
|
346
|
+
!_vm.feedbackChoice && !_vm.feedbackSubmitted,
|
|
347
|
+
},attrs:{"data-testid":"agentic-feedback-hover-container"}},[_c('agentic-binary-feedback',{attrs:{"feedback-choice":_vm.feedbackChoice,"submitted":_vm.feedbackSubmitted},on:{"select-type":_vm.onFeedbackTypeSelected}})],1)]:(_vm.shouldShowFeedbackLink)?_c('message-feedback',{attrs:{"has-feedback":_vm.hasFeedback},on:{"feedback":_vm.logEvent}}):_vm._e(),_vm._v(" "),(_vm.shouldShowCopyAction)?_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:{ '!gl-text-success': _vm.copied, '!gl-text-subtle': !_vm.copied },attrs:{"title":_vm.copied ? _vm.$options.i18n.CHAT_MESSAGE_COPIED : _vm.$options.i18n.CHAT_MESSAGE_COPY,"icon":_vm.copied ? 'check-circle-filled' : 'copy-to-clipboard',"category":"tertiary","size":"small"},on:{"click":_vm.copyMessage,"focusout":function($event){_vm.copied = false;}}}):_vm._e()],2),_vm._v(" "),(_vm.feedbackChoice && !_vm.feedbackSubmitted)?_c('agentic-feedback-panel',{attrs:{"feedback-type":_vm.feedbackChoice},on:{"submit":_vm.onFeedbackPanelSubmit,"close":_vm.onFeedbackPanelClose}}):_vm._e()]:_vm._e(),_vm._v(" "),(_vm.displaySelectedContextItems && _vm.isUserMessage)?_c('duo-chat-context-item-selections',{attrs:{"selections":_vm.selectedContextItems,"title":_vm.selectedContextItemsTitle,"default-collapsed":_vm.selectedContextItemsDefaultCollapsed,"variant":"user"},on:{"get-content":_vm.onGetContextItemContent}}):_vm._e()]:_c('message-map',{attrs:{"message":_vm.message,"with-feedback":_vm.withFeedback,"working-directory":_vm.workingDirectory,"data-testid":"workflow-message"},on:{"open-file-path":_vm.onOpenFilePath,"feedback":_vm.logEvent}})],2)};
|
|
329
348
|
var __vue_staticRenderFns__ = [];
|
|
330
349
|
|
|
331
350
|
/* style */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { GlButton, GlAvatar } from '@gitlab/ui';
|
|
1
|
+
import { GlButton, GlAvatar, GlSearchBoxByType } from '@gitlab/ui';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
2
3
|
import { translate, sprintf } from '../../../../utils/i18n';
|
|
3
4
|
import { formatLocalizedDate } from '../../../../utils/date';
|
|
5
|
+
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '../../constants';
|
|
4
6
|
import DuoChatThreadsEmpty from './duo_chat_threads_empty';
|
|
5
7
|
import DuoChatThreadsSkeleton from './duo_chat_threads_skeleton_loader';
|
|
6
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
@@ -9,13 +11,17 @@ const i18n = {
|
|
|
9
11
|
CHAT_HISTORY_INFO: translate('DuoChat.chatHistoryInfo', 'Inactive chats are deleted after 30 days.'),
|
|
10
12
|
THREAD_DELETE_LABEL: translate('DuoChat.threadDeleteLabel', 'Delete this chat'),
|
|
11
13
|
OPEN_CHAT_LABEL: translate('DuoChat.openChatLabel', 'Open chat: %{title}'),
|
|
12
|
-
UNTITLED_CHAT_TITLE: translate('DuoChat.untitledChatTitle', 'Untitled Chat')
|
|
14
|
+
UNTITLED_CHAT_TITLE: translate('DuoChat.untitledChatTitle', 'Untitled Chat'),
|
|
15
|
+
SEARCH_PLACEHOLDER: translate('DuoChat.searchPlaceholder', 'Search chats...'),
|
|
16
|
+
NO_RESULTS: translate('DuoChat.noSearchResults', 'No results found'),
|
|
17
|
+
CHAT_HISTORY_SEARCH: translate('DuoChat.chatHistorySearch', 'Search chat history')
|
|
13
18
|
};
|
|
14
19
|
var script = {
|
|
15
20
|
name: 'DuoChatHistory',
|
|
16
21
|
components: {
|
|
17
22
|
GlButton,
|
|
18
23
|
GlAvatar,
|
|
24
|
+
GlSearchBoxByType,
|
|
19
25
|
DuoChatThreadsEmpty,
|
|
20
26
|
DuoChatThreadsSkeleton
|
|
21
27
|
},
|
|
@@ -34,12 +40,32 @@ var script = {
|
|
|
34
40
|
default: false
|
|
35
41
|
}
|
|
36
42
|
},
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
searchQuery: '',
|
|
46
|
+
debouncedSearchQuery: ''
|
|
47
|
+
};
|
|
48
|
+
},
|
|
37
49
|
computed: {
|
|
50
|
+
filteredThreads() {
|
|
51
|
+
if (!this.debouncedSearchQuery.trim()) {
|
|
52
|
+
return this.threads;
|
|
53
|
+
}
|
|
54
|
+
const query = this.debouncedSearchQuery.trim();
|
|
55
|
+
return this.threads.filter(thread => {
|
|
56
|
+
const {
|
|
57
|
+
title = '',
|
|
58
|
+
goal = '',
|
|
59
|
+
agentName = ''
|
|
60
|
+
} = thread;
|
|
61
|
+
return title.includes(query) || goal.includes(query) || agentName.includes(query);
|
|
62
|
+
});
|
|
63
|
+
},
|
|
38
64
|
groupedThreads() {
|
|
39
|
-
if (!this.
|
|
65
|
+
if (!this.hasFilteredThreads) {
|
|
40
66
|
return {};
|
|
41
67
|
}
|
|
42
|
-
return this.
|
|
68
|
+
return this.filteredThreads.slice().sort((a, b) => this.compareThreadDates(b.updatedAt, a.updatedAt)).sort((a, b) => this.compareThreadDates(b.lastUpdatedAt, a.lastUpdatedAt)).reduce((grouped, thread) => {
|
|
43
69
|
const dateField = thread.updatedAt || thread.lastUpdatedAt;
|
|
44
70
|
const dateKey = this.getDateKey(dateField);
|
|
45
71
|
return {
|
|
@@ -50,8 +76,21 @@ var script = {
|
|
|
50
76
|
},
|
|
51
77
|
hasThreads() {
|
|
52
78
|
return this.threads.length > 0;
|
|
79
|
+
},
|
|
80
|
+
hasFilteredThreads() {
|
|
81
|
+
return this.filteredThreads.length > 0;
|
|
53
82
|
}
|
|
54
83
|
},
|
|
84
|
+
watch: {
|
|
85
|
+
searchQuery(newValue) {
|
|
86
|
+
this.updateDebouncedSearchQuery(newValue);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
created() {
|
|
90
|
+
this.updateDebouncedSearchQuery = debounce(value => {
|
|
91
|
+
this.debouncedSearchQuery = value;
|
|
92
|
+
}, DEFAULT_DEBOUNCE_AND_THROTTLE_MS);
|
|
93
|
+
},
|
|
55
94
|
methods: {
|
|
56
95
|
threadLabel(thread) {
|
|
57
96
|
return thread.title || thread.goal || i18n.UNTITLED_CHAT_TITLE;
|
|
@@ -88,9 +127,9 @@ var script = {
|
|
|
88
127
|
const __vue_script__ = script;
|
|
89
128
|
|
|
90
129
|
/* template */
|
|
91
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-flex-col gl-overflow-hidden"},[(_vm.loading)?_c('duo-chat-threads-skeleton'):(_vm.hasThreads)?[_c('div',{staticClass:"gl-grow gl-overflow-y-scroll gl-px-4 gl-py-5"},_vm._l((_vm.groupedThreads),function(threadsForDate,date){return _c('div',{key:date,staticClass:"gl-mb-3"},[_c('div',{staticClass:"gl-mb-3 gl-text-base gl-font-bold gl-text-default",attrs:{"data-testid":"chat-threads-date-header"}},[_vm._v("\n "+_vm._s(_vm.formattedLocalDate(date))+"\n ")]),_vm._v(" "),_vm._l((threadsForDate),function(thread){return _c('div',{key:thread.id,staticClass:"history-item gl-w-full gl-text-base"},[_c('gl-button',{staticClass:"history-item-name gl-w-full gl-text-base",attrs:{"data-testid":"chat-threads-thread-box","aria-label":_vm.sprintf(_vm.$options.i18n.OPEN_CHAT_LABEL, {
|
|
130
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-flex-col gl-overflow-hidden"},[(_vm.loading)?_c('duo-chat-threads-skeleton'):(_vm.hasThreads)?[_c('div',{staticClass:"gl-px-4 gl-pt-4"},[_c('span',{staticClass:"gl-sr-only"},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_HISTORY_SEARCH))]),_vm._v(" "),_c('gl-search-box-by-type',{attrs:{"data-testid":"chat-threads-search-input","placeholder":_vm.$options.i18n.SEARCH_PLACEHOLDER},model:{value:(_vm.searchQuery),callback:function ($$v) {_vm.searchQuery=$$v;},expression:"searchQuery"}})],1),_vm._v(" "),_c('div',{staticClass:"gl-grow gl-overflow-y-scroll gl-px-4 gl-py-5"},[(!_vm.hasFilteredThreads)?_c('p',{staticClass:"gl-mb-0 gl-text-center gl-text-subtle",attrs:{"data-testid":"chat-threads-no-results"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.NO_RESULTS)+"\n ")]):_vm._e(),_vm._v(" "),_vm._l((_vm.groupedThreads),function(threadsForDate,date){return _c('div',{key:date,staticClass:"gl-mb-3"},[_c('div',{staticClass:"gl-mb-3 gl-text-base gl-font-bold gl-text-default",attrs:{"data-testid":"chat-threads-date-header"}},[_vm._v("\n "+_vm._s(_vm.formattedLocalDate(date))+"\n ")]),_vm._v(" "),_vm._l((threadsForDate),function(thread){return _c('div',{key:thread.id,staticClass:"history-item gl-w-full gl-text-base"},[_c('gl-button',{staticClass:"history-item-name gl-w-full gl-text-base",attrs:{"data-testid":"chat-threads-thread-box","aria-label":_vm.sprintf(_vm.$options.i18n.OPEN_CHAT_LABEL, {
|
|
92
131
|
title: _vm.threadLabel(thread),
|
|
93
|
-
})},on:{"click":function($event){return _vm.onSelectThread(thread)}}},[_c('gl-avatar',{staticClass:"gl-shrink-0",attrs:{"size":32,"entity-name":_vm.threadLabel(thread),"shape":"circle"}}),_vm._v(" "),_c('div',{staticClass:"gl-grow gl-whitespace-normal gl-break-all"},[(!thread.title && !thread.goal)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-default"},[_vm._v(_vm._s(_vm.$options.i18n.UNTITLED_CHAT_TITLE))]):[(thread.title)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-default"},[_vm._v(_vm._s(thread.title))]):_vm._e(),_vm._v(" "),(thread.goal)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-subtle"},[_vm._v(_vm._s(thread.goal))]):_vm._e()],_vm._v(" "),(thread.agentName)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-sm gl-text-subtle"},[_vm._v("\n "+_vm._s(thread.agentName)+"\n ")]):_vm._e()],2)],1),_vm._v(" "),_c('gl-button',{staticClass:"history-remove-button",attrs:{"data-testid":"chat-threads-delete-thread-button","icon":"remove","category":"tertiary","title":_vm.$options.i18n.THREAD_DELETE_LABEL,"aria-label":_vm.$options.i18n.THREAD_DELETE_LABEL},on:{"click":function($event){return _vm.$emit('delete-thread', thread.id)}}})],1)})],2)}),
|
|
132
|
+
})},on:{"click":function($event){return _vm.onSelectThread(thread)}}},[_c('gl-avatar',{staticClass:"gl-shrink-0",attrs:{"size":32,"entity-name":_vm.threadLabel(thread),"shape":"circle"}}),_vm._v(" "),_c('div',{staticClass:"gl-grow gl-whitespace-normal gl-break-all"},[(!thread.title && !thread.goal)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-default"},[_vm._v(_vm._s(_vm.$options.i18n.UNTITLED_CHAT_TITLE))]):[(thread.title)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-default"},[_vm._v(_vm._s(thread.title))]):_vm._e(),_vm._v(" "),(thread.goal)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-subtle"},[_vm._v(_vm._s(thread.goal))]):_vm._e()],_vm._v(" "),(thread.agentName)?_c('span',{staticClass:"gl-line-clamp-1 gl-text-sm gl-text-subtle"},[_vm._v("\n "+_vm._s(thread.agentName)+"\n ")]):_vm._e()],2)],1),_vm._v(" "),_c('gl-button',{staticClass:"history-remove-button",attrs:{"data-testid":"chat-threads-delete-thread-button","icon":"remove","category":"tertiary","title":_vm.$options.i18n.THREAD_DELETE_LABEL,"aria-label":_vm.$options.i18n.THREAD_DELETE_LABEL},on:{"click":function($event){return _vm.$emit('delete-thread', thread.id)}}})],1)})],2)})],2),_vm._v(" "),_c('p',{staticClass:"gl-m-0 gl-p-5 gl-text-center gl-text-base gl-text-subtle",attrs:{"data-testid":"chat-threads-info-banner"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.CHAT_HISTORY_INFO)+"\n ")])]:_c('duo-chat-threads-empty')],2)};
|
|
94
133
|
var __vue_staticRenderFns__ = [];
|
|
95
134
|
|
|
96
135
|
/* style */
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
+
|
|
3
|
+
var script = {
|
|
4
|
+
name: 'MessageActionBar'
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
/* script */
|
|
8
|
+
const __vue_script__ = script;
|
|
9
|
+
|
|
10
|
+
/* template */
|
|
11
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"message-action-bar -gl-ml-2 gl-flex gl-items-start gl-gap-3"},[_vm._t("default")],2)};
|
|
12
|
+
var __vue_staticRenderFns__ = [];
|
|
13
|
+
|
|
14
|
+
/* style */
|
|
15
|
+
const __vue_inject_styles__ = undefined;
|
|
16
|
+
/* scoped */
|
|
17
|
+
const __vue_scope_id__ = undefined;
|
|
18
|
+
/* module identifier */
|
|
19
|
+
const __vue_module_identifier__ = undefined;
|
|
20
|
+
/* functional template */
|
|
21
|
+
const __vue_is_functional_template__ = false;
|
|
22
|
+
/* style inject */
|
|
23
|
+
|
|
24
|
+
/* style inject SSR */
|
|
25
|
+
|
|
26
|
+
/* style inject shadow dom */
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const __vue_component__ = __vue_normalize__(
|
|
31
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
32
|
+
__vue_inject_styles__,
|
|
33
|
+
__vue_script__,
|
|
34
|
+
__vue_scope_id__,
|
|
35
|
+
__vue_is_functional_template__,
|
|
36
|
+
__vue_module_identifier__,
|
|
37
|
+
false,
|
|
38
|
+
undefined,
|
|
39
|
+
undefined,
|
|
40
|
+
undefined
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export default __vue_component__;
|
|
@@ -4,6 +4,7 @@ const CHAT_NEW_MESSAGE = '/new';
|
|
|
4
4
|
const CHAT_INCLUDE_MESSAGE = '/include';
|
|
5
5
|
const CHAT_BASE_COMMANDS = [CHAT_RESET_MESSAGE, CHAT_CLEAR_MESSAGE, CHAT_NEW_MESSAGE];
|
|
6
6
|
const LOADING_TRANSITION_DURATION = 7500;
|
|
7
|
+
const DEFAULT_DEBOUNCE_AND_THROTTLE_MS = 250;
|
|
7
8
|
const DOCUMENTATION_SOURCE_TYPES = {
|
|
8
9
|
HANDBOOK: {
|
|
9
10
|
value: 'handbook'
|
|
@@ -59,4 +60,4 @@ const APPROVAL_TOOL_NAMES = {
|
|
|
59
60
|
runGitCommand: 'run_git_command'
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
export { APPROVAL_TOOL_NAMES, CHAT_BASE_COMMANDS, CHAT_CLEAR_MESSAGE, CHAT_INCLUDE_MESSAGE, CHAT_NEW_MESSAGE, CHAT_RESET_MESSAGE, DOCUMENTATION_SOURCE_TYPES, LOADING_TRANSITION_DURATION, MAX_PROMPT_LENGTH, MESSAGE_MODEL_ROLES, PROMPT_LENGTH_WARNING, SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED, acceptedApproveToolPayloads, badgeTypeValidator, badgeTypes };
|
|
63
|
+
export { APPROVAL_TOOL_NAMES, CHAT_BASE_COMMANDS, CHAT_CLEAR_MESSAGE, CHAT_INCLUDE_MESSAGE, CHAT_NEW_MESSAGE, CHAT_RESET_MESSAGE, DEFAULT_DEBOUNCE_AND_THROTTLE_MS, DOCUMENTATION_SOURCE_TYPES, LOADING_TRANSITION_DURATION, MAX_PROMPT_LENGTH, MESSAGE_MODEL_ROLES, PROMPT_LENGTH_WARNING, SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED, acceptedApproveToolPayloads, badgeTypeValidator, badgeTypes };
|