mirror of https://github.com/buster-so/buster.git
update some UI animations
This commit is contained in:
parent
0c1cffe604
commit
af59f29944
|
@ -93,7 +93,6 @@ export const NewUserController = () => {
|
|||
value={company || ''}
|
||||
onChange={(e) => setCompany(e.target.value)}
|
||||
onPressEnter={handleSubmit}
|
||||
defaultValue={userOrganizations?.name || ''}
|
||||
/>
|
||||
<Button
|
||||
variant="black"
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ClientRedirect } from '../../components/ui/layouts/ClientRedirect';
|
|||
import { LayoutClient } from './layoutClient';
|
||||
import { prefetchGetMyUserInfo } from '@/api/buster_rest';
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import path from 'path';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ export const StreamingMessageCode: React.FC<
|
|||
status,
|
||||
isCompletedStream,
|
||||
file,
|
||||
id,
|
||||
file_name,
|
||||
version_number,
|
||||
file_type,
|
||||
|
|
|
@ -12,7 +12,7 @@ export const AppCodeBlock: React.FC<{
|
|||
wrapperClassName?: string;
|
||||
children?: React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
showLoader?: boolean;
|
||||
|
||||
showCopyButton?: boolean;
|
||||
title?: string;
|
||||
buttons?: React.ReactNode;
|
||||
|
@ -22,13 +22,10 @@ export const AppCodeBlock: React.FC<{
|
|||
className = '',
|
||||
wrapperClassName = '',
|
||||
language,
|
||||
showLoader,
|
||||
showCopyButton = true,
|
||||
...rest
|
||||
} = props;
|
||||
const [style, setStyle] = useState<{
|
||||
[key: string]: React.CSSProperties;
|
||||
}>(lightTheme);
|
||||
const style = lightTheme;
|
||||
const code = String(children).replace(/\n$/, '');
|
||||
|
||||
//this is a huge assumption, but if there is no language, it is probably an inline code block
|
||||
|
@ -57,12 +54,6 @@ export const AppCodeBlock: React.FC<{
|
|||
{children}
|
||||
</code>
|
||||
)}
|
||||
|
||||
{showLoader && (
|
||||
<div className="-mt-2 pl-3">
|
||||
<PulseLoader />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</AppCodeBlockWrapper>
|
||||
|
|
|
@ -18,14 +18,9 @@ export const CustomCode: React.FC<
|
|||
> = ({ children, markdown, showLoader, className, node, ...rest }) => {
|
||||
const matchRegex = /language-(\w+)/.exec(className || '');
|
||||
const language = matchRegex ? matchRegex[1] : undefined;
|
||||
const showStreamingLoader = showLoader && node?.position?.end.line === rest.numberOfLineMarkdown;
|
||||
|
||||
return (
|
||||
<AppCodeBlock
|
||||
wrapperClassName="my-2.5"
|
||||
className="leading-1.3"
|
||||
language={language}
|
||||
showLoader={showStreamingLoader}>
|
||||
<AppCodeBlock wrapperClassName="my-2.5" className="leading-1.3" language={language}>
|
||||
{children}
|
||||
</AppCodeBlock>
|
||||
);
|
||||
|
|
|
@ -179,14 +179,14 @@ export const updateReasoningMessage = (
|
|||
}
|
||||
|
||||
const existingFile = existingReasoningMessageFiles?.files[fileId];
|
||||
const newFile = reasoning.files[fileId];
|
||||
const newFile: BusterChatMessageReasoning_file | undefined = reasoning.files[fileId];
|
||||
|
||||
draft.files[fileId] = create(draft.files[fileId], (fileDraft) => {
|
||||
// Merge existing and new file data
|
||||
Object.assign(fileDraft, existingFile || {}, newFile);
|
||||
|
||||
// Handle file text specifically
|
||||
if (newFile.file) {
|
||||
if (newFile?.file) {
|
||||
fileDraft.file = create(fileDraft.file, (fileContentDraft) => {
|
||||
Object.assign(fileContentDraft, existingFile?.file || {});
|
||||
fileContentDraft.text = newFile.file.text_chunk
|
||||
|
|
|
@ -11,7 +11,7 @@ export const ReasoningMessage_Text: React.FC<ReasoningMessageProps> = React.memo
|
|||
(x) => (x?.reasoning_messages[reasoningMessageId] as BusterChatMessageReasoning_text)?.message
|
||||
)!;
|
||||
|
||||
return <AppMarkdown markdown={message} showLoader={!isCompletedStream} />;
|
||||
return <AppMarkdown markdown={message} showLoader={!isCompletedStream} stripFormatting />;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { BusterChatMessageRequest } from '@/api/asset_interfaces';
|
||||
import React from 'react';
|
||||
import { Text } from '@/components/ui/typography';
|
||||
import { Paragraph } from '@/components/ui/typography';
|
||||
import { MessageContainer } from './MessageContainer';
|
||||
|
||||
export const ChatUserMessage: React.FC<{ requestMessage: BusterChatMessageRequest }> = React.memo(
|
||||
|
@ -11,7 +11,7 @@ export const ChatUserMessage: React.FC<{ requestMessage: BusterChatMessageReques
|
|||
|
||||
return (
|
||||
<MessageContainer senderName={sender_name} senderId={sender_id} senderAvatar={sender_avatar}>
|
||||
<Text>{request}</Text>
|
||||
<Paragraph className="text-sm">{request}</Paragraph>
|
||||
</MessageContainer>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue