feat(desktop): show activity timestamps on demand (#1506)

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Taylor Ho
2026-07-04 08:40:49 -07:00
committed by GitHub
parent f35aeb7986
commit c7a8b0babb
6 changed files with 272 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ import {
getActivityHeadline,
isMeaningfulItem,
isSpineItem,
shouldShowTranscriptRowTimestamp,
} from "./agentSessionTranscriptPresentation.ts";
const baseTimestamp = "2026-06-14T19:00:00.000Z";
@@ -255,3 +256,59 @@ test("two-tier headline: metadata headlines when it is the only activity (sessio
// activityRenderClasses/RawRailActivity.render.test.mjs — they use
// renderToStaticMarkup and would fail if the isRawPayload branch in
// RawRailActivity were removed.
test("shouldShowTranscriptRowTimestamp: off by default (enabled=false)", () => {
assert.equal(
shouldShowTranscriptRowTimestamp(makeTool(), {
enabled: false,
variant: "default",
}),
false,
);
});
test("shouldShowTranscriptRowTimestamp: enabled shows for tools, thoughts, assistant messages", () => {
const options = { enabled: true, variant: "default" };
assert.equal(shouldShowTranscriptRowTimestamp(makeTool(), options), true);
assert.equal(
shouldShowTranscriptRowTimestamp(
makeMessage({ role: "assistant" }),
options,
),
true,
);
assert.equal(
shouldShowTranscriptRowTimestamp(
{
id: "thought:1",
type: "thought",
title: "Thinking",
text: "hmm",
timestamp: baseTimestamp,
},
options,
),
true,
);
});
test("shouldShowTranscriptRowTimestamp: user message bubbles keep their own footer (excluded)", () => {
assert.equal(
shouldShowTranscriptRowTimestamp(
makeMessage({ role: "user", title: "tho" }),
{ enabled: true, variant: "default" },
),
false,
"user bubbles already render a timestamp footer",
);
});
test("shouldShowTranscriptRowTimestamp: compact preview stays dense", () => {
assert.equal(
shouldShowTranscriptRowTimestamp(makeTool(), {
enabled: true,
variant: "compactPreview",
}),
false,
);
});