feat(coding-agent): add message copy shortcut

This commit is contained in:
Armin Ronacher
2026-07-10 20:36:30 +02:00
parent 3ea064ea2a
commit 3b686ac224
9 changed files with 106 additions and 13 deletions
@@ -264,6 +264,7 @@ describe("TreeSelectorComponent", () => {
const plainLines = selector.render(30).map(stripVTControlCharacters);
const plain = plainLines.join("\n");
expect(plain).toContain("branch");
expect(plain).toContain("copy");
expect(plain).toContain("filters");
expect(plain).toContain("cycle");
expect(plain).toContain("label time");
@@ -272,6 +273,28 @@ describe("TreeSelectorComponent", () => {
});
});
describe("copy", () => {
test("copies the full selected message with ctrl+x", () => {
const message = `${"long message ".repeat(30)}\nsecond line`;
const tree = buildTree([userMessage("user-1", null, "hello"), assistantMessage("asst-1", "user-1", message)]);
const selector = new TreeSelectorComponent(
tree,
"asst-1",
24,
() => {},
() => {},
);
let copied: string | undefined;
selector.onCopy = (text) => {
copied = text;
};
selector.handleInput("\x18");
expect(copied).toBe(message);
});
});
describe("label timestamps", () => {
test("toggles label timestamps for labeled nodes", () => {
const entries = [userMessage("user-1", null, "hello"), assistantMessage("asst-1", "user-1", "hi")];