feat(editor): Redesign Canvas Chat (#11634)

This commit is contained in:
oleg
2024-11-13 11:05:19 +01:00
committed by GitHub
parent 93a6f858fa
commit a412ab7ebf
41 changed files with 2451 additions and 1063 deletions

View File

@@ -60,7 +60,6 @@ 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';
@@ -249,6 +248,8 @@ const keyBindingsEnabled = computed(() => {
return !ndvStore.activeNode && uiStore.activeModals.length === 0;
});
const isChatOpen = computed(() => workflowsStore.isChatPanelOpen);
/**
* Initialization
*/
@@ -1207,7 +1208,7 @@ const chatTriggerNodePinnedData = computed(() => {
});
async function onOpenChat() {
uiStore.openModal(WORKFLOW_LM_CHAT_MODAL_KEY);
workflowsStore.setPanelOpen('chat', !workflowsStore.isChatPanelOpen);
const payload = {
workflow_id: workflowId.value,
@@ -1633,7 +1634,11 @@ onBeforeUnmount(() => {
@mouseleave="onRunWorkflowButtonMouseLeave"
@click="onRunWorkflow"
/>
<CanvasChatButton v-if="containsChatTriggerNodes" @click="onOpenChat" />
<CanvasChatButton
v-if="containsChatTriggerNodes"
:outline="isChatOpen === false"
@click="onOpenChat"
/>
<CanvasStopCurrentExecutionButton
v-if="isStopExecutionButtonVisible"
:stopping="isStoppingExecution"