Skip to content
Snippets Groups Projects
Commit eb10c71d authored by Dylan Bernardi's avatar Dylan Bernardi
Browse files

fix(DuoChat): Remove the clean slash command

BREAKING CHANGE: Remove support for using /clean slash command.
Use documented /clear command.
parent 483f3629
No related branches found
No related tags found
1 merge request!4415fix(DuoChat): Remove the 'clean' slash command
export const CHAT_RESET_MESSAGE = '/reset';
export const CHAT_CLEAN_MESSAGE = '/clean';
export const CHAT_CLEAR_MESSAGE = '/clear';
export const CHAT_INCLUDE_MESSAGE = '/include';
......
......@@ -20,7 +20,6 @@ import {
import {
MESSAGE_MODEL_ROLES,
CHAT_RESET_MESSAGE,
CHAT_CLEAN_MESSAGE,
CHAT_CLEAR_MESSAGE,
CHAT_INCLUDE_MESSAGE,
} from './constants';
......@@ -536,20 +535,7 @@ describe('GlDuoChat', () => {
});
});
describe('clean / clear', () => {
it('does not render cancel button on clean', async () => {
createComponent({
propsData: { messages, isChatAvailable: true },
mountFn: mount,
});
setPromptInput(CHAT_CLEAN_MESSAGE);
clickSubmit();
await nextTick();
expect(findSubmitButton().exists()).toBe(true);
expect(findCancelButton().exists()).toBe(false);
});
describe('clear', () => {
it('does not render cancel button on clear', async () => {
createComponent({
propsData: { messages, isChatAvailable: true },
......
......@@ -11,7 +11,7 @@ import {
} from './components/duo_chat_context/mock_context_data';
import GlDuoChat from './duo_chat.vue';
import readme from './duo_chat.md';
import { CHAT_CLEAN_MESSAGE, CHAT_CLEAR_MESSAGE } from './constants';
import { CHAT_CLEAR_MESSAGE } from './constants';
import {
MOCK_RESPONSE_MESSAGE,
MOCK_USER_PROMPT_MESSAGE,
......@@ -126,7 +126,7 @@ export const Interactive = (args, { argTypes }) => ({
requestId: this.requestId,
};
this.loggerInfo += `New prompt: ${JSON.stringify(newPrompt)}\n\n`;
if ([CHAT_CLEAN_MESSAGE, CHAT_CLEAR_MESSAGE].includes(prompt)) {
if ([CHAT_CLEAR_MESSAGE].includes(prompt)) {
this.msgs = [];
} else {
this.msgs.push(newPrompt);
......
......@@ -17,7 +17,6 @@ import GlDuoChatLoader from './components/duo_chat_loader/duo_chat_loader.vue';
import GlDuoChatPredefinedPrompts from './components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue';
import GlDuoChatConversation from './components/duo_chat_conversation/duo_chat_conversation.vue';
import {
CHAT_CLEAN_MESSAGE,
CHAT_RESET_MESSAGE,
CHAT_CLEAR_MESSAGE,
CHAT_INCLUDE_MESSAGE,
......@@ -393,11 +392,7 @@ export default {
return;
}
if (
![CHAT_RESET_MESSAGE, CHAT_CLEAN_MESSAGE, CHAT_CLEAR_MESSAGE].includes(
this.caseInsensitivePrompt
)
) {
if (![CHAT_RESET_MESSAGE, CHAT_CLEAR_MESSAGE].includes(this.caseInsensitivePrompt)) {
this.displaySubmitButton = false;
}
......
......@@ -2,8 +2,8 @@ import { setStoryTimeout } from '../../../../utils/test_utils';
import {
DOCUMENTATION_SOURCE_TYPES,
MESSAGE_MODEL_ROLES,
CHAT_CLEAR_MESSAGE,
CHAT_RESET_MESSAGE,
CHAT_CLEAN_MESSAGE,
CHAT_INCLUDE_MESSAGE,
} from './constants';
import { getMockContextItems } from './components/duo_chat_context/mock_context_data';
......@@ -154,7 +154,7 @@ export const SLASH_COMMANDS = [
description: 'Reset conversation, ignore the previous messages.',
},
{
name: CHAT_CLEAN_MESSAGE,
name: CHAT_CLEAR_MESSAGE,
shouldSubmit: true,
description: 'Delete all messages in this conversation.',
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment