Compact imported single-thread conversation copy

This commit is contained in:
kris
2026-04-07 12:49:53 +08:00
parent c5223c7c16
commit a43bb92f3c
4 changed files with 122 additions and 8 deletions

View File

@@ -581,6 +581,34 @@ test("conversation home compacts imported previews and trims local workspace pre
assert.equal(folder?.lastMessagePreview, "已导入线程");
});
test("conversation home compacts imported previews and trims local workspace prefixes for single-thread items", async () => {
await setup();
const state = await readState();
state.projects = state.projects.filter((project) => project.id === "master-agent");
state.projects.push({
...buildImportedThreadProject(
"mac-studio",
"zhanglaoshi-thread-1",
"zhanglaoshi",
"/Users/kris/code/zhanglaoshi",
"/Users/kris/code/zhanglaoshi/docs/superpowers/specs/2026-04-06-single-thread-cleanup-design.md",
"thread-1",
"2026-04-06T15:00:00+08:00",
),
preview: "已从设备 Mac Studio 导入线程《zhanglaoshi · 019d61》。",
lastMessageAt: "2026-04-06T15:00:00+08:00",
});
const item = getConversationHomeItems(state).find((entry) => entry.projectId === "zhanglaoshi-thread-1");
assert.ok(item, "expected single imported thread item");
assert.equal(item?.conversationType, "single_device");
assert.equal(item?.threadTitle, "zhanglaoshi/docs/superpowers/specs/2026-04-06-single-thread-cleanup-design.md");
assert.equal(item?.preview, "已导入线程");
assert.equal(item?.lastMessagePreview, "已导入线程");
});
test("folder archive homepage rows expose pin toggles when the folder is pinned", async () => {
await setup();
const state = await readState();