Skip to content

Commit 4e2b776

Browse files
authored
(EAI-1083) [UI] Update "experimental" language and pill on chatbot (#767)
* (EAI-1083) [UI] Update "experimental" language and pill on chatbot * (EAI-1083) update verify information text
1 parent 3dc3806 commit 4e2b776

File tree

9 files changed

+5
-24
lines changed

9 files changed

+5
-24
lines changed

docs/docs/ui.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ The `<Chatbot />` component is effectively a React context provider that wraps y
7979
| `darkMode` | `boolean?` | If `true`, the UI renders in dark mode. This overrides any theme `darkMode` setting. | The user's OS preference or theme value of `darkMode`. |
8080
| `fetchOptions` | `ConversationFetchOptions?` | If set, the provided options are included with every fetch request to the server. For more information on the available fetch options, refer to [Supplying request options](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#supplying_request_options) in the MDN documentation. | |
8181
| `getClientContext` | `(() => Record<string, unknown>)?` | A function that returns an object with client-side context data to be sent with each message. This context is included in message requests to help the server understand the client's state. | |
82-
| `isExperimental` | `boolean?` | If `true`, the UI includes EXPERIMENTAL badges throughout. | `true` |
8382
| `maxCommentCharacters` | `number?` | The maximum number of characters allowed in a user's comment on an assistant message. | `500` |
8483
| `maxInputCharacters` | `number?` | The maximum number of characters allowed in a user message. | `300` |
8584
| `name` | `string?` | The name of the chatbot. Used as the default in text throughout the UI. | If unspecified, the chatbot is anonymous. |

packages/mongodb-chatbot-ui/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function App() {
8787
<DocsChatbot suggestedPrompts={SUGGESTED_PROMPTS} />
8888
</Chatbot>
8989
<Chatbot
90-
name="MongoDB AI (Dev Center)"
90+
name="MongoDB AI"
9191
serverBaseUrl={serverBaseUrl}
9292
shouldStream={shouldStream}
9393
darkMode={darkMode}

packages/mongodb-chatbot-ui/src/ChatWindow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function ChatWindow(props: ChatWindowProps) {
3636
windowTitle,
3737
} = props;
3838

39-
const { chatbotName, isExperimental } = useChatbotContext();
39+
const { chatbotName } = useChatbotContext();
4040

4141
const initialMessage: MessageData | null = useMemo(() => {
4242
if (!initialMessageText) {
@@ -61,7 +61,6 @@ export function ChatWindow(props: ChatWindowProps) {
6161
<LeafyGreenChatProvider>
6262
<LGChatWindow
6363
className={cx(css`border-radius: 24px;`, className)}
64-
badgeText={isExperimental ? "Experimental" : undefined}
6564
title={windowTitle ?? chatbotName ?? ""}
6665
darkMode={darkMode}
6766
>

packages/mongodb-chatbot-ui/src/Chatbot.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export function Chatbot({
2525
user,
2626
name,
2727
fetchOptions,
28-
isExperimental,
2928
onOpen,
3029
onClose,
3130
onSuggestedPromptClick,
@@ -53,7 +52,6 @@ export function Chatbot({
5352
<InnerChatbot
5453
fetchOptions={fetchOptions}
5554
getClientContext={getClientContext}
56-
isExperimental={isExperimental}
5755
maxCommentCharacters={maxCommentCharacters}
5856
maxInputCharacters={maxInputCharacters}
5957
name={name}
@@ -78,7 +76,6 @@ type InnerChatbotProps = Pick<
7876
| "children"
7977
| "fetchOptions"
8078
| "getClientContext"
81-
| "isExperimental"
8279
| "maxCommentCharacters"
8380
| "maxInputCharacters"
8481
| "name"
@@ -90,8 +87,9 @@ type InnerChatbotProps = Pick<
9087
| "sortMessageReferences"
9188
>;
9289

93-
function InnerChatbot({ children, ...props }: InnerChatbotProps) {
90+
function InnerChatbot({ children, name, ...props }: InnerChatbotProps) {
9491
const chatbotData = useChatbot({
92+
chatbotName: name,
9593
...props,
9694
});
9795

packages/mongodb-chatbot-ui/src/InputBarTrigger.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ export function InputBarTrigger({
5757

5858
const {
5959
conversation,
60-
isExperimental,
6160
inputText,
6261
inputPlaceholder,
6362
setInputText,
6463
inputTextError,
6564
canSubmit,
6665
awaitingReply,
6766
openChat,
68-
focused,
6967
setFocused,
7068
handleSubmit,
7169
hasError,
@@ -93,11 +91,6 @@ export function InputBarTrigger({
9391
key={"inputBarTrigger"}
9492
darkMode={darkMode}
9593
hasError={hasError ?? false}
96-
badgeText={
97-
!focused && inputText.length === 0 && isExperimental
98-
? "Experimental"
99-
: undefined
100-
}
10194
dropdownProps={{
10295
usePortal: false,
10396
}}

packages/mongodb-chatbot-ui/src/ModalView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export function ModalView(props: ModalViewProps) {
6565

6666
const chatWindowInputBarId = inputBarId ?? "chatbot-modal-input-bar";
6767

68-
console.log("chatWindowInputBarId", chatWindowInputBarId);
69-
7068
return (
7169
<Suspense fallback={null}>
7270
{open ? (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const mongoDbVerifyInformationMessage =
2-
"This is an experimental generative AI chatbot. All information should be verified prior to use.";
2+
"Our chatbot can make mistakes, so double-check important info.";
33

44
export const defaultChatbotFatalErrorMessage =
55
"Something went wrong. Try reloading the page and starting a new conversation.";

packages/mongodb-chatbot-ui/src/useChatbot.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export type OpenCloseHandlers = {
99
export type UseChatbotProps = OpenCloseHandlers &
1010
UseConversationParams & {
1111
chatbotName?: string;
12-
isExperimental?: boolean;
1312
maxInputCharacters?: number;
1413
maxCommentCharacters?: number;
1514
onSuggestedPromptClick?: (prompt: string) => void;
@@ -25,7 +24,6 @@ export type ChatbotData = {
2524
inputText: string;
2625
inputTextError: string;
2726
chatbotName?: string;
28-
isExperimental: boolean;
2927
maxInputCharacters?: number;
3028
maxCommentCharacters?: number;
3129
open: boolean;
@@ -38,7 +36,6 @@ export function useChatbot({
3836
onOpen,
3937
onClose,
4038
chatbotName,
41-
isExperimental = true,
4239
maxInputCharacters,
4340
maxCommentCharacters,
4441
onSuggestedPromptClick,
@@ -129,7 +126,6 @@ export function useChatbot({
129126
inputBarRef,
130127
inputText,
131128
inputTextError,
132-
isExperimental,
133129
maxInputCharacters,
134130
maxCommentCharacters,
135131
open,

packages/mongodb-chatbot-ui/src/useTextInputTrigger.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export function useTextInputTrigger({
4545
awaitingReply,
4646
handleSubmit,
4747
conversation,
48-
isExperimental,
4948
onSuggestedPromptClick,
5049
} = useChatbotContext();
5150

@@ -60,7 +59,6 @@ export function useTextInputTrigger({
6059

6160
return {
6261
conversation,
63-
isExperimental,
6462
inputText,
6563
setInputText,
6664
inputTextError,

0 commit comments

Comments
 (0)