feat(web): ask before sending analytics, drop team screens, hide v1-absent memory features (P1.3a)

- Analytics are opt-in (decision Q7, ADR-0006). PostHog does not start or
  capture anything until the user clicks Allow in a first-run dialog that
  says what is sent. Escape or closing stores nothing and asks again. The
  existing Privacy & Telemetry toggle in Settings withdraws consent at once.
  Builds without VITE_POSTHOG_KEY show no dialog and send nothing.
- Remove the remaining upsell copy: the /team page with its per-seat price,
  Stripe and Teams wording in the erase-data dialog, Teams/Enterprise hints.
- Remove team screens (decision Q3): Waggle Dance, team presence in chat,
  team storage and sharing in workspace creation, storage and files.
- Hide memory features that are not in v1 (decision Q2) behind one map in
  lib/memory-features.ts: the knowledge graph, import history, wiki, agent
  memory hooks and Room launches. The map is the seam P1.5 fills from the
  memory store's capabilities.
- Say Windows, macOS and Linux instead of "Linux soon".
- Update the e2e specs for the removed and hidden screens.

Also logs UF-029: the Settings "Import Data" button has no handler.
This commit is contained in:
shumeiko.it
2026-10-23 14:51:29 +02:00
parent 0325c4eb11
commit f3eb6b6652
66 changed files with 934 additions and 1126 deletions

View File

@@ -26,7 +26,6 @@ const APP_SHORTCUTS: Record<string, AppId> = {
'6': 'events',
'7': 'settings',
'8': 'capabilities',
'9': 'waggle-dance',
};
/** Shortcuts that work even when an input/textarea is focused */

View File

@@ -4,7 +4,8 @@ import type { KGNode, KGEdge } from '@/lib/types';
export type KGScope = 'current' | 'personal' | 'all';
export const useKnowledgeGraph = (workspaceId: string | null) => {
/** `enabled: false` skips the fetch while the graph is hidden (memory feature map). */
export const useKnowledgeGraph = (workspaceId: string | null, enabled = true) => {
const [nodes, setNodes] = useState<KGNode[]>([]);
const [edges, setEdges] = useState<KGEdge[]>([]);
const [loading, setLoading] = useState(false);
@@ -32,7 +33,7 @@ export const useKnowledgeGraph = (workspaceId: string | null) => {
} finally { setLoading(false); }
}, [workspaceId, scope]);
useEffect(() => { fetchKG(); }, [fetchKG]);
useEffect(() => { if (enabled) fetchKG(); }, [fetchKG, enabled]);
return { nodes, edges, loading, error, selectedNode, setSelectedNode, scope, setScope, refresh: fetchKG };
};

View File

@@ -1,59 +0,0 @@
import { useState, useEffect, useCallback } from 'react';
import { adapter } from '@/lib/adapter';
import type { WaggleSignal } from '@/lib/types';
export const useWaggleDance = () => {
const [signals, setSignals] = useState<WaggleSignal[]>([]);
const [loading, setLoading] = useState(true);
const [filter, setFilter] = useState<WaggleSignal['type'] | 'all'>('all');
const [error, setError] = useState<string | null>(null);
const refresh = useCallback(async () => {
setLoading(true);
try {
const data = await adapter.getWaggleSignals();
setSignals(data);
setError(null);
} catch (err) {
console.error('[useWaggleDance] refresh failed:', err);
setSignals([]);
setError(err instanceof Error ? err.message : 'Failed to load');
} finally {
setLoading(false);
}
}, []);
useEffect(() => {
refresh();
let unsub: (() => void) | undefined;
try {
unsub = adapter.subscribeWaggleDance?.((signal) => {
setSignals(prev => [signal, ...prev]);
}) || undefined;
} catch (err) {
console.error('[useWaggleDance] SSE subscribe failed:', err);
}
return () => { try { unsub?.(); } catch (err) { console.error('[useWaggleDance] cleanup failed:', err); } };
}, [refresh]);
const publishSignal = useCallback(async (data: Omit<WaggleSignal, 'id' | 'timestamp'>) => {
try {
const signal = await adapter.publishWaggleSignal(data);
setSignals(prev => [signal, ...prev]);
return signal;
} catch (e) {
throw e;
}
}, []);
const acknowledge = useCallback(async (id: string) => {
try {
await adapter.acknowledgeWaggleSignal(id);
setSignals(prev => prev.map(s => s.id === id ? { ...s, acknowledged: true } : s));
} catch (err) { console.error('[useWaggleDance] acknowledge failed:', err); }
}, []);
const filtered = filter === 'all' ? signals : signals.filter(s => s.type === filter);
return { signals: filtered, allSignals: signals, loading, error, filter, setFilter, refresh, publishSignal, acknowledge };
};