From 7e85d6bc4f46ee1239480bf639e5cca837e0efc3 Mon Sep 17 00:00:00 2001 From: koji Date: Fri, 31 May 2024 15:46:52 -0400 Subject: [PATCH 1/4] fix(opentrons-ai-client): add conditinal for user prompt add conditinal for user prompt close AUTH-433 --- .../src/molecules/ChatDisplay/index.tsx | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx index 5fbd5e1d5c2..5c6b134b4fa 100644 --- a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx +++ b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx @@ -65,19 +65,24 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element { gridGap={SPACING.spacing16} position={POSITION_RELATIVE} > - - {reply} - + {isUser ? ( + {reply} + ) : ( + + {reply} + + )} + {!isUser ? ( Date: Fri, 31 May 2024 15:51:22 -0400 Subject: [PATCH 2/4] add margin-left to list item text --- .../src/molecules/ChatDisplay/index.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx index 5c6b134b4fa..64eb5343580 100644 --- a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx +++ b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx @@ -66,7 +66,18 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element { position={POSITION_RELATIVE} > {isUser ? ( - {reply} + + {reply} + ) : ( + return } function UnnumberedListText(props: JSX.IntrinsicAttributes): JSX.Element { From b1ec263bbdb34b5d73e24928aec5b48ea6c1a9c6 Mon Sep 17 00:00:00 2001 From: koji Date: Fri, 31 May 2024 16:25:25 -0400 Subject: [PATCH 3/4] move conditionals into Markdown --- .../src/molecules/ChatDisplay/index.tsx | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx index 64eb5343580..81755ff0b71 100644 --- a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx +++ b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx @@ -65,34 +65,19 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element { gridGap={SPACING.spacing16} position={POSITION_RELATIVE} > - {isUser ? ( - - {reply} - - ) : ( - - {reply} - - )} + + {reply} + {!isUser ? ( Date: Fri, 31 May 2024 16:48:23 -0400 Subject: [PATCH 4/4] remove undefined --- opentrons-ai-client/src/molecules/ChatDisplay/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx index 81755ff0b71..5c070a290dc 100644 --- a/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx +++ b/opentrons-ai-client/src/molecules/ChatDisplay/index.tsx @@ -72,8 +72,8 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element { h2: HeaderText, li: ListItemText, p: ParagraphText, - a: isUser ? undefined : ExternalLink, - code: isUser ? undefined : CodeText, + a: isUser ? ParagraphText : ExternalLink, + code: isUser ? ParagraphText : CodeText, }} > {reply}