feat(coding-agent): add label timestamps to the session tree (#2691)

This commit is contained in:
warren
2026-03-30 15:56:37 +02:00
committed by GitHub
parent 21863d4ec7
commit 84d2b51a2e
8 changed files with 146 additions and 28 deletions

View File

@@ -248,6 +248,36 @@ describe("TreeSelectorComponent", () => {
});
});
describe("label timestamps", () => {
test("toggles label timestamps for labeled nodes", () => {
const entries = [userMessage("user-1", null, "hello"), assistantMessage("asst-1", "user-1", "hi")];
const tree = buildTree(entries);
const labelDate = new Date(2026, 2, 28, 14, 32, 0);
tree[0]!.label = "checkpoint";
tree[0]!.labelTimestamp = labelDate.toISOString();
const selector = new TreeSelectorComponent(
tree,
"asst-1",
24,
() => {},
() => {},
);
const list = selector.getTreeList();
let render = list.render(200).join("\n");
expect(render).toContain("[checkpoint]");
expect(render).not.toContain("3/28 14:32");
expect(render).not.toContain("[+label time]");
selector.handleInput("T");
render = list.render(200).join("\n");
expect(render).toContain("3/28 14:32");
expect(render).toContain("[+label time]");
});
});
describe("empty filter preservation", () => {
test("preserves selection when switching to empty labeled filter and back", () => {
// Tree with no labels