mirror of https://github.com/buster-so/buster.git
more updates
This commit is contained in:
parent
ca2b328831
commit
4096cbdfdd
|
@ -36,7 +36,7 @@ const sizeVariants = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const buttonVariants = cva(
|
export const buttonVariants = cva(
|
||||||
'inline-flex items-center overflow-hidden text-base justify-center gap-[5px] shadow rounded transition-all duration-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed data-[loading=true]:cursor-progress',
|
'inline-flex items-center overflow-hidden text-base justify-center gap-1.5 shadow rounded transition-all duration-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed data-[loading=true]:cursor-progress',
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: buttonTypeClasses,
|
variant: buttonTypeClasses,
|
||||||
|
|
|
@ -151,9 +151,9 @@ export const StreamingMessageCode: React.FC<
|
||||||
const HiddenSection: React.FC<{
|
const HiddenSection: React.FC<{
|
||||||
numberOfLinesUnmodified: number;
|
numberOfLinesUnmodified: number;
|
||||||
}> = ({ numberOfLinesUnmodified }) => (
|
}> = ({ numberOfLinesUnmodified }) => (
|
||||||
<div className="my-2 flex w-full items-center space-x-1 first:mt-0">
|
<div className="my-2! flex w-full items-center space-x-1 first:mt-0">
|
||||||
<div className="bg-border h-[0.5px] w-full" />
|
<div className="bg-border h-[0.5px] w-full" />
|
||||||
<Text variant="tertiary" size={'sm'} className="whitespace-nowrap">
|
<Text variant="tertiary" size={'xs'} className="whitespace-nowrap">
|
||||||
{`${numberOfLinesUnmodified} ${pluralize('line', numberOfLinesUnmodified)} unmodified`}
|
{`${numberOfLinesUnmodified} ${pluralize('line', numberOfLinesUnmodified)} unmodified`}
|
||||||
</Text>
|
</Text>
|
||||||
<div className="bg-border h-[0.5px] w-4" />
|
<div className="bg-border h-[0.5px] w-4" />
|
||||||
|
|
|
@ -18,6 +18,7 @@ export interface PopoverProps
|
||||||
footerContent?: string | React.ReactNode;
|
footerContent?: string | React.ReactNode;
|
||||||
trigger?: PopoverTriggerType;
|
trigger?: PopoverTriggerType;
|
||||||
size?: PopoverContentVariant['size'];
|
size?: PopoverContentVariant['size'];
|
||||||
|
sideOffset?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Popover = React.memo<PopoverProps>(
|
export const Popover = React.memo<PopoverProps>(
|
||||||
|
@ -31,6 +32,7 @@ export const Popover = React.memo<PopoverProps>(
|
||||||
trigger = 'click',
|
trigger = 'click',
|
||||||
size = 'default',
|
size = 'default',
|
||||||
footerContent,
|
footerContent,
|
||||||
|
sideOffset,
|
||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
|
@ -43,6 +45,7 @@ export const Popover = React.memo<PopoverProps>(
|
||||||
side={side}
|
side={side}
|
||||||
className={className}
|
className={className}
|
||||||
size={size}
|
size={size}
|
||||||
|
sideOffset={sideOffset}
|
||||||
headerContent={headerContent && <PopoverHeaderContent title={headerContent} />}
|
headerContent={headerContent && <PopoverHeaderContent title={headerContent} />}
|
||||||
footerContent={footerContent && <PopoverFooterContent title={footerContent} />}>
|
footerContent={footerContent && <PopoverFooterContent title={footerContent} />}>
|
||||||
{content}
|
{content}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import type { IBusterMetric } from '@/api/asset_interfaces/metric';
|
import type { IBusterMetric } from '@/api/asset_interfaces/metric';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { CircleCheck, CircleWarning, CircleDotted } from '@/components/ui/icons';
|
import {
|
||||||
|
CircleCheck,
|
||||||
|
CircleWarning,
|
||||||
|
TriangleWarning
|
||||||
|
} from '@/components/ui/icons/NucleoIconFilled';
|
||||||
import { Popover } from '@/components/ui/tooltip/Popover';
|
import { Popover } from '@/components/ui/tooltip/Popover';
|
||||||
import { Button, type ButtonProps } from '@/components/ui/buttons';
|
import { Button, type ButtonProps } from '@/components/ui/buttons';
|
||||||
|
|
||||||
|
@ -17,7 +21,7 @@ export const MetricChartEvaluation: React.FC<{
|
||||||
|
|
||||||
const icon = useMemo(() => {
|
const icon = useMemo(() => {
|
||||||
if (evaluationScore === 'High') return <CircleCheck />;
|
if (evaluationScore === 'High') return <CircleCheck />;
|
||||||
if (evaluationScore === 'Moderate') return <CircleDotted />;
|
if (evaluationScore === 'Moderate') return <TriangleWarning />;
|
||||||
if (evaluationScore === 'Low') return <CircleWarning />;
|
if (evaluationScore === 'Low') return <CircleWarning />;
|
||||||
return <CircleCheck />;
|
return <CircleCheck />;
|
||||||
}, [evaluationScore]);
|
}, [evaluationScore]);
|
||||||
|
@ -34,6 +38,7 @@ export const MetricChartEvaluation: React.FC<{
|
||||||
<Popover
|
<Popover
|
||||||
side="top"
|
side="top"
|
||||||
align="end"
|
align="end"
|
||||||
|
sideOffset={11}
|
||||||
content={<div className="leading-1.3 max-w-[250px]">{evaluationSummary}</div>}>
|
content={<div className="leading-1.3 max-w-[250px]">{evaluationSummary}</div>}>
|
||||||
<Button variant={variant} prefix={icon}>
|
<Button variant={variant} prefix={icon}>
|
||||||
{text}
|
{text}
|
||||||
|
|
|
@ -3,12 +3,15 @@ import React, { useMemo } from 'react';
|
||||||
import { LabelAndInput } from '../Common';
|
import { LabelAndInput } from '../Common';
|
||||||
import { BarSortBy } from '@/components/ui/charts';
|
import { BarSortBy } from '@/components/ui/charts';
|
||||||
import { AppSegmented, SegmentedItem } from '@/components/ui/segmented';
|
import { AppSegmented, SegmentedItem } from '@/components/ui/segmented';
|
||||||
import { ChartBarAxisX, ChartBarTrendDown, ChartBarTrendUp } from '@/components/ui/icons';
|
import {
|
||||||
|
ChartBarAxisX,
|
||||||
|
ChartBarTrendDown,
|
||||||
|
ChartBarTrendUp
|
||||||
|
} from '@/components/ui/icons/NucleoIconFilled';
|
||||||
import { useMemoizedFn } from '@/hooks';
|
import { useMemoizedFn } from '@/hooks';
|
||||||
|
|
||||||
const options: SegmentedItem<BarSortBy[0]>[] = [
|
const options: SegmentedItem<BarSortBy[0]>[] = [
|
||||||
{
|
{
|
||||||
label: 'None',
|
|
||||||
value: 'none',
|
value: 'none',
|
||||||
tooltip: 'No sorting',
|
tooltip: 'No sorting',
|
||||||
icon: <ChartBarAxisX />
|
icon: <ChartBarAxisX />
|
||||||
|
@ -43,7 +46,9 @@ export const EditBarSorting: React.FC<{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LabelAndInput label="Sorting">
|
<LabelAndInput label="Sorting">
|
||||||
<AppSegmented options={options} value={selectedOption} onChange={onChange} block />
|
<div className="flex justify-end">
|
||||||
|
<AppSegmented options={options} value={selectedOption} onChange={onChange} block={false} />
|
||||||
|
</div>
|
||||||
</LabelAndInput>
|
</LabelAndInput>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,8 @@ const meta: Meta<typeof ReasoningMessageSelector> = {
|
||||||
options: ['reasoning-1', 'reasoning-2', 'reasoning-3']
|
options: ['reasoning-1', 'reasoning-2', 'reasoning-3']
|
||||||
},
|
},
|
||||||
isCompletedStream: {
|
isCompletedStream: {
|
||||||
control: 'boolean'
|
control: 'boolean',
|
||||||
|
defaultValue: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -52,7 +53,7 @@ export const TextReasoning: Story = {
|
||||||
args: {
|
args: {
|
||||||
reasoningMessageId: 'reasoning-1',
|
reasoningMessageId: 'reasoning-1',
|
||||||
messageId: 'message-1',
|
messageId: 'message-1',
|
||||||
isCompletedStream: true,
|
isCompletedStream: false,
|
||||||
chatId: 'chat-1'
|
chatId: 'chat-1'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -61,7 +62,7 @@ export const PillsReasoning: Story = {
|
||||||
args: {
|
args: {
|
||||||
reasoningMessageId: 'reasoning-2',
|
reasoningMessageId: 'reasoning-2',
|
||||||
messageId: 'message-2',
|
messageId: 'message-2',
|
||||||
isCompletedStream: true,
|
isCompletedStream: false,
|
||||||
chatId: 'chat-1'
|
chatId: 'chat-1'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -70,7 +71,7 @@ export const FilesReasoning: Story = {
|
||||||
args: {
|
args: {
|
||||||
reasoningMessageId: 'reasoning-3',
|
reasoningMessageId: 'reasoning-3',
|
||||||
messageId: 'message-3',
|
messageId: 'message-3',
|
||||||
isCompletedStream: true,
|
isCompletedStream: false,
|
||||||
chatId: 'chat-1'
|
chatId: 'chat-1'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,6 +32,8 @@ export const ReasoningMessage_Files: React.FC<ReasoningMessageProps> = React.mem
|
||||||
|
|
||||||
if (!title) return null;
|
if (!title) return null;
|
||||||
|
|
||||||
|
console.log(status);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{file_ids.map((fileId) => (
|
{file_ids.map((fileId) => (
|
||||||
|
|
|
@ -23,7 +23,7 @@ const containerVariants = {
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
transition: {
|
transition: {
|
||||||
opacity: { duration: duration * 0.5, ease: 'easeIn' },
|
opacity: { duration: duration * 0.5, ease: 'easeIn' },
|
||||||
staggerChildren: 0.12
|
staggerChildren: 0.08
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
import { ReasoningMessagePillsContainer } from './ReasoningMessagePillsContainer';
|
import { ReasoningMessagePillsContainer } from './ReasoningMessagePillsContainer';
|
||||||
import { ReasoningMessage_Text } from '../ReasoningMessage_Text';
|
|
||||||
import type { BusterChatMessageReasoning_pills, ThoughtFileType } from '@/api/asset_interfaces';
|
import type { BusterChatMessageReasoning_pills, ThoughtFileType } from '@/api/asset_interfaces';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from '@/components/ui/buttons';
|
import { Button } from '@/components/ui/buttons';
|
||||||
|
|
|
@ -20,15 +20,16 @@ export const mockBusterChatMessage: IBusterChatMessage = {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
title: 'Text Reasoning',
|
title: 'Text Reasoning',
|
||||||
secondary_title: 'Additional Context',
|
secondary_title: 'Additional Context',
|
||||||
message: 'This is a text reasoning message',
|
message:
|
||||||
status: 'completed'
|
'This is a text reasoning message. It is generated by the AI. It is a long message that can be scrolled. It is a short message that can be displayed in a single line. It is a long message that can be scrolled. It is a short message that.',
|
||||||
|
status: 'loading'
|
||||||
},
|
},
|
||||||
'reasoning-2': {
|
'reasoning-2': {
|
||||||
id: 'reasoning-2',
|
id: 'reasoning-2',
|
||||||
type: 'pills',
|
type: 'pills',
|
||||||
title: 'Pills Reasoning',
|
title: 'Pills Reasoning',
|
||||||
secondary_title: 'Selected Files',
|
secondary_title: 'Selected Files',
|
||||||
status: 'completed',
|
status: 'loading',
|
||||||
pill_containers: [
|
pill_containers: [
|
||||||
{
|
{
|
||||||
title: 'Found Files',
|
title: 'Found Files',
|
||||||
|
@ -45,7 +46,7 @@ export const mockBusterChatMessage: IBusterChatMessage = {
|
||||||
type: 'files',
|
type: 'files',
|
||||||
title: 'Files Reasoning',
|
title: 'Files Reasoning',
|
||||||
secondary_title: 'Modified Files',
|
secondary_title: 'Modified Files',
|
||||||
status: 'completed',
|
status: 'loading',
|
||||||
file_ids: ['file-1', 'file-2'],
|
file_ids: ['file-1', 'file-2'],
|
||||||
files: {
|
files: {
|
||||||
'file-1': {
|
'file-1': {
|
||||||
|
@ -56,8 +57,27 @@ export const mockBusterChatMessage: IBusterChatMessage = {
|
||||||
version_id: 'v1',
|
version_id: 'v1',
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
file: {
|
file: {
|
||||||
text: 'console.log("Hello World");\nconsole.log("Hello World");\nconsole.log("Hello World");\n',
|
text: `
|
||||||
modified: [[1, 1]]
|
bilbo_baggins:
|
||||||
|
biography:
|
||||||
|
name: "Bilbo Baggins"
|
||||||
|
species: "Hobbit"
|
||||||
|
home: "The Shire"
|
||||||
|
adventures:
|
||||||
|
- title: "The Unexpected Party"
|
||||||
|
description: "Bilbo is invited to join a group of dwarves on an adventure."
|
||||||
|
- title: "The Trolls"
|
||||||
|
description: "Bilbo encounters trolls who capture him and his companions."
|
||||||
|
- title: "Riddles in the Dark"
|
||||||
|
description: "He meets Gollum and engages in a game of riddles."
|
||||||
|
- title: "The Lonely Mountain"
|
||||||
|
description: "Bilbo helps the dwarves reclaim their treasure from Smaug."
|
||||||
|
quotes:
|
||||||
|
- "I think I am quite ready for another adventure."
|
||||||
|
- "The road goes ever on and on, down from the door where it began."
|
||||||
|
- "I have a great deal of experience in dealing with dragons."
|
||||||
|
`,
|
||||||
|
modified: [[5, 9]]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'file-2': {
|
'file-2': {
|
||||||
|
@ -66,9 +86,36 @@ export const mockBusterChatMessage: IBusterChatMessage = {
|
||||||
file_name: 'example.js',
|
file_name: 'example.js',
|
||||||
version_number: 1,
|
version_number: 1,
|
||||||
version_id: 'v1',
|
version_id: 'v1',
|
||||||
status: 'completed',
|
status: 'loading',
|
||||||
file: {
|
file: {
|
||||||
text: 'console.log("Example");\nconsole.log("Example");\nconsole.log("Example");\n',
|
text: `
|
||||||
|
hunchback_of_notre_dame:
|
||||||
|
title: "The Hunchback of Notre Dame"
|
||||||
|
author: "Victor Hugo"
|
||||||
|
themes:
|
||||||
|
- name: "Isolation"
|
||||||
|
description: "The struggle of Quasimodo, the hunchback, symbolizes the pain of being an outcast."
|
||||||
|
- name: "Love"
|
||||||
|
description: "The unrequited love of Quasimodo for Esmeralda highlights the complexities of affection."
|
||||||
|
- name: "Justice"
|
||||||
|
description: "The story critiques societal norms and the quest for justice in a flawed world."
|
||||||
|
characters:
|
||||||
|
- name: "Quasimodo"
|
||||||
|
role: "The bell-ringer of Notre Dame, representing physical deformity and inner beauty."
|
||||||
|
- name: "Esmeralda"
|
||||||
|
role: "A kind-hearted gypsy who embodies compassion and freedom."
|
||||||
|
- name: "Frollo"
|
||||||
|
role: "The archdeacon whose obsession leads to tragedy, representing moral conflict."
|
||||||
|
setting:
|
||||||
|
location: "Notre Dame Cathedral, Paris"
|
||||||
|
time_period: "15th century"
|
||||||
|
impact:
|
||||||
|
cultural_significance: "The novel has inspired numerous adaptations in film, theater, and literature."
|
||||||
|
moral_lessons:
|
||||||
|
- "True beauty lies within."
|
||||||
|
- "Society often judges based on appearances."
|
||||||
|
- "Compassion can transcend societal boundaries."
|
||||||
|
`,
|
||||||
modified: []
|
modified: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue