feat(editor): Add AI Chat button to new canvas (no-changelog) (#10166)

This commit is contained in:
Alex Grozav
2024-07-24 12:10:02 +03:00
committed by GitHub
parent fe1a1d80c6
commit ea5382d20f
7 changed files with 40 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ import {
STICKY_NODE_TYPE,
VALID_WORKFLOW_IMPORT_URL_REGEX,
VIEWS,
WORKFLOW_LM_CHAT_MODAL_KEY,
} from '@/constants';
import { useSourceControlStore } from '@/stores/sourceControl.store';
import { useNodeCreatorStore } from '@/stores/nodeCreator.store';
@@ -1090,6 +1091,17 @@ const chatTriggerNodePinnedData = computed(() => {
return workflowsStore.pinDataByNodeName(chatTriggerNode.value.name);
});
async function onOpenChat() {
uiStore.openModal(WORKFLOW_LM_CHAT_MODAL_KEY);
const payload = {
workflow_id: workflowId.value,
};
void externalHooks.run('nodeView.onOpenChat', payload);
telemetry.track('User clicked chat open button', payload);
}
/**
* History events
*/
@@ -1518,6 +1530,7 @@ onBeforeUnmount(() => {
@mouseleave="onRunWorkflowButtonMouseLeave"
@click="onRunWorkflow"
/>
<CanvasChatButton v-if="containsChatTriggerNodes" @click="onOpenChat" />
<CanvasStopCurrentExecutionButton
v-if="isStopExecutionButtonVisible"
:stopping="isStoppingExecution"