Skip to content

Commit

Permalink
Created feedback encouragement message (#3057)
Browse files Browse the repository at this point in the history
For issue #2845 

This is what the message looks like:

![image](https://user-images.githubusercontent.com/98849921/236599235-d10014a7-eb11-4913-bc08-97d7b264481a.png)

---------

Co-authored-by: HachiDD12 <chenzhuofan123@gmail.com>
Co-authored-by: root <root@Hachi>
Co-authored-by: notmd <notmd1811@gmail.com>
  • Loading branch information
4 people authored May 7, 2023
1 parent 7979d55 commit 366392c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/public/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
"visible_hidden": "Visible & hidden",
"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"
"your_chats": "Your Chats",
"feedback_message": "Thoughts? Let us know!"
}
2 changes: 2 additions & 0 deletions website/src/components/Chat/ChatMessageEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down Expand Up @@ -164,6 +165,7 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({
)}
{state === "complete" && (
<>
<EncourageMessage />
{canRetry && <BaseMessageEmojiButton emoji={RotateCcw} onClick={handleRetry} label={t("retry")} />}
{!hasCopied ? (
<BaseMessageEmojiButton emoji={Copy} onClick={onCopy} label={t("copy")} />
Expand Down
11 changes: 11 additions & 0 deletions website/src/components/Chat/EncourageMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +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 (
<Badge fontWeight="normal" background="gray.300" color="black">
{t("feedback_message")}
</Badge>
);
};

0 comments on commit 366392c

Please sign in to comment.