From f38e6ee052c26a678dbdf2968ec986eefa2007d1 Mon Sep 17 00:00:00 2001 From: HachiDD12 Date: Fri, 5 May 2023 17:43:21 -0400 Subject: [PATCH 1/6] manually rebased to sync with main repo --- .../src/components/Chat/ChatConversation.tsx | 2 ++ website/src/components/Chat/ChatFeedback.tsx | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 website/src/components/Chat/ChatFeedback.tsx diff --git a/website/src/components/Chat/ChatConversation.tsx b/website/src/components/Chat/ChatConversation.tsx index f8547bc096..cd1073c829 100644 --- a/website/src/components/Chat/ChatConversation.tsx +++ b/website/src/components/Chat/ChatConversation.tsx @@ -23,6 +23,7 @@ import { ChatConversationTree, LAST_ASSISTANT_MESSAGE_ID } from "./ChatConversat import { ChatForm } from "./ChatForm"; import { ChatMessageEntryProps, EditPromptParams, PendingMessageEntry } from "./ChatMessageEntry"; import { ChatWarning } from "./ChatWarning"; +import { ChatFeedback } from "./ChatFeedback"; interface ChatConversationProps { chatId: string; @@ -291,6 +292,7 @@ export const ChatConversation = memo(function ChatConversation({ chatId, getConf + {}} /> ); }); diff --git a/website/src/components/Chat/ChatFeedback.tsx b/website/src/components/Chat/ChatFeedback.tsx new file mode 100644 index 0000000000..9b7a85f0da --- /dev/null +++ b/website/src/components/Chat/ChatFeedback.tsx @@ -0,0 +1,30 @@ +import { useState } from "react"; + +interface FeedbackProps { + onFeedbackSubmit: (isPositive: boolean) => void; +} + +export function ChatFeedback({ onFeedbackSubmit }: FeedbackProps) { + const [isPositive, setIsPositive] = useState(null); + + const handleFeedback = (positive: boolean) => { + setIsPositive(positive); + }; + + const handleSubmit = () => { + if (isPositive !== null) { + onFeedbackSubmit(isPositive); + } + }; + + return ( +
+

Did you find this helpful?

+
+ + +
+ +
+ ); +} \ No newline at end of file From 2e7a973d07c0cc418a46da499b867cbeec562cc1 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 May 2023 21:22:37 -0400 Subject: [PATCH 2/6] Added message next to thumbs up/down button --- website/src/components/Chat/ChatMessageEntry.tsx | 2 ++ website/src/components/Chat/EncourageMessage.tsx | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 website/src/components/Chat/EncourageMessage.tsx diff --git a/website/src/components/Chat/ChatMessageEntry.tsx b/website/src/components/Chat/ChatMessageEntry.tsx index 66b2f4cc59..7095e1b3fa 100644 --- a/website/src/components/Chat/ChatMessageEntry.tsx +++ b/website/src/components/Chat/ChatMessageEntry.tsx @@ -22,6 +22,7 @@ import { BaseMessageEntry } from "../Messages/BaseMessageEntry"; import { BaseMessageEmojiButton } from "../Messages/MessageEmojiButton"; import { MessageInlineEmojiRow } from "../Messages/MessageInlineEmojiRow"; import { WorkParametersDisplay } from "./WorkParameters"; +import { EncourageMessage } from "./EncourageMessage"; export type EditPromptParams = { parentId: string; chatId: string; content: string }; @@ -164,6 +165,7 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({ )} {state === "complete" && ( <> + {canRetry && } {!hasCopied ? ( diff --git a/website/src/components/Chat/EncourageMessage.tsx b/website/src/components/Chat/EncourageMessage.tsx new file mode 100644 index 0000000000..392cd2c52b --- /dev/null +++ b/website/src/components/Chat/EncourageMessage.tsx @@ -0,0 +1,10 @@ +import { Badge } from "@chakra-ui/react"; + +// kept brief so that it doesnt distract/interfere with user experience +export const EncourageMessage = () => { + return ( + + Thoughts? Let us know! + + ); +}; From c8227af8ff260976e8239ef8937f1450d1a7efbf Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 May 2023 23:10:43 -0400 Subject: [PATCH 3/6] Reverted previous changes --- .../src/components/Chat/ChatConversation.tsx | 4 +-- website/src/components/Chat/ChatFeedback.tsx | 30 ------------------- 2 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 website/src/components/Chat/ChatFeedback.tsx diff --git a/website/src/components/Chat/ChatConversation.tsx b/website/src/components/Chat/ChatConversation.tsx index cd1073c829..1558dee5eb 100644 --- a/website/src/components/Chat/ChatConversation.tsx +++ b/website/src/components/Chat/ChatConversation.tsx @@ -23,7 +23,7 @@ import { ChatConversationTree, LAST_ASSISTANT_MESSAGE_ID } from "./ChatConversat import { ChatForm } from "./ChatForm"; import { ChatMessageEntryProps, EditPromptParams, PendingMessageEntry } from "./ChatMessageEntry"; import { ChatWarning } from "./ChatWarning"; -import { ChatFeedback } from "./ChatFeedback"; +import { EncourageMessage } from "./EncourageMessage"; interface ChatConversationProps { chatId: string; @@ -292,7 +292,7 @@ export const ChatConversation = memo(function ChatConversation({ chatId, getConf - {}} /> + ); }); diff --git a/website/src/components/Chat/ChatFeedback.tsx b/website/src/components/Chat/ChatFeedback.tsx deleted file mode 100644 index 9b7a85f0da..0000000000 --- a/website/src/components/Chat/ChatFeedback.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useState } from "react"; - -interface FeedbackProps { - onFeedbackSubmit: (isPositive: boolean) => void; -} - -export function ChatFeedback({ onFeedbackSubmit }: FeedbackProps) { - const [isPositive, setIsPositive] = useState(null); - - const handleFeedback = (positive: boolean) => { - setIsPositive(positive); - }; - - const handleSubmit = () => { - if (isPositive !== null) { - onFeedbackSubmit(isPositive); - } - }; - - return ( -
-

Did you find this helpful?

-
- - -
- -
- ); -} \ No newline at end of file From 61bab6e5d89a57e37d420d1da37e45baec98ad31 Mon Sep 17 00:00:00 2001 From: HachiDD12 Date: Fri, 5 May 2023 23:50:39 -0400 Subject: [PATCH 4/6] Removed extra test element --- website/src/components/Chat/ChatConversation.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/src/components/Chat/ChatConversation.tsx b/website/src/components/Chat/ChatConversation.tsx index 1558dee5eb..f8547bc096 100644 --- a/website/src/components/Chat/ChatConversation.tsx +++ b/website/src/components/Chat/ChatConversation.tsx @@ -23,7 +23,6 @@ import { ChatConversationTree, LAST_ASSISTANT_MESSAGE_ID } from "./ChatConversat import { ChatForm } from "./ChatForm"; import { ChatMessageEntryProps, EditPromptParams, PendingMessageEntry } from "./ChatMessageEntry"; import { ChatWarning } from "./ChatWarning"; -import { EncourageMessage } from "./EncourageMessage"; interface ChatConversationProps { chatId: string; @@ -292,7 +291,6 @@ export const ChatConversation = memo(function ChatConversation({ chatId, getConf - ); }); From 56b9788b6c182eba6c5a605e356bba1177cf2bfe Mon Sep 17 00:00:00 2001 From: notmd Date: Mon, 8 May 2023 03:52:33 +0700 Subject: [PATCH 5/6] wip --- website/public/locales/en/chat.json | 3 ++- website/src/components/Chat/EncourageMessage.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/website/public/locales/en/chat.json b/website/public/locales/en/chat.json index c3f9e77efd..7d32947889 100644 --- a/website/public/locales/en/chat.json +++ b/website/public/locales/en/chat.json @@ -35,5 +35,6 @@ "unverified_plugin": "UNVERIFIED", "verified_plugin": "VERIFIED", "unverified_plugin_description": "This plugin has not been verified by the Open Assistant team. Use at your own risk.", - "verified_plugin_description": "This plugin has been verified by the Open Assistant team." + "verified_plugin_description": "This plugin has been verified by the Open Assistant team.", + "feedback_message": "Thoughts? Let us know!" } diff --git a/website/src/components/Chat/EncourageMessage.tsx b/website/src/components/Chat/EncourageMessage.tsx index 392cd2c52b..097ffd908b 100644 --- a/website/src/components/Chat/EncourageMessage.tsx +++ b/website/src/components/Chat/EncourageMessage.tsx @@ -1,10 +1,11 @@ import { Badge } from "@chakra-ui/react"; - +import { useTranslation } from "next-i18next"; // kept brief so that it doesnt distract/interfere with user experience export const EncourageMessage = () => { + const { t } = useTranslation("chat"); return ( - - Thoughts? Let us know! + + {t("feedback_message")} ); }; From feab1af396abba088d621c4b4ef55a695baee589 Mon Sep 17 00:00:00 2001 From: notmd Date: Mon, 8 May 2023 04:05:32 +0700 Subject: [PATCH 6/6] lint --- website/public/locales/en/chat.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/public/locales/en/chat.json b/website/public/locales/en/chat.json index dfd38b9f12..ee2efd8bb1 100644 --- a/website/public/locales/en/chat.json +++ b/website/public/locales/en/chat.json @@ -44,5 +44,5 @@ "warning": "This Assistant is a demonstration version that does not have internet access. It may generate incorrect or misleading information. It is not suitable for important use cases or for giving advice.", "you_are_logged_in": "You are logged in to the chat service", "your_chats": "Your Chats", - "feedback_message": "Thoughts? Let us know!", + "feedback_message": "Thoughts? Let us know!" }