@@ -500,7 +500,7 @@ export const ChatMessage: FC<Props> = memo(
500
500
} max-w-[100%]`}
501
501
style = { { overflowWrap : 'anywhere' } }
502
502
>
503
- < div className = "relative mx-[5%] flex w-full p- 4 text-base md:mx-[10%] md:max-w-[80%] md:gap-6 md:py -6 lg:mx-[15%] lg:max-w-[70%] lg:px-0" >
503
+ < div className = "relative flex w-full px-2 py- 4 text-base md:mx-[10%] md:max-w-[80%] md:gap-6 md:p -6 lg:mx-[15%] lg:max-w-[70%] lg:px-0" >
504
504
< div className = "min-w-[40px] text-left" >
505
505
{ message . role === 'assistant' ? (
506
506
< >
@@ -512,7 +512,7 @@ export const ChatMessage: FC<Props> = memo(
512
512
) }
513
513
</ div >
514
514
515
- < div className = "dark:prose-invert prose mt-[-2px] flex w-[85%] md:w- full" >
515
+ < div className = "dark:prose-invert prose mt-[-2px] flex w-full" >
516
516
{ message . role === 'user' ? (
517
517
< div className = "flex w-full flex-row" >
518
518
{ isEditing ? (
@@ -569,7 +569,7 @@ export const ChatMessage: FC<Props> = memo(
569
569
return (
570
570
< p
571
571
key = { index }
572
- className = { `self-start text-xs font-normal md:text- base md: font-medium lg:text-lg ${ montserrat_paragraph . variable } font-montserratParagraph` }
572
+ className = { `self-start text-base font-normal ${ montserrat_paragraph . variable } font-montserratParagraph` }
573
573
>
574
574
{ content . text }
575
575
</ p >
@@ -598,7 +598,15 @@ export const ChatMessage: FC<Props> = memo(
598
598
) ) }
599
599
</ div >
600
600
601
- { ( isImg2TextLoading === false || isImg2TextLoading ) &&
601
+ { ( isImg2TextLoading ||
602
+ ( message . content . some (
603
+ ( content ) =>
604
+ content . type === 'text' &&
605
+ content . text
606
+ ?. trim ( )
607
+ . startsWith ( 'Image description:' ) ,
608
+ ) &&
609
+ isImg2TextLoading === false ) ) &&
602
610
( messageIndex ===
603
611
( selectedConversation ?. messages . length ?? 0 ) -
604
612
1 ||
@@ -611,31 +619,20 @@ export const ChatMessage: FC<Props> = memo(
611
619
isLoading = { isImg2TextLoading }
612
620
error = { false }
613
621
content = {
614
- message . content
615
- . filter (
616
- ( content ) =>
617
- content . type == 'text' &&
618
- ( content . text as string )
619
- . trim ( )
620
- . startsWith ( 'Image description:' ) ,
621
- )
622
- . find ( ( content ) => content . text )
623
- ? message . content
624
- . filter (
625
- ( content ) =>
626
- content . type == 'text' &&
627
- ( content . text as string )
628
- . trim ( )
629
- . startsWith ( 'Image description:' ) ,
630
- )
631
- . find ( ( content ) => content . text ) ?. text
632
- : 'No image description found'
622
+ message . content . find (
623
+ ( content ) =>
624
+ content . type === 'text' &&
625
+ content . text
626
+ ?. trim ( )
627
+ . startsWith ( 'Image description:' ) ,
628
+ ) ?. text ?? 'No image description found'
633
629
}
634
630
/>
635
631
) }
636
632
637
633
{ ( isRetrievalLoading === false ||
638
- isRetrievalLoading ) &&
634
+ isRetrievalLoading ||
635
+ message . contexts ) &&
639
636
( messageIndex ===
640
637
( selectedConversation ?. messages . length ?? 0 ) -
641
638
1 ||
@@ -645,7 +642,7 @@ export const ChatMessage: FC<Props> = memo(
645
642
< IntermediateStateAccordion
646
643
accordionKey = "retrieval loading"
647
644
title = "Retrieving relevant documents:"
648
- isLoading = { isRetrievalLoading }
645
+ isLoading = { isRetrievalLoading || false }
649
646
error = { false }
650
647
content = { `Found ${ message . contexts ?. length } relevant documents!` }
651
648
/>
@@ -771,7 +768,6 @@ export const ChatMessage: FC<Props> = memo(
771
768
color = { response . error ? 'red' : 'grape' }
772
769
radius = "md"
773
770
size = "sm"
774
- className = { `md:ml-10` }
775
771
>
776
772
{ response . readableName }
777
773
</ Badge >
@@ -997,7 +993,7 @@ export const ChatMessage: FC<Props> = memo(
997
993
p ( { node, children } ) {
998
994
return (
999
995
< p
1000
- className = { `text-xs font-normal md:text-base lg:text-lg ${ montserrat_paragraph . variable } pb-2 font-montserratParagraph` }
996
+ className = { `text-base font-normal ${ montserrat_paragraph . variable } pb-2 font-montserratParagraph` }
1001
997
>
1002
998
{ children }
1003
999
</ p >
@@ -1006,7 +1002,7 @@ export const ChatMessage: FC<Props> = memo(
1006
1002
ul ( { children } ) {
1007
1003
return (
1008
1004
< ul
1009
- className = { `text-xs font-normal md:text-base lg:text-lg ${ montserrat_paragraph . variable } font-montserratParagraph` }
1005
+ className = { `text-base font-normal ${ montserrat_paragraph . variable } font-montserratParagraph` }
1010
1006
>
1011
1007
{ children }
1012
1008
</ ul >
@@ -1015,7 +1011,7 @@ export const ChatMessage: FC<Props> = memo(
1015
1011
ol ( { children } ) {
1016
1012
return (
1017
1013
< ol
1018
- className = { `text-xs font-normal md:text-base lg:text-lg ${ montserrat_paragraph . variable } ml-4 font-montserratParagraph lg:ml-6` }
1014
+ className = { `text-base font-normal ${ montserrat_paragraph . variable } ml-4 font-montserratParagraph lg:ml-6` }
1019
1015
>
1020
1016
{ children }
1021
1017
</ ol >
@@ -1024,7 +1020,7 @@ export const ChatMessage: FC<Props> = memo(
1024
1020
li ( { children } ) {
1025
1021
return (
1026
1022
< li
1027
- className = { ` text-xs font-normal md:text-base lg:text-lg ${ montserrat_paragraph . variable } break-words font-montserratParagraph` }
1023
+ className = { `text-base font-normal ${ montserrat_paragraph . variable } break-words font-montserratParagraph` }
1028
1024
>
1029
1025
{ children }
1030
1026
</ li >
@@ -1054,7 +1050,7 @@ export const ChatMessage: FC<Props> = memo(
1054
1050
h1 ( { node, children } ) {
1055
1051
return (
1056
1052
< h1
1057
- className = { `text-lg font-bold md:text-3xl lg:text-5xl ${ montserrat_heading . variable } font-montserratHeading` }
1053
+ className = { `text-4xl font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1058
1054
>
1059
1055
{ children }
1060
1056
</ h1 >
@@ -1063,7 +1059,7 @@ export const ChatMessage: FC<Props> = memo(
1063
1059
h2 ( { node, children } ) {
1064
1060
return (
1065
1061
< h2
1066
- className = { `text-lg font-bold md:text-2xl lg:text-3xl ${ montserrat_heading . variable } font-montserratHeading` }
1062
+ className = { `text-3xl font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1067
1063
>
1068
1064
{ children }
1069
1065
</ h2 >
@@ -1072,7 +1068,7 @@ export const ChatMessage: FC<Props> = memo(
1072
1068
h3 ( { node, children } ) {
1073
1069
return (
1074
1070
< h3
1075
- className = { `text-lg font-bold md:text-xl lg:text-2xl ${ montserrat_heading . variable } font-montserratHeading` }
1071
+ className = { `text-2xl font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1076
1072
>
1077
1073
{ children }
1078
1074
</ h3 >
@@ -1081,7 +1077,7 @@ export const ChatMessage: FC<Props> = memo(
1081
1077
h4 ( { node, children } ) {
1082
1078
return (
1083
1079
< h4
1084
- className = { `text-sm font-bold lg:text-lg ${ montserrat_heading . variable } font-montserratHeading` }
1080
+ className = { `text-lg font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1085
1081
>
1086
1082
{ children }
1087
1083
</ h4 >
@@ -1090,14 +1086,20 @@ export const ChatMessage: FC<Props> = memo(
1090
1086
h5 ( { node, children } ) {
1091
1087
return (
1092
1088
< h5
1093
- className = { `lg: text-md text-xs font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1089
+ className = { `text-base font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1094
1090
>
1095
1091
{ children }
1096
1092
</ h5 >
1097
1093
)
1098
1094
} ,
1099
1095
h6 ( { node, children } ) {
1100
- return < h6 className = "text-xs font-bold" > { children } </ h6 >
1096
+ return (
1097
+ < h6
1098
+ className = { `text-base font-bold ${ montserrat_heading . variable } font-montserratHeading` }
1099
+ >
1100
+ { children }
1101
+ </ h6 >
1102
+ )
1101
1103
} ,
1102
1104
a ( { node, className, children, ...props } ) {
1103
1105
const { href, title } = props
0 commit comments