feat: add interactive inbox view

This commit is contained in:
2026-06-05 00:59:57 +08:00
parent 02d68ca3f4
commit 035f877280
13 changed files with 163 additions and 8 deletions
+10 -2
View File
@@ -133,6 +133,12 @@ async function runReadyScenario(cdp, url) {
await click(cdp, '.close-btn')
await waitForGone(cdp, '.settings-window')
await clickText(cdp, '.nav-item', 'Неразобранное')
await assertText(cdp, 'Неразобранное', 'inbox: system view opens')
await assertText(cdp, 'Inbox Smoke Item', 'inbox: unassigned item visible')
await clickText(cdp, '.inbox-item-actions .btn', 'Открыть')
await assertText(cdp, 'Inbox Smoke Item', 'inbox: item opens from list')
await clickText(cdp, '.tree-label', 'Smoke Project')
await waitForSelector(cdp, '.tabs')
await assertText(cdp, 'Smoke Project', 'node: selected project visible')
@@ -565,6 +571,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: '', createdAt: now, has_children: false, children: [] },
],
notes: {
'node-project': [{ id: 'note-1', title: 'Smoke note', createdAt: now }],
@@ -671,6 +678,7 @@ function wailsMockSource() {
],
ListWorkspaceTree: async () => clone(state.nodes),
ListWorkspaceChildren: async (id) => clone(childrenOf(id)),
ListInboxNodes: async () => clone(state.nodes.filter((node) => !node.parent_id && (!node.section || node.section === 'inbox'))),
ListEnabledTemplates: async () => clone(templates),
AllTemplates: async () => clone(templates),
SetTemplateEnabled: async () => true,
@@ -679,9 +687,9 @@ function wailsMockSource() {
SearchNodes: async (query) => allNodes().filter((node) => node.title.toLowerCase().includes(String(query || '').toLowerCase())).map((node) => ({ id: node.id, title: node.title, path: '/Smoke/' + node.title })),
CreateNodeFromTemplate: async (parentId, title, templateId) => {
const id = 'node-created-' + Date.now();
const node = { id, title, type: templateId?.split('.')[0] || 'folder', section: 'projects', parent_id: parentId || '', createdAt: now, has_children: false, children: [] };
const parent = parentId ? findNode(parentId) : null;
const node = { id, title, type: templateId?.split('.')[0] || 'folder', section: parent?.section || '', parent_id: parentId || '', createdAt: now, has_children: false, children: [] };
if (parentId) {
const parent = findNode(parentId);
if (parent) {
parent.children = parent.children || [];
parent.children.push(node);