@gitlab/duo-ui 15.10.0 → 15.11.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/dist/components/agentic_chat/agentic_duo_chat.js +1 -1
- 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/agentic_chat/web_agentic_duo_chat.js +1 -1
- 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_selections/duo_chat_context_item_selections.js +1 -1
- package/dist/components/chat/components/duo_chat_message/duo_chat_message.js +22 -3
- package/dist/components/chat/components/duo_chat_message/message_types/message_tool_kv_section.js +1 -1
- package/dist/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.js +1 -2
- package/dist/components/chat/components/duo_chat_threads/duo_chat_threads.js +1 -1
- package/dist/components/chat/components/message_action_bar/message_action_bar.js +43 -0
- package/dist/components/chat/duo_chat.js +1 -1
- package/dist/components/chat/web_duo_chat.js +1 -1
- 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/dist/utils/i18n.js +1 -1
- package/dist/utils/object.js +1 -2
- package/package.json +5 -5
- package/src/components/agentic_chat/agentic_duo_chat.vue +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/agentic_chat/web_agentic_duo_chat.vue +1 -1
- package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +1 -1
- package/src/components/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +1 -1
- package/src/components/chat/components/duo_chat_message/duo_chat_message.vue +65 -34
- package/src/components/chat/components/duo_chat_message/message_types/message_tool_kv_section.vue +1 -1
- package/src/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.vue +1 -2
- package/src/components/chat/components/duo_chat_threads/duo_chat_threads.vue +1 -1
- package/src/components/chat/components/message_action_bar/message_action_bar.vue +11 -0
- package/src/components/chat/duo_chat.vue +1 -1
- package/src/components/chat/web_duo_chat.vue +1 -1
- package/src/utils/i18n.js +1 -1
- package/src/utils/object.js +1 -2
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@gitlab/ui';
|
|
9
9
|
|
|
10
10
|
import { sprintf, translate, translatePlural } from '@gitlab/ui/dist/utils/i18n';
|
|
11
|
-
import throttle from 'lodash
|
|
11
|
+
import { throttle } from 'lodash-es';
|
|
12
12
|
import DuoChatContextItemSelections from '../duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue';
|
|
13
13
|
import { MESSAGE_MODEL_ROLES, SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED } from '../../constants';
|
|
14
14
|
|
|
@@ -16,6 +16,8 @@ import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_s
|
|
|
16
16
|
// eslint-disable-next-line no-restricted-imports
|
|
17
17
|
import { copyToClipboard, concatUntilEmpty } from '../utils';
|
|
18
18
|
import AgenticBinaryFeedback from '../../../agentic_chat/components/agentic_binary_feedback/agentic_binary_feedback.vue';
|
|
19
|
+
import AgenticFeedbackPanel from '../../../agentic_chat/components/agentic_feedback_panel/agentic_feedback_panel.vue';
|
|
20
|
+
import MessageActionBar from '../message_action_bar/message_action_bar.vue';
|
|
19
21
|
import MessageFeedback from './message_feedback.vue';
|
|
20
22
|
import MarkdownRenderer from './markdown_renderer.vue';
|
|
21
23
|
import { CopyCodeElement } from './copy_code_element';
|
|
@@ -43,8 +45,10 @@ export default {
|
|
|
43
45
|
},
|
|
44
46
|
components: {
|
|
45
47
|
AgenticBinaryFeedback,
|
|
48
|
+
AgenticFeedbackPanel,
|
|
46
49
|
DocumentationSources,
|
|
47
50
|
DuoChatContextItemSelections,
|
|
51
|
+
MessageActionBar,
|
|
48
52
|
MessageFeedback,
|
|
49
53
|
MessageMap,
|
|
50
54
|
GlIcon,
|
|
@@ -130,6 +134,8 @@ export default {
|
|
|
130
134
|
messageChunks: [],
|
|
131
135
|
selectedContextItemsDefaultCollapsed: SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED,
|
|
132
136
|
copied: false,
|
|
137
|
+
feedbackChoice: null,
|
|
138
|
+
feedbackSubmitted: false,
|
|
133
139
|
};
|
|
134
140
|
},
|
|
135
141
|
computed: {
|
|
@@ -322,6 +328,16 @@ export default {
|
|
|
322
328
|
e.classList.remove(DUO_CODE_SCRIM_TOP_CLASS);
|
|
323
329
|
}
|
|
324
330
|
},
|
|
331
|
+
onFeedbackTypeSelected(type) {
|
|
332
|
+
this.feedbackChoice = type;
|
|
333
|
+
},
|
|
334
|
+
onFeedbackPanelSubmit(payload) {
|
|
335
|
+
this.feedbackSubmitted = true;
|
|
336
|
+
this.logEvent(payload);
|
|
337
|
+
},
|
|
338
|
+
onFeedbackPanelClose() {
|
|
339
|
+
this.feedbackChoice = null;
|
|
340
|
+
},
|
|
325
341
|
async copyMessage() {
|
|
326
342
|
try {
|
|
327
343
|
await copyToClipboard(this.message.content, this.$el);
|
|
@@ -403,42 +419,57 @@ export default {
|
|
|
403
419
|
|
|
404
420
|
<documentation-sources v-if="sources" :sources="sources" />
|
|
405
421
|
|
|
406
|
-
<
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
422
|
+
<template v-if="isAssistantMessage">
|
|
423
|
+
<message-action-bar>
|
|
424
|
+
<gl-animated-loader-icon v-if="isChunkAndNotCancelled" :is-on="true" />
|
|
425
|
+
<template v-if="shouldShowFeedbackLink && isBinaryFeedbackEnabled">
|
|
426
|
+
<agentic-binary-feedback
|
|
427
|
+
v-if="showBinaryFeedback"
|
|
428
|
+
:feedback-choice="feedbackChoice"
|
|
429
|
+
:submitted="feedbackSubmitted"
|
|
430
|
+
data-testid="agentic-feedback-latest"
|
|
431
|
+
@select-type="onFeedbackTypeSelected"
|
|
432
|
+
/>
|
|
433
|
+
<div
|
|
434
|
+
v-else
|
|
435
|
+
class="agentic-feedback-hover-wrapper"
|
|
436
|
+
:class="{
|
|
437
|
+
'-gl-mr-3 gl-w-0 gl-overflow-hidden gl-opacity-0':
|
|
438
|
+
!feedbackChoice && !feedbackSubmitted,
|
|
439
|
+
}"
|
|
440
|
+
data-testid="agentic-feedback-hover-container"
|
|
441
|
+
>
|
|
442
|
+
<agentic-binary-feedback
|
|
443
|
+
:feedback-choice="feedbackChoice"
|
|
444
|
+
:submitted="feedbackSubmitted"
|
|
445
|
+
@select-type="onFeedbackTypeSelected"
|
|
446
|
+
/>
|
|
447
|
+
</div>
|
|
448
|
+
</template>
|
|
449
|
+
<message-feedback
|
|
450
|
+
v-else-if="shouldShowFeedbackLink"
|
|
451
|
+
:has-feedback="hasFeedback"
|
|
415
452
|
@feedback="logEvent"
|
|
416
453
|
/>
|
|
417
|
-
<
|
|
418
|
-
v-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
:icon="copied ? 'check-circle-filled' : 'copy-to-clipboard'"
|
|
435
|
-
:class="{ '!gl-text-success': copied, '!gl-text-subtle': !copied }"
|
|
436
|
-
category="tertiary"
|
|
437
|
-
size="small"
|
|
438
|
-
@click="copyMessage"
|
|
439
|
-
@focusout="copied = false"
|
|
454
|
+
<gl-button
|
|
455
|
+
v-if="shouldShowCopyAction"
|
|
456
|
+
v-gl-tooltip
|
|
457
|
+
:title="copied ? $options.i18n.CHAT_MESSAGE_COPIED : $options.i18n.CHAT_MESSAGE_COPY"
|
|
458
|
+
:icon="copied ? 'check-circle-filled' : 'copy-to-clipboard'"
|
|
459
|
+
:class="{ '!gl-text-success': copied, '!gl-text-subtle': !copied }"
|
|
460
|
+
category="tertiary"
|
|
461
|
+
size="small"
|
|
462
|
+
@click="copyMessage"
|
|
463
|
+
@focusout="copied = false"
|
|
464
|
+
/>
|
|
465
|
+
</message-action-bar>
|
|
466
|
+
<agentic-feedback-panel
|
|
467
|
+
v-if="feedbackChoice && !feedbackSubmitted"
|
|
468
|
+
:feedback-type="feedbackChoice"
|
|
469
|
+
@submit="onFeedbackPanelSubmit"
|
|
470
|
+
@close="onFeedbackPanelClose"
|
|
440
471
|
/>
|
|
441
|
-
</
|
|
472
|
+
</template>
|
|
442
473
|
|
|
443
474
|
<duo-chat-context-item-selections
|
|
444
475
|
v-if="displaySelectedContextItems && isUserMessage"
|
package/src/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.vue
CHANGED
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
GlDropdown,
|
|
9
9
|
GlDropdownItem,
|
|
10
10
|
} from '@gitlab/ui';
|
|
11
|
-
import startCase from 'lodash
|
|
12
|
-
import capitalize from 'lodash/capitalize';
|
|
11
|
+
import { startCase, capitalize } from 'lodash-es';
|
|
13
12
|
import { translate } from '../../../../utils/i18n';
|
|
14
13
|
import { convertKeysToCamelCase } from '../../../../utils/object';
|
|
15
14
|
import { acceptedApproveToolPayloads, APPROVAL_TOOL_NAMES } from '../../constants';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { GlButton, GlAvatar, GlSearchBoxByType } from '@gitlab/ui';
|
|
3
|
-
import debounce from 'lodash
|
|
3
|
+
import { debounce } from 'lodash-es';
|
|
4
4
|
import { sprintf, translate } from '../../../../utils/i18n';
|
|
5
5
|
import { formatLocalizedDate } from '../../../../utils/date';
|
|
6
6
|
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '../../constants';
|
package/src/utils/i18n.js
CHANGED
package/src/utils/object.js
CHANGED