fix: enable closing project dialog with Esc key by default

This commit is contained in:
mlogclub
2026-06-21 11:56:18 +08:00
parent a7b7c20551
commit b8a172123d
2 changed files with 29 additions and 8 deletions
@@ -117,7 +117,11 @@ function getMessageLayout(message: AdminMessage) {
if (message.senderType === "customer") { if (message.senderType === "customer") {
return { return {
rowClassName: "justify-start", rowClassName: "justify-start",
bubbleClassName: "bg-muted text-foreground border-border", bubbleClassName: "border-border/70 bg-muted/60 text-foreground shadow-sm",
htmlClassName: "[&_a]:text-foreground [&_a]:underline [&_img]:rounded-md",
recalledBubbleClassName:
"border-dashed border-border/70 bg-muted/40 text-muted-foreground",
recalledHtmlClassName: "text-muted-foreground [&_p]:text-muted-foreground",
metaClassName: "text-left", metaClassName: "text-left",
}; };
} }
@@ -125,20 +129,33 @@ function getMessageLayout(message: AdminMessage) {
return { return {
rowClassName: "justify-center", rowClassName: "justify-center",
bubbleClassName: bubbleClassName:
"bg-muted/60 text-muted-foreground border-dashed border-border", "border-dashed border-border bg-muted/60 text-muted-foreground",
htmlClassName: "[&_a]:text-foreground [&_a]:underline [&_img]:rounded-md",
recalledBubbleClassName:
"border-dashed border-border/70 bg-muted/40 text-muted-foreground",
recalledHtmlClassName: "text-muted-foreground [&_p]:text-muted-foreground",
metaClassName: "text-center", metaClassName: "text-center",
}; };
} }
if (message.senderType === "ai") { if (message.senderType === "ai") {
return { return {
rowClassName: "justify-end", rowClassName: "justify-end",
bubbleClassName: "bg-primary/10 text-foreground border-primary/20", bubbleClassName: "border-primary/15 bg-primary/5 text-foreground shadow-sm",
htmlClassName: "[&_a]:text-foreground [&_a]:underline [&_img]:rounded-md",
recalledBubbleClassName:
"border-dashed border-emerald-200 bg-emerald-50 text-emerald-800",
recalledHtmlClassName: "text-emerald-800 [&_p]:text-emerald-800",
metaClassName: "text-right", metaClassName: "text-right",
}; };
} }
return { return {
rowClassName: "justify-end", rowClassName: "justify-end",
bubbleClassName: "bg-primary text-primary-foreground border-primary", bubbleClassName: "border-transparent bg-emerald-600 text-white shadow-sm",
htmlClassName:
"[&_p]:text-white [&_a]:text-white [&_a]:underline [&_img]:rounded-md",
recalledBubbleClassName:
"border-dashed border-emerald-200 bg-emerald-50 text-emerald-800",
recalledHtmlClassName: "text-emerald-800 [&_p]:text-emerald-800",
metaClassName: "text-right", metaClassName: "text-right",
}; };
} }
@@ -471,16 +488,20 @@ export function ConversationDetailDialog({
) : null} ) : null}
</div> </div>
<div <div
className={`rounded-2xl border px-4 py-3 text-sm leading-6 ${layout.bubbleClassName}`} className={`rounded-2xl border px-4 py-3 text-sm leading-6 ${
isRecalled
? layout.recalledBubbleClassName
: layout.bubbleClassName
}`}
> >
{isRecalled ? ( {isRecalled ? (
<div className="text-muted-foreground"> <div className={layout.recalledHtmlClassName}>
{t("conversationMonitor.messageRecalledBody")} {t("conversationMonitor.messageRecalledBody")}
</div> </div>
) : isHtmlMessage ? ( ) : isHtmlMessage ? (
<ImMessageHTML <ImMessageHTML
html={renderIMMessageHTML(message)} html={renderIMMessageHTML(message)}
className="[&_a]:underline [&_img]:max-w-full [&_img]:cursor-zoom-in" className={`${layout.htmlClassName} [&_img]:max-w-full [&_img]:cursor-zoom-in`}
onImageClick={openImageLightbox} onImageClick={openImageLightbox}
/> />
) : isImageMessage ? ( ) : isImageMessage ? (
+1 -1
View File
@@ -57,7 +57,7 @@ function ProjectDialog({
bodyClassName, bodyClassName,
footerClassName, footerClassName,
showCloseButton = true, showCloseButton = true,
closeOnEsc = false, closeOnEsc = true,
allowFullscreen = false, allowFullscreen = false,
defaultFullscreen = false, defaultFullscreen = false,
bodyScrollable = true, bodyScrollable = true,