diff --git a/plugins/activity/plugin.json b/plugins/activity/plugin.json index 724ce86..e83b38e 100644 --- a/plugins/activity/plugin.json +++ b/plugins/activity/plugin.json @@ -30,15 +30,7 @@ "component": "ActivityView" } ], - "sidebarItems": [ - { - "id": "verstak.activity.sidebar", - "title": "Activity", - "icon": "activity", - "view": "verstak.activity.view", - "position": 20 - } - ], + "workspaceItems": [ { "id": "verstak.activity.workspace", diff --git a/plugins/browser-inbox/frontend/src/index.js b/plugins/browser-inbox/frontend/src/index.js index d019909..5faf2ad 100644 --- a/plugins/browser-inbox/frontend/src/index.js +++ b/plugins/browser-inbox/frontend/src/index.js @@ -52,6 +52,10 @@ '.browser-inbox-meta-value{color:#ccc;min-width:0;overflow-wrap:anywhere}', '.browser-inbox-text{border:1px solid #24304f;background:#101020;border-radius:6px;padding:.75rem;font-size:.85rem;line-height:1.5;color:#ddd;white-space:pre-wrap;overflow-wrap:anywhere}', '.browser-inbox-detail-actions{display:flex;gap:.5rem;flex-wrap:wrap}', + '.browser-inbox-picker{display:flex;flex-direction:column;gap:2px;width:100%;border:1px solid #2a3a5e;border-radius:6px;background:#12122a;padding:4px;max-height:240px;overflow:auto}', + '.browser-inbox-picker-item{font-size:.78rem;padding:.35rem .65rem;border:none;border-radius:4px;background:transparent;color:#d0d0e0;cursor:pointer;text-align:left}', + '.browser-inbox-picker-item:hover{background:#1e2a4a;color:#4ecca3}', + '.browser-inbox-picker-empty{font-size:.76rem;color:#8b8ba8;padding:.5rem;text-align:center}', '@media(max-width:760px){.browser-inbox-body{grid-template-columns:1fr}.browser-inbox-list{border-right:0;border-bottom:1px solid #16213e;max-height:45vh}.browser-inbox-meta{grid-template-columns:1fr}}' ].join('\n'); @@ -313,7 +317,9 @@ var scope = scopeFromProps(props || {}); var captures = []; - var selectedId = ''; + var selectedId = null; + var workspacesList = []; + var pickerOpen = false; var statusText = 'Connecting to receiver events...'; var statusClass = ''; var disposed = false; @@ -665,6 +671,39 @@ } })); } + } else { + actionButtons.push(el('button', { + className: 'browser-inbox-btn', + 'data-browser-inbox-action': 'assign', + textContent: 'Assign to Workspace', + onClick: function () { + pickerOpen = !pickerOpen; + render(); + } + })); + if (pickerOpen) { + var pickerContainer = el('div', { className: 'browser-inbox-picker' }); + if (workspacesList.length > 0) { + workspacesList.forEach(function (ws) { + var wsPath = ws.rootPath || ws.name || ws.id || ''; + pickerContainer.appendChild(el('button', { + className: 'browser-inbox-picker-item', + textContent: ws.name || ws.title || wsPath, + title: wsPath, + onClick: function () { + pickerOpen = false; + assignToWorkspace(capture, wsPath); + } + })); + }); + } else { + pickerContainer.appendChild(el('div', { + className: 'browser-inbox-picker-empty', + textContent: 'No workspaces found. Create a workspace first.' + })); + } + actionButtons.push(pickerContainer); + } } actionButtons.push(el('button', { className: 'browser-inbox-btn danger', @@ -738,7 +777,27 @@ }); } + function loadWorkspacesList() { + if (!api || !api.workspaces || typeof api.workspaces.list !== 'function') return Promise.resolve(); + return api.workspaces.list().then(function (list) { + workspacesList = Array.isArray(list) ? list : []; + }).catch(function () { + workspacesList = []; + }); + } + + function assignToWorkspace(capture, workspacePath) { + if (!capture || !workspacePath) return Promise.resolve(); + capture.workspaceRootPath = workspacePath; + capture._storageKey = WORKSPACE_PREFIX + encodeKey(workspacePath); + selectedId = capture.captureId; + return persist().then(function () { + render(); + }); + } + render(); + loadWorkspacesList(); loadStored().then(function () { if (disposed) return; render(); diff --git a/plugins/browser-inbox/plugin.json b/plugins/browser-inbox/plugin.json index 9a618c7..1d67691 100644 --- a/plugins/browser-inbox/plugin.json +++ b/plugins/browser-inbox/plugin.json @@ -39,14 +39,6 @@ "view": "verstak.browser-inbox.view", "position": 30 } - ], - "workspaceItems": [ - { - "id": "verstak.browser-inbox.workspace", - "title": "Browser Inbox", - "icon": "inbox", - "component": "BrowserInboxView" - } ] } } diff --git a/plugins/journal/plugin.json b/plugins/journal/plugin.json index fc0b874..1adb9ee 100644 --- a/plugins/journal/plugin.json +++ b/plugins/journal/plugin.json @@ -31,15 +31,7 @@ "component": "JournalView" } ], - "sidebarItems": [ - { - "id": "verstak.journal.sidebar", - "title": "Journal", - "icon": "book-open", - "view": "verstak.journal.view", - "position": 30 - } - ], + "workspaceItems": [ { "id": "verstak.journal.workspace", diff --git a/plugins/platform-test/plugin.json b/plugins/platform-test/plugin.json index 90e0f7b..d25054e 100644 --- a/plugins/platform-test/plugin.json +++ b/plugins/platform-test/plugin.json @@ -57,15 +57,6 @@ "handler": "showVersion" } ], - "sidebarItems": [ - { - "id": "verstak.platform-test.sidebar", - "title": "Platform Test", - "icon": "flask", - "view": "verstak.platform-test.diagnostics", - "position": 100 - } - ], "statusBarItems": [ { "id": "verstak.platform-test.status", diff --git a/plugins/search/plugin.json b/plugins/search/plugin.json index a319dcb..b411776 100644 --- a/plugins/search/plugin.json +++ b/plugins/search/plugin.json @@ -27,14 +27,6 @@ "entry": "frontend/src/index.js" }, "contributes": { - "workspaceItems": [ - { - "id": "verstak.search.workspace", - "title": "Search", - "icon": "search", - "component": "SearchView" - } - ], "commands": [ { "id": "verstak.search.searchVaultText",