Skip to content

Commit ae1a470

Browse files
committed
Fix styles
1 parent da1223d commit ae1a470

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/components/Messages/MessageWindow.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff 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
>

src/components/tools/shared/ToolPrimitives.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface ToolContainerProps extends React.HTMLAttributes<HTMLDivElement> {
1313
export 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

0 commit comments

Comments
 (0)