diff --git a/apps/web/components/chat-message.tsx b/apps/web/components/chat-message.tsx index dfb3f79..3136ded 100644 --- a/apps/web/components/chat-message.tsx +++ b/apps/web/components/chat-message.tsx @@ -35,6 +35,7 @@ function ChatMessage({ message, isLast }: ChatMessageProps) { return ( + {' '} + {/* + * This is a hidden dummy message acting as an animation anchor + * before the real message is added to the chat. + * + * The animation starts in this element's position and moves over to + * the location of the real message after submit. + * + * It works by sharing the same `layoutId` between both message elements + * which framer motion requires to animate between them. + */} + {input && ( + + {input} + + )}