feat: model inbox capture artifacts

This commit is contained in:
2026-06-05 01:40:08 +08:00
parent 2e86229350
commit d6ef3a973a
10 changed files with 108 additions and 17 deletions
+6 -3
View File
@@ -132,10 +132,13 @@ async function runReadyScenario(cdp, url) {
await screenshot(cdp, 'settings.png')
await click(cdp, '.close-btn')
await waitForGone(cdp, '.settings-window')
await assertEval(cdp, `![...document.querySelectorAll('.tree-label')].some((el) => el.innerText.includes('Inbox Smoke Item'))`, 'workspace: captured item hidden from tree')
await clickText(cdp, '.nav-item', 'Неразобранное')
await assertText(cdp, 'Неразобранное', 'inbox: system view opens')
await assertText(cdp, 'Inbox Smoke Item', 'inbox: captured item visible')
await assertText(cdp, 'Текст', 'inbox: capture kind visible')
await assertText(cdp, 'Буфер обмена', 'inbox: capture source visible')
await assertEval(cdp, `!document.querySelector('.inbox-screen')?.innerText.includes('Manual Root Item')`, 'inbox: manual root is hidden')
await screenshot(cdp, 'inbox.png')
await clickText(cdp, '.inbox-item-actions .btn', 'Открыть')
@@ -578,7 +581,7 @@ function wailsMockSource() {
],
},
{ id: 'node-client', title: 'Smoke Client', type: 'client', section: 'clients', createdAt: now, has_children: false, children: [] },
{ id: 'node-inbox', title: 'Inbox Smoke Item', type: 'folder', section: '', captureInbox: true, createdAt: now, has_children: false, children: [] },
{ id: 'node-inbox', title: 'Inbox Smoke Item', type: 'folder', section: '', captureInbox: true, captureKind: 'text', captureSource: 'clipboard', createdAt: now, has_children: false, children: [] },
{ id: 'node-manual-root', title: 'Manual Root Item', type: 'folder', section: '', createdAt: now, has_children: false, children: [] },
],
notes: {
@@ -685,9 +688,9 @@ function wailsMockSource() {
{ id: 'activity', label: 'Активность' },
{ id: 'journal', label: 'Журнал' },
],
ListWorkspaceTree: async () => clone(state.nodes),
ListWorkspaceTree: async () => clone(state.nodes.filter((node) => node.captureInbox !== true)),
ListWorkspaceChildren: async (id) => clone(childrenOf(id)),
ListInboxNodes: async () => clone(state.nodes.filter((node) => !node.parent_id && node.captureInbox === true)),
ListInboxNodes: async () => clone(state.nodes.filter((node) => !node.parent_id && node.captureInbox === true).map((node) => ({ ...node, captureKind: node.captureKind || '', captureSource: node.captureSource || '' }))),
ListTrash: async () => clone({
trashPath: '/tmp/verstak-smoke-vault/.verstak/trash',
nodes: [{ id: 'node-trash', title: 'Trash Smoke Folder', type: 'folder', fsPath: 'Trash Smoke Folder', deletedAt: now }],