Make fixes to confidence scores icons and width

This commit is contained in:
Nate Kelley 2025-07-09 14:20:11 -06:00
parent b179a7dd9d
commit 016ca3f448
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 13 additions and 44 deletions

View File

@ -47,11 +47,7 @@ const MessageAssumptionsDemo = ({
<Button variant="outlined" onClick={handleClose}> <Button variant="outlined" onClick={handleClose}>
Close Message Assumptions Close Message Assumptions
</Button> </Button>
<MessageAssumptions <MessageAssumptions ref={messageAssumptionsRef} {...mockMessage} />
ref={messageAssumptionsRef}
{...mockMessage}
onClickAskDataTeam={() => {}}
/>
</div> </div>
); );
}; };

View File

@ -11,16 +11,13 @@ import {
confidenceTranslations, confidenceTranslations,
assumptionLabelTranslations assumptionLabelTranslations
} from '@/lib/messages/confidence-translations'; } from '@/lib/messages/confidence-translations';
import { ArrowUpRight } from '@/components/ui/icons'; import { CircleCheck, OctagonWarning } from '@/components/ui/icons';
import { CircleCheck, OctagonWarning } from '@/components/ui/icons/NucleoIconFilled';
import { Pill } from '@/components/ui/pills/Pill'; import { Pill } from '@/components/ui/pills/Pill';
import { cn } from '@/lib/classMerge';
type MessageAssumptionsProps = Pick< type MessageAssumptionsProps = Pick<
PostProcessingMessage, PostProcessingMessage,
'summary_message' | 'summary_title' | 'assumptions' | 'confidence_score' 'summary_message' | 'summary_title' | 'assumptions' | 'confidence_score'
> & { > & {
onClickAskDataTeam: () => void;
useTrigger?: boolean; useTrigger?: boolean;
}; };
@ -32,14 +29,7 @@ export interface MessageAssumptionsRef {
export const MessageAssumptions = React.memo( export const MessageAssumptions = React.memo(
forwardRef<MessageAssumptionsRef, MessageAssumptionsProps>( forwardRef<MessageAssumptionsRef, MessageAssumptionsProps>(
( (
{ { summary_message, useTrigger = true, summary_title, assumptions = [], confidence_score },
summary_message,
useTrigger = true,
onClickAskDataTeam,
summary_title,
assumptions = [],
confidence_score
},
ref ref
) => { ) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -52,7 +42,7 @@ export const MessageAssumptions = React.memo(
return ( return (
<Sheet <Sheet
contentClassName="w-[465px]" contentClassName="w-[525px]"
open={open} open={open}
onOpenChange={setOpen} onOpenChange={setOpen}
trigger={ trigger={
@ -80,7 +70,6 @@ export const MessageAssumptions = React.memo(
summary_message={summary_message} summary_message={summary_message}
summary_title={summary_title} summary_title={summary_title}
confidence_score={confidence_score} confidence_score={confidence_score}
onClickAskDataTeam={onClickAskDataTeam}
/> />
) : ( ) : (
<AssumptionList assumptions={assumptions} selectedPanel={selectedPanel} /> <AssumptionList assumptions={assumptions} selectedPanel={selectedPanel} />
@ -144,13 +133,11 @@ const AssumptionHeader = ({
const AssumptionSummary = ({ const AssumptionSummary = ({
summary_message, summary_message,
summary_title, summary_title,
confidence_score, confidence_score
onClickAskDataTeam
}: { }: {
summary_message: string; summary_message: string;
summary_title: string; summary_title: string;
confidence_score: ConfidenceScore; confidence_score: ConfidenceScore;
onClickAskDataTeam: () => void;
}) => { }) => {
return ( return (
<div className=""> <div className="">
@ -165,14 +152,6 @@ const AssumptionSummary = ({
<Paragraph className="mt-2" variant={'secondary'}> <Paragraph className="mt-2" variant={'secondary'}>
{summary_message} {summary_message}
</Paragraph> </Paragraph>
<Button
onClick={onClickAskDataTeam}
className="mt-6"
variant={'black'}
suffix={<ArrowUpRight />}>
Ask data team to review your chat
</Button>
</div> </div>
); );
}; };
@ -306,21 +285,19 @@ const AssumptionCard = ({
const Trigger: React.FC<{ const Trigger: React.FC<{
onClick: () => void; onClick: () => void;
confidence_score: ConfidenceScore; confidence_score: ConfidenceScore;
}> = ({ onClick, confidence_score }) => { }> = React.memo(({ onClick, confidence_score }) => {
const isLow = confidence_score === 'low' || !confidence_score; const isLow = confidence_score === 'low' || !confidence_score;
const icon = isLow ? <OctagonWarning /> : <CircleCheck />; const icon = isLow ? <OctagonWarning /> : <CircleCheck />;
return ( return (
<div <div
className={cn( className={
'flex cursor-pointer items-center rounded-sm p-[3px] text-lg transition-colors', 'text-icon-color flex cursor-pointer items-center rounded-sm p-[3px] text-lg transition-colors'
{ }
'bg-success-foreground bg-success-background hover:bg-success-background-hover': !isLow,
'hover:bg-danger-background-hover text-danger-foreground': isLow
}
)}
onClick={onClick}> onClick={onClick}>
{icon} {icon}
</div> </div>
); );
}; });
Trigger.displayName = 'Trigger';

View File

@ -62,10 +62,6 @@ export const ChatMessageOptions: React.FC<{
}); });
}); });
const handleAskDataTeam = useMemoizedFn(() => {
console.log('ask data team');
});
return ( return (
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<AppTooltip title="Duplicate chat from this message"> <AppTooltip title="Duplicate chat from this message">
@ -91,7 +87,7 @@ export const ChatMessageOptions: React.FC<{
{postProcessingMessage && ( {postProcessingMessage && (
<AppTooltip title="View assumptions"> <AppTooltip title="View assumptions">
<MessageAssumptions {...postProcessingMessage} onClickAskDataTeam={handleAskDataTeam} /> <MessageAssumptions {...postProcessingMessage} />
</AppTooltip> </AppTooltip>
)} )}