From 9797cc95bb04659b121ef4ed67f587c79ca38e13 Mon Sep 17 00:00:00 2001 From: Ilia Znamenskii Date: Mon, 7 Oct 2024 13:35:04 +0200 Subject: [PATCH 1/2] remove fake message --- .../ui/wds/WDSAIChatWidget/widget/index.tsx | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx index f94fb5935f71..94f920ecfd39 100644 --- a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx +++ b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx @@ -43,24 +43,7 @@ class WDSAIChatWidget extends BaseWidget { static type = "WDS_AI_CHAT_WIDGET"; state = { - messages: [ - { - id: "1", - content: "Hello! How can I help you?", - role: "assistant" as const, - }, - { - id: "2", - content: "Find stuck support requests", - role: "user" as const, - }, - { - id: "3", - content: - "I'm finding these customer support requests that have been waiting for a response for over a day:", - role: "assistant" as const, - }, - ], + messages: [], prompt: "", isWaitingForResponse: false, }; From 4adab522c0e126a494fac9951f4fed9d7a84c47c Mon Sep 17 00:00:00 2001 From: Ilia Znamenskii Date: Wed, 9 Oct 2024 09:42:31 +0200 Subject: [PATCH 2/2] remove ai chat widget --- .../widgets/src/components/AIChat/index.ts | 1 - .../src/components/AIChat/src/AIChat.tsx | 81 -------- .../AIChat/src/ChatTitle/ChatTitle.tsx | 17 -- .../components/AIChat/src/ChatTitle/index.ts | 2 - .../AIChat/src/ChatTitle/styles.module.css | 22 -- .../components/AIChat/src/ChatTitle/types.ts | 5 - .../src/ThreadMessage/ThreadMessage.tsx | 64 ------ .../AIChat/src/ThreadMessage/index.ts | 2 - .../src/ThreadMessage/styles.module.css | 27 --- .../AIChat/src/ThreadMessage/types.ts | 7 - .../AIChat/src/UserAvatar/UserAvatar.tsx | 27 --- .../components/AIChat/src/UserAvatar/index.ts | 2 - .../AIChat/src/UserAvatar/styles.module.css | 13 -- .../components/AIChat/src/UserAvatar/types.ts | 5 - .../src/components/AIChat/src/index.ts | 2 - .../components/AIChat/src/styles.module.css | 48 ----- .../src/components/AIChat/src/types.ts | 18 -- .../AIChat/stories/AIChat.stories.tsx | 78 ------- .../components/AIChat/tests/AIChat.test.tsx | 113 ---------- .../design-system/widgets/src/index.ts | 1 - app/client/src/ce/widgets/index.ts | 196 ++++++++++++++++++ .../ui/wds/WDSAIChatWidget/index.tsx | 3 - .../widget/config/anvilConfig.ts | 11 - .../widget/config/autocompleteConfig.ts | 5 - .../widget/config/defaultConfig.ts | 10 - .../WDSAIChatWidget/widget/config/index.ts | 17 -- .../widget/config/metaConfig.ts | 9 - .../widget/config/methodsConfig.ts | 6 - .../widget/config/propertyPaneContent.ts | 140 ------------- .../widget/config/propertyPaneStyle.ts | 1 - .../ui/wds/WDSAIChatWidget/widget/index.tsx | 196 ------------------ app/client/src/widgets/index.ts | 2 - 32 files changed, 196 insertions(+), 935 deletions(-) delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/index.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/ChatTitle.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/index.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/styles.module.css delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/types.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/ThreadMessage.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/index.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/styles.module.css delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/types.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/UserAvatar.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/index.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/styles.module.css delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/types.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/AIChat/tests/AIChat.test.tsx create mode 100644 app/client/src/ce/widgets/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/index.ts b/app/client/packages/design-system/widgets/src/components/AIChat/index.ts deleted file mode 100644 index 3bd16e178a03..000000000000 --- a/app/client/packages/design-system/widgets/src/components/AIChat/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./src"; diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx b/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx deleted file mode 100644 index d6975d9750a2..000000000000 --- a/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { Button, Text, TextArea } from "@appsmith/wds"; -import type { FormEvent, ForwardedRef, KeyboardEvent } from "react"; -import React, { forwardRef, useCallback } from "react"; -import { ChatTitle } from "./ChatTitle"; -import styles from "./styles.module.css"; -import { ThreadMessage } from "./ThreadMessage"; -import type { AIChatProps, ChatMessage } from "./types"; -import { UserAvatar } from "./UserAvatar"; - -const MIN_PROMPT_LENGTH = 3; - -const _AIChat = (props: AIChatProps, ref: ForwardedRef) => { - const { - // assistantName, - chatTitle, - isWaitingForResponse = false, - onPromptChange, - onSubmit, - prompt, - promptInputPlaceholder, - thread, - username, - ...rest - } = props; - - const handleFormSubmit = useCallback( - (event: FormEvent) => { - event.preventDefault(); - onSubmit?.(); - }, - [onSubmit], - ); - - const handlePromptInputKeyDown = useCallback( - (event: KeyboardEvent) => { - if (event.key === "Enter" && event.shiftKey) { - event.preventDefault(); - onSubmit?.(); - } - }, - [onSubmit], - ); - - return ( -
-
- - -
- - - {username} - -
-
- -
    - {thread.map((message: ChatMessage) => ( - - ))} -
- -
-