From 1d208c1286762d36058ba14626c29b523547309c Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Mon, 12 Oct 2026 20:00:50 +0200 Subject: [PATCH 1/2] fix(chat): format every message time where it is drawn Messages loaded from the main process carry an ISO createdAt, and the panel printed it as is. A first message lands in a session created mid-send, which reloads it from the main process, so it showed a raw timestamp next to a formatted reply. Every message now keeps the ISO string and the header formats it. Refs #1134. --- .../ai-edition/LeftPanel.copyMessage.test.tsx | 12 ++++++++++++ src/components/ai-edition/LeftPanel.tsx | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) 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()} ) : null} From 9ce63acf8e84ccffd11137caa08945c621a3c090 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Mon, 12 Oct 2026 20:17:28 +0200 Subject: [PATCH 2/2] fix(chat): show a stored time that is no date as stored --- src/components/ai-edition/LeftPanel.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ai-edition/LeftPanel.tsx b/src/components/ai-edition/LeftPanel.tsx index 194bd73d2..84c5227b7 100644 --- a/src/components/ai-edition/LeftPanel.tsx +++ b/src/components/ai-edition/LeftPanel.tsx @@ -47,6 +47,12 @@ interface ChatDisplayMessage { thinking?: string; } +/** A message's clock time; a stored value that is no date is shown as stored. */ +function formatMessageTime(time: string): string { + const date = new Date(time); + return Number.isNaN(date.getTime()) ? time : date.toLocaleTimeString(); +} + // Quick-access model picker anchored to the composer's model pill — mirrors // axcut's LlmPopover in "models"/"providers" mode (a lightweight popover, not // the full AI-settings modal). "Provider settings…" in the providers screen @@ -1264,7 +1270,7 @@ export function ChatStripPanel() { color: "var(--muted)", }} > - {new Date(m.time).toLocaleTimeString()} + {formatMessageTime(m.time)} ) : null}