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