Revert "fix: P1 shell tooltip fixes + Today routing + workspaces API"

This reverts commit 9d06b164d3.
This commit is contained in:
mirivlad 2026-07-01 07:44:28 +08:00
parent 9d06b164d3
commit 167d593245
6 changed files with 40 additions and 67 deletions

View File

@ -7,7 +7,6 @@
import VaultSelection from './lib/shell/VaultSelection.svelte';
import WorkbenchHost from './lib/shell/WorkbenchHost.svelte';
import WorkspaceHost from './lib/shell/WorkspaceHost.svelte';
import TodaySurface from './lib/shell/TodaySurface.svelte';
import * as App from '../wailsjs/go/api/App';
import { debug } from './lib/log/debug.js';
import { onMount } from 'svelte';
@ -75,20 +74,33 @@
if (err || !workspaces || workspaces.length === 0) {
workspaceNodes = [];
selectedWorkspaceName = '';
currentView = 'today';
currentView = 'workspace-empty';
emitWorkspaceActive('');
return;
}
workspaceNodes = workspaces.map(workspaceAsNode);
selectedWorkspaceName = '';
currentView = 'today';
emitWorkspaceActive('');
let currentWorkspace = null;
try {
currentWorkspace = await App.GetCurrentWorkspace();
} catch {
currentWorkspace = null;
}
const currentName = workspaceName(currentWorkspace);
const selected = workspaces.find((workspace) => workspaceName(workspace) === currentName) || workspaces[0];
selectedWorkspaceName = workspaceName(selected);
if (selectedWorkspaceName) {
try { await App.SetCurrentWorkspace(selectedWorkspaceName); } catch {}
currentView = 'workspace';
} else {
currentView = 'workspace-empty';
}
emitWorkspaceActive(selectedWorkspaceName);
} catch (e) {
debug.log('[App] openDefaultWorkspaceRoute ERROR', String(e));
workspaceNodes = [];
selectedWorkspaceName = '';
currentView = 'today';
currentView = 'workspace-empty';
emitWorkspaceActive('');
}
}
@ -382,12 +394,6 @@
<PluginManager {activeSettingsPluginId} {activeSettingsPanelId} />
{:else if currentView === 'workbench'}
<WorkbenchHost {openedResource} />
{:else if currentView === 'today'}
<TodaySurface
workspaceRootPath=""
workspaceTitle=""
availableTools={[]}
/>
{:else if currentView === 'workspace' || currentView === 'workspace-empty'}
<WorkspaceHost
selectedWorkspaceName={selectedWorkspaceName}

View File

@ -502,15 +502,6 @@ export function createPluginAPI(pluginId) {
}
},
workspaces: {
list: function() {
assertActive('workspaces.list');
return callBackend(pluginId, 'workspaces.list', function() {
return App.ListWorkspaces();
});
}
},
dispose: function() {
if (disposed) return;
disposed = true;

View File

@ -83,20 +83,6 @@
<GlobalSearch />
{/if}
{#if vaultOpen}
<div class="sidebar-section">
<span class="section-label">Overview</span>
<button
class="nav-item today-item"
on:click={() => window.dispatchEvent(new CustomEvent('verstak:nav', { detail: { viewId: 'today' } }))}
type="button"
>
<span class="nav-icon-today"></span>
<span class="nav-label">Today</span>
</button>
</div>
{/if}
{#if sidebarItems.length > 0}
<div class="sidebar-section">
<span class="section-label">Tools</span>
@ -216,21 +202,6 @@
color: #a78bfa;
}
.today-item {
gap: 0.55rem;
}
.nav-icon-today {
width: 0.9rem;
height: 0.9rem;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
color: #4ecca3;
flex-shrink: 0;
}
.nav-label {
overflow: hidden;
text-overflow: ellipsis;

View File

@ -95,7 +95,7 @@
class:status-bar-warning={item.handler}
class="status-bar-item"
data-status-item-id={item.id}
title={item.handler ? `${item.pluginId}: click for details` : (item.label || item.id)}
title={item.handler ? `${item.pluginId}: compact status only` : item.pluginId}
>
{#if item.handler}<Icon name="warning" size={11} class="status-warning-icon" />{/if}
{item.label || item.id}
@ -108,7 +108,7 @@
class:status-bar-warning={item.handler}
class="status-bar-item"
data-status-item-id={item.id}
title={item.handler ? `${item.pluginId}: click for details` : (item.label || item.id)}
title={item.handler ? `${item.pluginId}: compact status only` : item.pluginId}
>
{#if item.handler}<Icon name="warning" size={11} class="status-warning-icon" />{/if}
{item.label || item.id}
@ -121,7 +121,7 @@
class:status-bar-warning={item.handler}
class="status-bar-item"
data-status-item-id={item.id}
title={item.handler ? `${item.pluginId}: click for details` : (item.label || item.id)}
title={item.handler ? `${item.pluginId}: compact status only` : item.pluginId}
>
{#if item.handler}<Icon name="warning" size={11} class="status-warning-icon" />{/if}
{item.label || item.id}

View File

@ -13,7 +13,6 @@
let activity = [];
let worklogSuggestions = [];
$: isGlobal = !workspaceRootPath || String(workspaceRootPath).trim() === '';
$: hasBrowserInbox = hasTool('browser inbox') || hasTool('inbox');
$: hasActivity = hasTool('activity');
$: hasFiles = hasTool('files');
@ -112,18 +111,24 @@
readPluginSettings('verstak.journal'),
]);
if (isGlobal) {
captures = rowsFor(browserSettings, ['captures:global', 'captures']).slice(0, 4);
activity = rowsFor(activitySettings, ['events:global', 'events']).slice(0, 4);
worklogSuggestions = rowsFor(journalSettings, ['suggestions', 'worklog']).slice(0, 4);
} else {
captures = rowsFor(browserSettings, [workspaceKey('captures:workspace:')]).slice(0, 4);
activity = rowsFor(activitySettings, [workspaceKey('events:workspace:')]).slice(0, 4);
captures = rowsFor(browserSettings, [
workspaceKey('captures:workspace:'),
'captures:global',
'captures',
]).slice(0, 4);
activity = rowsFor(activitySettings, [
workspaceKey('events:workspace:'),
'events:global',
'events',
]).slice(0, 4);
worklogSuggestions = rowsFor(journalSettings, [
workspaceKey('suggestions:workspace:'),
workspaceKey('worklog:workspace:'),
'suggestions',
'worklog',
]).slice(0, 4);
}
loading = false;
}

View File

@ -148,7 +148,7 @@
role="tab"
aria-selected={toolKey(tool) === toolKey(activeTool)}
type="button"
title={tool.title}
title={tool.pluginId}
on:click={() => selectTool(tool)}
>
{tool.title || tool.id}