From aea79cd2102fe40d30da146aebcc286087927a03 Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 27 May 2026 17:03:06 +0800 Subject: [PATCH] feat(chat): enable typing during annotation, increase line thickness, and add draw badge --- src/ui/components/chat/message-card.tsx | 22 +++++++++++++++++----- src/ui/components/chat/message-input.tsx | 6 ++---- src/ui/components/drawing-canvas.tsx | 12 ++++++------ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/ui/components/chat/message-card.tsx b/src/ui/components/chat/message-card.tsx index ae5b6245..eec30dd8 100644 --- a/src/ui/components/chat/message-card.tsx +++ b/src/ui/components/chat/message-card.tsx @@ -3,11 +3,11 @@ import type { UserInfo } from '@/dtos/team' import { client } from '@/ui/api/client' import { Button } from '@/ui/components/ui/button' import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, } from '@/ui/components/ui/dialog' import { Separator } from '@/ui/components/ui/separator' import { formatTimeAgo } from '@/ui/lib/time' @@ -16,6 +16,7 @@ import { Download, File, Terminal } from 'lucide-react' import React from 'react' import Markdown from 'react-markdown' import { Avatar, AvatarFallback } from '../ui/avatar' +import { DrawAnnotation } from '../ui/icons' import { Skeleton } from '../ui/skeleton' import { formatTimestamp } from '../viewers/utils' @@ -81,6 +82,8 @@ export const MessageCard: React.FC = ({ }) const message = polledMessage || initialMessage + const hasDrawInfo = + !!message.annotations && Array.isArray(message.annotations) && message.annotations.length > 0 const creator = message.creator const showSkeleton = !!message.sessionId && !!message.message && message.message in AI_PLACEHOLDERS @@ -182,6 +185,15 @@ export const MessageCard: React.FC = ({ )} + {hasDrawInfo && ( +
+ +
+ )} + {showSkeleton ? (
diff --git a/src/ui/components/chat/message-input.tsx b/src/ui/components/chat/message-input.tsx index 20fdc124..a57e7fdd 100644 --- a/src/ui/components/chat/message-input.tsx +++ b/src/ui/components/chat/message-input.tsx @@ -599,13 +599,11 @@ export const ChatInput = React.forwardRef( )}
diff --git a/src/ui/components/drawing-canvas.tsx b/src/ui/components/drawing-canvas.tsx index db09f754..11e09b56 100644 --- a/src/ui/components/drawing-canvas.tsx +++ b/src/ui/components/drawing-canvas.tsx @@ -379,7 +379,7 @@ const DrawingCanvas = ({ width={boxWidth} height={boxHeight} stroke={annotation.color} - strokeWidth={2 / scale} + strokeWidth={2.6 / scale} listening={false} /> ) @@ -391,7 +391,7 @@ const DrawingCanvas = ({ key={i} points={points} stroke={annotation.color} - strokeWidth={2 / scale} + strokeWidth={2.6 / scale} fill={annotation.color} pointerLength={10 / scale} pointerWidth={10 / scale} @@ -407,7 +407,7 @@ const DrawingCanvas = ({ key={i} points={points} stroke={annotation.color} - strokeWidth={2 / scale} + strokeWidth={2.6 / scale} tension={0.5} lineCap="round" lineJoin="round" @@ -463,16 +463,16 @@ const DrawingCanvas = ({ - +