mirror of https://github.com/buster-so/buster.git
animate reasoning title
This commit is contained in:
parent
af55cdc137
commit
2ba75e242b
|
@ -78,12 +78,12 @@ const TextContainer: React.FC<{
|
||||||
styles.hideSecondaryText,
|
styles.hideSecondaryText,
|
||||||
'flex w-full items-center space-x-1.5 overflow-hidden'
|
'flex w-full items-center space-x-1.5 overflow-hidden'
|
||||||
)}>
|
)}>
|
||||||
<AnimatedThoughtTitle title={title} />
|
<AnimatedThoughtTitle title={title} type="default" />
|
||||||
{secondaryTitle && (
|
<AnimatedThoughtTitle
|
||||||
<Text size="sm" type="tertiary" className="secondary-text truncate" lineHeight={lineHeight}>
|
title={secondaryTitle}
|
||||||
{secondaryTitle}
|
type="tertiary"
|
||||||
</Text>
|
className="secondary-text truncate"
|
||||||
)}
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -96,17 +96,33 @@ const animations = {
|
||||||
exit: { opacity: 0 }
|
exit: { opacity: 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
const AnimatedThoughtTitle = React.memo(({ title }: { title: string }) => {
|
const AnimatedThoughtTitle = React.memo(
|
||||||
|
({
|
||||||
|
title,
|
||||||
|
type,
|
||||||
|
className = ''
|
||||||
|
}: {
|
||||||
|
title: string | undefined;
|
||||||
|
type: 'tertiary' | 'default';
|
||||||
|
className?: string;
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<AnimatePresence initial={false} mode="wait">
|
<AnimatePresence initial={false} mode="wait">
|
||||||
|
{title && (
|
||||||
<motion.div className="flex" {...animations} key={title}>
|
<motion.div className="flex" {...animations} key={title}>
|
||||||
<Text size="sm" className="whitespace-nowrap" lineHeight={lineHeight}>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
className={`whitespace-nowrap ${className}`}
|
||||||
|
type={type}
|
||||||
|
lineHeight={lineHeight}>
|
||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
AnimatedThoughtTitle.displayName = 'AnimatedThoughtTitle';
|
AnimatedThoughtTitle.displayName = 'AnimatedThoughtTitle';
|
||||||
|
|
||||||
const useStyles = createStyles(({ token, css }) => ({
|
const useStyles = createStyles(({ token, css }) => ({
|
||||||
|
|
|
@ -44,6 +44,12 @@ export const useInitialChatLayout = ({
|
||||||
}
|
}
|
||||||
}, [chatId]);
|
}, [chatId]);
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// if (isReasoningFile) {
|
||||||
|
// setIsCollapseOpen(false);
|
||||||
|
// }
|
||||||
|
// }, [isReasoningFile]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isPureFile,
|
isPureFile,
|
||||||
isPureChat,
|
isPureChat,
|
||||||
|
|
|
@ -30,7 +30,7 @@ export const useChatSelectors = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
const getChatMessagesMemoized = useMemoizedFn((chatId: string) => {
|
const getChatMessagesMemoized = useMemoizedFn((chatId: string) => {
|
||||||
const chatMessageIds = chatsRef.current[chatId].messages || [];
|
const chatMessageIds = chatsRef.current[chatId]?.messages || [];
|
||||||
return chatMessageIds.map((messageId) => chatsMessagesRef.current[messageId]);
|
return chatMessageIds.map((messageId) => chatsMessagesRef.current[messageId]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue