ui: fixes for kai msg editing

This commit is contained in:
nick-delirium 2025-05-20 11:09:56 +02:00
parent 5de6d5de98
commit 3597523a04
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 4 additions and 4 deletions

View file

@ -67,10 +67,10 @@ function ChatLog({
isUser={msg.isUser} isUser={msg.isUser}
userName={userLetter} userName={userLetter}
messageId={msg.messageId} messageId={msg.messageId}
isLast={index === lastHumanMsgInd}
duration={msg.duration} duration={msg.duration}
feedback={msg.feedback} feedback={msg.feedback}
siteId={projectId} siteId={projectId}
canEdit={processingStage === null && msg.isUser && index === lastHumanMsgInd}
/> />
))} ))}
{processingStage ? ( {processingStage ? (

View file

@ -21,19 +21,19 @@ export function ChatMsg({
isUser, isUser,
userName, userName,
messageId, messageId,
isLast,
duration, duration,
feedback, feedback,
siteId, siteId,
canEdit,
}: { }: {
text: string; text: string;
isUser: boolean; isUser: boolean;
messageId: string; messageId: string;
userName?: string; userName?: string;
isLast?: boolean;
duration?: number; duration?: number;
feedback: boolean | null; feedback: boolean | null;
siteId: string; siteId: string;
canEdit?: boolean;
}) { }) {
const [isProcessing, setIsProcessing] = React.useState(false); const [isProcessing, setIsProcessing] = React.useState(false);
const bodyRef = React.useRef<HTMLDivElement>(null); const bodyRef = React.useRef<HTMLDivElement>(null);
@ -103,7 +103,7 @@ export function ChatMsg({
<Markdown remarkPlugins={[remarkGfm]}>{text}</Markdown> <Markdown remarkPlugins={[remarkGfm]}>{text}</Markdown>
</div> </div>
{isUser ? ( {isUser ? (
isLast ? ( canEdit ? (
<div <div
onClick={onRetry} onClick={onRetry}
className={ className={