File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -48,24 +48,26 @@ export const MessageWindow: React.FC<MessageWindowProps> = ({
4848 [ timestamp ]
4949 ) ;
5050
51- // We do not want to display these on every message, otherwise it spams the UI
52- // with buttons and timestamps
53- const showMetaRow = useMemo ( ( ) => {
51+ const isLastPartOfMessage = useMemo ( ( ) => {
5452 if ( "isLastPartOfMessage" in message && message . isLastPartOfMessage && ! message . isPartial ) {
5553 return true ;
5654 }
57- if ( variant === "user" ) {
58- return true ;
59- }
6055 return false ;
6156 } , [ message ] ) ;
6257
58+ // We do not want to display these on every message, otherwise it spams the UI
59+ // with buttons and timestamps
60+ const showMetaRow = useMemo ( ( ) => {
61+ return variant === "user" || isLastPartOfMessage ;
62+ } , [ variant , isLastPartOfMessage ] ) ;
63+
6364 return (
6465 < div
6566 className = { cn (
66- "my-4 flex w-full flex-col relative isolate w-fit" ,
67+ "mt-4 mb-1 flex w-full flex-col relative isolate w-fit" ,
6768 variant === "user" && "ml-auto" ,
68- variant === "assistant" && "text-white"
69+ variant === "assistant" && "text-white" ,
70+ isLastPartOfMessage && "mb-4"
6971 ) }
7072 data-message-block
7173 >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ interface ToolContainerProps extends React.HTMLAttributes<HTMLDivElement> {
1313export const ToolContainer : React . FC < ToolContainerProps > = ( { expanded, className, ...props } ) => (
1414 < div
1515 className = { cn (
16- "my-2 bg-gray-overlay rounded font-mono text-[11px] transition-all duration-200 max-w-[680px]" ,
16+ "my-2 rounded font-mono text-[11px] transition-all duration-200 max-w-[680px]" ,
1717 "[container-type:inline-size]" ,
1818 expanded ? "py-2 px-3" : "py-1 px-3" ,
1919 className
You can’t perform that action at this time.
0 commit comments