Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {
import { cn } from "@/lib/utils"
import { getLine } from "@/utils/path-mentions"
import { useZgsmUserInfo } from "@/hooks/useZgsmUserInfo"
import { format } from "date-fns"

interface ChatRowProps {
message: ClineMessage
Expand Down Expand Up @@ -323,17 +324,25 @@ export const ChatRowContent = ({
apiReqCancelReason !== null && apiReqCancelReason !== undefined ? (
apiReqCancelReason === "user_cancelled" ? (
<span style={{ color: normalColor, fontWeight: "bold" }}>
{t("chat:apiRequest.cancelled")}
{t("chat:apiRequest.cancelled")}{" "}
{message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}
</span>
) : (
<span style={{ color: errorColor, fontWeight: "bold" }}>
{t("chat:apiRequest.streamingFailed")}
{t("chat:apiRequest.streamingFailed")}{" "}
{message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}
</span>
)
) : cost !== null && cost !== undefined ? (
<span style={{ color: normalColor }}>{t("chat:apiRequest.title")}</span>
<span style={{ color: normalColor }}>
{t("chat:apiRequest.title")}{" "}
{message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}
</span>
) : apiRequestFailedMessage ? (
<span style={{ color: errorColor }}>{t("chat:apiRequest.failed")}</span>
<span style={{ color: errorColor }}>
{t("chat:apiRequest.failed")}{" "}
{message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}
</span>
) : (
<span style={{ color: normalColor }}>{t("chat:apiRequest.streaming")}</span>
),
Expand Down Expand Up @@ -1216,6 +1225,7 @@ export const ChatRowContent = ({
username: userInfo?.name || t("chat:feedback.defaultUserName"),
})}
</span>
{message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}
</div>
<div
className={cn(
Expand Down