diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 3742137563..ab6cb4cb06 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -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 @@ -323,17 +324,25 @@ export const ChatRowContent = ({ apiReqCancelReason !== null && apiReqCancelReason !== undefined ? ( apiReqCancelReason === "user_cancelled" ? ( - {t("chat:apiRequest.cancelled")} + {t("chat:apiRequest.cancelled")}{" "} + {message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""} ) : ( - {t("chat:apiRequest.streamingFailed")} + {t("chat:apiRequest.streamingFailed")}{" "} + {message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""} ) ) : cost !== null && cost !== undefined ? ( - {t("chat:apiRequest.title")} + + {t("chat:apiRequest.title")}{" "} + {message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""} + ) : apiRequestFailedMessage ? ( - {t("chat:apiRequest.failed")} + + {t("chat:apiRequest.failed")}{" "} + {message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""} + ) : ( {t("chat:apiRequest.streaming")} ), @@ -1216,6 +1225,7 @@ export const ChatRowContent = ({ username: userInfo?.name || t("chat:feedback.defaultUserName"), })} + {message.ts ? format(new Date(message.ts), "yyyy-MM-dd HH:mm:ss") : ""}