Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(chat): format every message time where it is drawn

EtienneLescot4093f7e5c691
diff --git a/src/components/ai-edition/LeftPanel.copyMessage.test.tsx b/src/components/ai-edition/LeftPanel.copyMessage.test.tsx
index 3c39fdfae..d9c3d061c 100644
--- a/src/components/ai-edition/LeftPanel.copyMessage.test.tsx
+++ b/src/components/ai-edition/LeftPanel.copyMessage.test.tsx
@@ -249,3 +249,15 @@ describe("ChatStripPanel Copy message (issue #738)", () => {
expect(toastError).not.toHaveBeenCalled();
});
});
+
+describe("ChatStripPanel message time (#1134)", () => {
+ it("shows a stored message's time as a clock time, never as the raw ISO string", async () => {
+ stubClipboard(copyToClipboard);
+ const view = await renderPanelWithAssistantMessage();
+
+ // The main process stores every message with an ISO `createdAt`. A session loaded from it,
+ // like the one a first message creates, used to print that string as is.
+ expect(view.container.textContent).not.toContain("2026-09-23T00:00:01");
+ expect(view.getByText(new Date("2026-09-23T00:00:01Z").toLocaleTimeString())).toBeTruthy();
+ });
+});
diff --git a/src/components/ai-edition/LeftPanel.tsx b/src/components/ai-edition/LeftPanel.tsx
index 3a490a772..194bd73d2 100644
--- a/src/components/ai-edition/LeftPanel.tsx
+++ b/src/components/ai-edition/LeftPanel.tsx
@@ -34,6 +34,7 @@ interface ChatDisplayMessage {
id?: string;
role: string;
content: string;
+ /** ISO timestamp, as the main process stores it; formatted only where it is drawn (#1134). */
time?: string;
toolCalls?: AiEditionToolCallSummary[];
// ponytail: axcut parity — non-null on user messages that have a
@@ -601,7 +602,7 @@ export function ChatStripPanel() {
id: optimisticUserId,
role: "user",
content: text,
- time: new Date().toLocaleTimeString(),
+ time: new Date().toISOString(),
checkpointId: optimisticUserId,
},
]);
@@ -672,7 +673,7 @@ export function ChatStripPanel() {
{
role: "assistant",
content: assistant.content,
- time: new Date().toLocaleTimeString(),
+ time: new Date().toISOString(),
toolCalls: assistant.toolCalls,
// ponytail: snapshot the live reasoning trace onto the
// finished message so it can be revisited (collapsed by
@@ -1263,7 +1264,7 @@ export function ChatStripPanel() {
color: "var(--muted)",
}}
>
- {m.time}
+ {new Date(m.time).toLocaleTimeString()}
</span>
) : null}
</div>