ui: fixes for kai msg editing
This commit is contained in:
parent
5de6d5de98
commit
3597523a04
2 changed files with 4 additions and 4 deletions
|
|
@ -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 ? (
|
||||||
|
|
|
||||||
|
|
@ -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={
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue