GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(web): rework message metadata, timestamps, and tool work log rows · pingdotgg/t3code@245fb15

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src
    • components/chat
      • MessageCopyButton.tsx
      • MessagesTimeline.browser.tsx
      • MessagesTimeline.logic.test.ts
      • MessagesTimeline.logic.ts
      • MessagesTimeline.test.tsx
      • MessagesTimeline.tsx
    • session-logic.test.ts
    • session-logic.ts
    • timestampFormat.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/chat/MessageCopyButton.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessageCopyButton.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ export const MessageCopyButton = memo(function MessageCopyButton({
6868
type="button"
6969
size={size}
7070
variant={variant}
71-
className={cn(className)}
71+
className={cn("text-muted-foreground hover:text-foreground", className)}
7272
/>
7373
}
7474
>
75-
{isCopied ? <CheckIcon className="size-3 text-success" /> : <CopyIcon className="size-3" />}
75+
{isCopied ? <CheckIcon className="size-3 text-primary" /> : <CopyIcon className="size-3" />}
7676
</TooltipTrigger>
7777
<TooltipPopup>
7878
<p>Copy to clipboard</p>
Collapse file

‎apps/web/src/components/chat/MessagesTimeline.browser.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.browser.tsx
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ describe("MessagesTimeline", () => {
114114
entry: {
115115
id: "work-1",
116116
createdAt: "2026-04-13T12:00:00.000Z",
117-
label: "thinking",
117+
label: "read files",
118118
detail: "Inspecting repository state",
119-
tone: "thinking",
119+
tone: "tool",
120120
},
121121
},
122122
]}
@@ -127,7 +127,7 @@ describe("MessagesTimeline", () => {
127127
await expect
128128
.element(page.getByText("Send a message to start the conversation."))
129129
.not.toBeInTheDocument();
130-
await expect.element(page.getByText("Thinking - Inspecting repository state")).toBeVisible();
130+
await expect.element(page.getByText("Inspecting repository state")).toBeVisible();
131131
} finally {
132132
await screen.unmount();
133133
}
@@ -161,16 +161,16 @@ describe("MessagesTimeline", () => {
161161
entry: {
162162
id: "work-1",
163163
createdAt: "2026-04-13T12:00:00.000Z",
164-
label: "thinking",
164+
label: "read files",
165165
detail: "Inspecting repository state",
166-
tone: "thinking",
166+
tone: "tool",
167167
},
168168
},
169169
]}
170170
/>,
171171
);
172172

173-
await expect.element(page.getByText("Thinking - Inspecting repository state")).toBeVisible();
173+
await expect.element(page.getByText("Inspecting repository state")).toBeVisible();
174174
expect(props.onIsAtEndChange).toHaveBeenCalledWith(true);
175175
expect(scrollToEndSpy).toHaveBeenCalledWith({ animated: false });
176176
expect(requestAnimationFrameSpy).toHaveBeenCalled();
Collapse file

‎apps/web/src/components/chat/MessagesTimeline.logic.test.ts‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.logic.test.ts
+137-3Lines changed: 137 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ describe("deriveMessagesTimelineRows", () => {
251251
},
252252
],
253253
completionDividerBeforeEntryId: "assistant-final-entry",
254+
completionDividerDuration: null,
254255
isWorking: false,
255256
activeTurnStartedAt: null,
256257
turnDiffSummaryByAssistantMessageId: new Map(),
@@ -301,7 +302,7 @@ describe("deriveMessagesTimelineRows", () => {
301302
},
302303
],
303304
completionDividerBeforeEntryId: "assistant-two-entry",
304-
completionSummary: "done",
305+
completionDividerDuration: "5m",
305306
isWorking: false,
306307
activeTurnInProgress: true,
307308
activeTurnId: "turn-2" as never,
@@ -316,9 +317,9 @@ describe("deriveMessagesTimelineRows", () => {
316317
);
317318

318319
expect(assistantRows[0]?.assistantCopyStreaming).toBe(false);
319-
expect(assistantRows[0]?.completionSummary).toBeNull();
320+
expect(assistantRows[0]?.completionDividerDuration).toBeNull();
320321
expect(assistantRows[1]?.assistantCopyStreaming).toBe(true);
321-
expect(assistantRows[1]?.completionSummary).toBe("done");
322+
expect(assistantRows[1]?.completionDividerDuration).toBe("5m");
322323
});
323324

324325
it("projects assistant diff summaries and user revert counts onto the affected rows", () => {
@@ -361,6 +362,7 @@ describe("deriveMessagesTimelineRows", () => {
361362
},
362363
],
363364
completionDividerBeforeEntryId: null,
365+
completionDividerDuration: null,
364366
isWorking: false,
365367
activeTurnStartedAt: null,
366368
turnDiffSummaryByAssistantMessageId: new Map([
@@ -381,6 +383,135 @@ describe("deriveMessagesTimelineRows", () => {
381383
expect(userRow?.revertTurnCount).toBe(1);
382384
expect(assistantRow?.assistantTurnDiffSummary).toBe(assistantTurnDiffSummary);
383385
});
386+
387+
it("computes the completion divider duration from the current assistant row", () => {
388+
const rows = deriveMessagesTimelineRows({
389+
timelineEntries: [
390+
{
391+
id: "user-entry",
392+
kind: "message",
393+
createdAt: "2026-01-01T00:00:00Z",
394+
message: {
395+
id: "user-1" as never,
396+
role: "user",
397+
text: "Build it",
398+
turnId: null,
399+
createdAt: "2026-01-01T00:00:00Z",
400+
streaming: false,
401+
},
402+
},
403+
{
404+
id: "assistant-entry",
405+
kind: "message",
406+
createdAt: "2026-01-01T00:00:05Z",
407+
message: {
408+
id: "assistant-1" as never,
409+
role: "assistant",
410+
text: "Done",
411+
turnId: "turn-1" as never,
412+
createdAt: "2026-01-01T00:00:05Z",
413+
completedAt: "2026-01-01T00:00:22Z",
414+
streaming: false,
415+
},
416+
},
417+
],
418+
completionDividerBeforeEntryId: "assistant-entry",
419+
completionDividerDuration: null,
420+
isWorking: false,
421+
activeTurnStartedAt: null,
422+
turnDiffSummaryByAssistantMessageId: new Map(),
423+
revertTurnCountByUserMessageId: new Map(),
424+
});
425+
426+
const assistantRow = rows.find(
427+
(row): row is Extract<(typeof rows)[number], { kind: "message" }> =>
428+
row.kind === "message" && row.message.role === "assistant",
429+
);
430+
431+
expect(assistantRow?.completionDividerDuration).toBe("22s");
432+
});
433+
434+
it("uses the turn-level completion duration for the completion divider", () => {
435+
const rows = deriveMessagesTimelineRows({
436+
timelineEntries: [
437+
{
438+
id: "assistant-entry",
439+
kind: "message",
440+
createdAt: "2026-01-01T00:04:44Z",
441+
message: {
442+
id: "assistant-1" as never,
443+
role: "assistant",
444+
text: "Done",
445+
turnId: "turn-1" as never,
446+
createdAt: "2026-01-01T00:04:44Z",
447+
completedAt: "2026-01-01T00:05:00Z",
448+
streaming: false,
449+
},
450+
},
451+
],
452+
completionDividerBeforeEntryId: "assistant-entry",
453+
completionDividerDuration: "5m",
454+
isWorking: false,
455+
activeTurnStartedAt: null,
456+
turnDiffSummaryByAssistantMessageId: new Map(),
457+
revertTurnCountByUserMessageId: new Map(),
458+
});
459+
460+
const assistantRow = rows.find(
461+
(row): row is Extract<(typeof rows)[number], { kind: "message" }> =>
462+
row.kind === "message" && row.message.role === "assistant",
463+
);
464+
465+
expect(assistantRow?.completionDividerDuration).toBe("5m");
466+
});
467+
468+
it("only shows assistant metadata on the terminal assistant message", () => {
469+
const rows = deriveMessagesTimelineRows({
470+
timelineEntries: [
471+
{
472+
id: "assistant-thought-entry",
473+
kind: "message",
474+
createdAt: "2026-01-01T00:00:10Z",
475+
message: {
476+
id: "assistant-thought" as never,
477+
role: "assistant",
478+
text: "Checking first.",
479+
turnId: "turn-1" as never,
480+
createdAt: "2026-01-01T00:00:10Z",
481+
completedAt: "2026-01-01T00:00:11Z",
482+
streaming: false,
483+
},
484+
},
485+
{
486+
id: "assistant-final-entry",
487+
kind: "message",
488+
createdAt: "2026-01-01T00:00:20Z",
489+
message: {
490+
id: "assistant-final" as never,
491+
role: "assistant",
492+
text: "Done.",
493+
turnId: "turn-1" as never,
494+
createdAt: "2026-01-01T00:00:20Z",
495+
completedAt: "2026-01-01T00:00:30Z",
496+
streaming: false,
497+
},
498+
},
499+
],
500+
completionDividerBeforeEntryId: null,
501+
completionDividerDuration: null,
502+
isWorking: false,
503+
activeTurnStartedAt: null,
504+
turnDiffSummaryByAssistantMessageId: new Map(),
505+
revertTurnCountByUserMessageId: new Map(),
506+
});
507+
508+
const assistantRows = rows.filter(
509+
(row): row is Extract<(typeof rows)[number], { kind: "message" }> =>
510+
row.kind === "message" && row.message.role === "assistant",
511+
);
512+
513+
expect(assistantRows.map((row) => row.showAssistantMeta)).toEqual([false, true]);
514+
});
384515
});
385516

386517
describe("computeStableMessagesTimelineRows", () => {
@@ -418,6 +549,7 @@ describe("computeStableMessagesTimelineRows", () => {
418549
},
419550
],
420551
completionDividerBeforeEntryId: null,
552+
completionDividerDuration: null,
421553
isWorking: false,
422554
activeTurnStartedAt: null,
423555
turnDiffSummaryByAssistantMessageId: new Map(),
@@ -468,6 +600,7 @@ describe("computeStableMessagesTimelineRows", () => {
468600
},
469601
],
470602
completionDividerBeforeEntryId: null,
603+
completionDividerDuration: null,
471604
isWorking: false,
472605
activeTurnStartedAt: null,
473606
turnDiffSummaryByAssistantMessageId: new Map(),
@@ -523,6 +656,7 @@ describe("computeStableMessagesTimelineRows", () => {
523656
},
524657
],
525658
completionDividerBeforeEntryId: null,
659+
completionDividerDuration: null,
526660
isWorking: false,
527661
activeTurnStartedAt: null,
528662
turnDiffSummaryByAssistantMessageId: new Map(),
Collapse file

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.logic.ts
+38-11Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import * as Equal from "effect/Equal";
2-
import { type TimelineEntry, type WorkLogEntry } from "../../session-logic";
2+
import { formatDuration, type TimelineEntry, type WorkLogEntry } from "../../session-logic";
33
import { type ChatMessage, type ProposedPlan, type TurnDiffSummary } from "../../types";
44
import { type MessageId, type TurnId } from "@t3tools/contracts";
55

6-
export const MAX_VISIBLE_WORK_LOG_ENTRIES = 6;
6+
export const MAX_VISIBLE_WORK_LOG_ENTRIES = 1;
7+
8+
function computeElapsedMs(startIso: string, endIso: string): number | null {
9+
const start = Date.parse(startIso);
10+
const end = Date.parse(endIso);
11+
if (!Number.isFinite(start) || !Number.isFinite(end)) return null;
12+
return Math.max(0, end - start);
13+
}
714

815
export interface TimelineDurationMessage {
916
id: string;
@@ -26,7 +33,8 @@ export type MessagesTimelineRow =
2633
message: ChatMessage;
2734
durationStart: string;
2835
showCompletionDivider: boolean;
29-
completionSummary: string | null;
36+
completionDividerDuration?: string | null;
37+
showAssistantMeta: boolean;
3038
showAssistantCopyButton: boolean;
3139
assistantCopyStreaming: boolean;
3240
assistantTurnDiffSummary?: TurnDiffSummary | undefined;
@@ -113,7 +121,7 @@ function deriveTerminalAssistantMessageIds(timelineEntries: ReadonlyArray<Timeli
113121
export function deriveMessagesTimelineRows(input: {
114122
timelineEntries: ReadonlyArray<TimelineEntry>;
115123
completionDividerBeforeEntryId: string | null;
116-
completionSummary?: string | null;
124+
completionDividerDuration: string | null;
117125
isWorking: boolean;
118126
activeTurnInProgress?: boolean;
119127
activeTurnId?: TurnId | null;
@@ -171,19 +179,36 @@ export function deriveMessagesTimelineRows(input: {
171179
const showCompletionDivider =
172180
timelineEntry.message.role === "assistant" &&
173181
input.completionDividerBeforeEntryId === timelineEntry.id;
182+
const durationStart =
183+
durationStartByMessageId.get(timelineEntry.message.id) ?? timelineEntry.message.createdAt;
184+
185+
let completionDividerDuration: string | null = null;
186+
if (showCompletionDivider) {
187+
if (input.completionDividerDuration) {
188+
completionDividerDuration = input.completionDividerDuration;
189+
} else {
190+
const start = durationStart;
191+
const end = timelineEntry.message.completedAt ?? timelineEntry.message.createdAt;
192+
const elapsed = computeElapsedMs(start, end);
193+
if (elapsed !== null) {
194+
completionDividerDuration = formatDuration(elapsed);
195+
}
196+
}
197+
}
198+
199+
const showAssistantMeta =
200+
timelineEntry.message.role === "assistant" &&
201+
terminalAssistantMessageIds.has(timelineEntry.message.id);
174202

175203
nextRows.push({
176204
kind: "message",
177205
id: timelineEntry.id,
178206
createdAt: timelineEntry.createdAt,
179207
message: timelineEntry.message,
180-
durationStart:
181-
durationStartByMessageId.get(timelineEntry.message.id) ?? timelineEntry.message.createdAt,
208+
durationStart,
182209
showCompletionDivider,
183-
completionSummary: showCompletionDivider ? (input.completionSummary ?? null) : null,
184-
showAssistantCopyButton:
185-
timelineEntry.message.role === "assistant" &&
186-
terminalAssistantMessageIds.has(timelineEntry.message.id),
210+
showAssistantMeta,
211+
showAssistantCopyButton: showAssistantMeta,
187212
assistantCopyStreaming: timelineEntry.message.streaming || assistantTurnStillInProgress,
188213
assistantTurnDiffSummary:
189214
timelineEntry.message.role === "assistant"
@@ -193,6 +218,7 @@ export function deriveMessagesTimelineRows(input: {
193218
timelineEntry.message.role === "user"
194219
? input.revertTurnCountByUserMessageId.get(timelineEntry.message.id)
195220
: undefined,
221+
completionDividerDuration,
196222
});
197223
}
198224

@@ -247,7 +273,8 @@ function isRowUnchanged(a: MessagesTimelineRow, b: MessagesTimelineRow): boolean
247273
a.message === bm.message &&
248274
a.durationStart === bm.durationStart &&
249275
a.showCompletionDivider === bm.showCompletionDivider &&
250-
a.completionSummary === bm.completionSummary &&
276+
a.completionDividerDuration === bm.completionDividerDuration &&
277+
a.showAssistantMeta === bm.showAssistantMeta &&
251278
a.showAssistantCopyButton === bm.showAssistantCopyButton &&
252279
a.assistantCopyStreaming === bm.assistantCopyStreaming &&
253280
a.assistantTurnDiffSummary === bm.assistantTurnDiffSummary &&
Collapse file

‎apps/web/src/components/chat/MessagesTimeline.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.test.tsx
+28-1Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ describe("MessagesTimeline", () => {
228228
);
229229

230230
expect(markup).toContain("Context compacted");
231-
expect(markup).toContain("Work log");
231+
expect(markup).toContain("work log");
232232
});
233233

234234
it("formats changed file paths from the workspace root", async () => {
@@ -296,4 +296,31 @@ describe("MessagesTimeline", () => {
296296
expect(markup).not.toContain("&lt;review_comment");
297297
expect(markup).not.toContain("&lt;/review_comment&gt;");
298298
});
299+
300+
it("renders a failure marker for failed tool lifecycle entries", async () => {
301+
const { MessagesTimeline } = await import("./MessagesTimeline");
302+
const markup = renderToStaticMarkup(
303+
<MessagesTimeline
304+
{...buildProps()}
305+
timelineEntries={[
306+
{
307+
id: "entry-1",
308+
kind: "work",
309+
createdAt: "2026-03-17T19:12:28.000Z",
310+
entry: {
311+
id: "work-1",
312+
createdAt: "2026-03-17T19:12:28.000Z",
313+
label: "Glob",
314+
tone: "tool",
315+
toolLifecycleStatus: "failed",
316+
detail: "No files found",
317+
},
318+
},
319+
]}
320+
/>,
321+
);
322+
323+
expect(markup).toContain("lucide-x");
324+
expect(markup).toContain('aria-label="Tool call failed"');
325+
});
299326
});

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.