feat: scope overview to durable activity data
This commit is contained in:
parent
5a249dcf24
commit
c567b229cc
|
|
@ -136,6 +136,7 @@
|
|||
].flatMap(key => normalizeRows(settings?.[key])).filter(item => {
|
||||
const tagged = String(item.workspaceRootPath || item.workspaceName || item.workspaceNodeId || '').trim();
|
||||
if (tagged !== workspace) return false;
|
||||
if (String(item.globalState || 'inbox') === 'archived') return false;
|
||||
const captureId = String(item.captureId || '');
|
||||
if (!captureId || seen.has(captureId)) return !captureId;
|
||||
seen.add(captureId);
|
||||
|
|
@ -501,9 +502,14 @@
|
|||
const workspaceAtStart = String(workspaceRootPath || '').trim();
|
||||
loadedWorkspaceRoot = workspaceAtStart;
|
||||
loading = true;
|
||||
const [browserSettings, activitySettings, journalSettings, todoSettings, resources] = await Promise.all([
|
||||
const [browserSettings, activitySettings, activityRecords, journalSettings, todoSettings, resources] = await Promise.all([
|
||||
readPluginSettings('verstak.browser-inbox'),
|
||||
readPluginSettings('verstak.activity'),
|
||||
App.ReadPluginDataNDJSON
|
||||
? App.ReadPluginDataNDJSON('verstak.activity', 'activity-events')
|
||||
.then(value => decodeTuple(value, []))
|
||||
.catch(() => [])
|
||||
: Promise.resolve([]),
|
||||
readPluginSettings('verstak.journal'),
|
||||
readPluginSettings('verstak.todo'),
|
||||
loadWorkspaceResources(),
|
||||
|
|
@ -511,11 +517,10 @@
|
|||
if (workspaceAtStart !== String(workspaceRootPath || '').trim()) return;
|
||||
|
||||
captures = browserCaptureRowsForWorkspace(browserSettings);
|
||||
activityEvents = rowsFor(activitySettings, [
|
||||
workspaceKey('events:workspace:'),
|
||||
'events:global',
|
||||
'events',
|
||||
]);
|
||||
activityEvents = normalizeRows(activityRecords).filter(item => {
|
||||
const tagged = String(item.workspaceRootPath || item.workspaceName || item.workspaceNodeId || '').trim();
|
||||
return !tagged || tagged === workspaceAtStart;
|
||||
});
|
||||
journalEntries = rowsFor(journalSettings, [
|
||||
workspaceKey('worklog:workspace:'),
|
||||
'worklog',
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
import PluginBundleHost from '../plugin-host/PluginBundleHost.svelte';
|
||||
import Icon from '../ui/Icon.svelte';
|
||||
import { i18n } from '../i18n/index.js';
|
||||
import { debug } from '../log/debug.js';
|
||||
|
||||
export let openedResource = null;
|
||||
let locale = i18n.getLocale();
|
||||
|
|
@ -53,7 +54,9 @@
|
|||
{:else if openedResource}
|
||||
<div class="workbench-header vt-page-header">
|
||||
<span class="workbench-title vt-page-title">{resourcePath}</span>
|
||||
<span class="workbench-provider vt-badge accent">{providerId}</span>
|
||||
{#if debug.isEnabled() && providerId}
|
||||
<span class="workbench-provider vt-badge accent" data-debug-provider>{providerId}</span>
|
||||
{/if}
|
||||
<button class="close-btn btn-ghost btn-icon" type="button" title={tr('common.close')} aria-label={tr('common.close')} on:click={closeWorkbench}>
|
||||
<Icon name="x" size={18} />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -3343,6 +3343,14 @@
|
|||
},
|
||||
ReadPluginDataNDJSON: function (pluginId, name) {
|
||||
var data = (pluginData[pluginId] && pluginData[pluginId][name]) || [];
|
||||
if (!Array.isArray(data) && pluginId === 'verstak.activity' && name === 'activity-events') data = [];
|
||||
if (!data.length && pluginId === 'verstak.activity' && name === 'activity-events') {
|
||||
data = Object.keys(pluginSettings[pluginId] || {}).filter(function (key) {
|
||||
return key === 'events' || key === 'events:global' || key.indexOf('events:workspace:') === 0;
|
||||
}).flatMap(function (key) {
|
||||
return Array.isArray(pluginSettings[pluginId][key]) ? pluginSettings[pluginId][key] : [];
|
||||
});
|
||||
}
|
||||
return Promise.resolve([Array.isArray(data) ? data.slice() : [], '']);
|
||||
},
|
||||
WritePluginDataJSON: function (pluginId, name, data) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue