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:
@@ -15,7 +15,7 @@
|
||||
import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import { AnimatePresence } from 'framer-motion';
|
||||
import { Navigate, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { Home, MessageSquare, Brain, ListTodo, Library, Network, Plug, Shield } from 'lucide-react';
|
||||
import { Home, MessageSquare, Brain, ListTodo, Library, Plug, Shield } from 'lucide-react';
|
||||
import wallpaperDark from '@/assets/wallpaper.jpg';
|
||||
import wallpaperLight from '@/assets/wallpaper-light.jpg';
|
||||
import BootScreen from './BootScreen';
|
||||
@@ -28,6 +28,7 @@ import { stashDeepLink } from '@/lib/app-deeplink';
|
||||
import { writeLoginBriefingDismissed, writeLoginBriefingLastDismissedAt, readLoginBriefingDismissed, readSkipBriefingParam } from '@/lib/login-briefing';
|
||||
import { prefetchBriefing, computeAwayDays, BRIEFING_ABSENCE_DAYS } from '@/lib/briefing-source';
|
||||
import { homeCacheExists } from '@/lib/home-cache';
|
||||
import { shouldAskAnalyticsConsent } from '@/lib/analytics-consent';
|
||||
import { resolveReturningUserOnboarding, isOnboardingStatusKnownSync } from '@/hooks/useOnboarding';
|
||||
import { shouldShowCoachMarks, readOnboardedThisSession, readForceTour, clearForceTour } from '@/lib/coach-marks-gate';
|
||||
import { matchNavRoute, queryString, routeFor, routeForSearchResult } from '@/lib/routes';
|
||||
@@ -37,7 +38,6 @@ import { buildCommandCatalog, type CatalogCommand } from '@/lib/command-catalog'
|
||||
import { ShellProvider, useShell } from '@/providers/ShellContext';
|
||||
import { seedChat, useChatWidgetState } from '@/hooks/useChatWidgetState';
|
||||
import { useKeyboardShortcuts } from '@/hooks/useKeyboardShortcuts';
|
||||
import { useWaggleDance } from '@/hooks/useWaggleDance';
|
||||
import { useBumpSessionCount } from '@/hooks/useDockLabels';
|
||||
import { useDockNudge } from '@/hooks/useDockNudge';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
@@ -56,6 +56,7 @@ const OnboardingWizard = lazy(() => import('./overlays/OnboardingWizard'));
|
||||
const OnboardingTooltips = lazy(() => import('./overlays/OnboardingTooltips'));
|
||||
const LoginBriefing = lazy(() => import('./overlays/LoginBriefing'));
|
||||
const ContextRail = lazy(() => import('./overlays/ContextRail'));
|
||||
const AnalyticsConsentDialog = lazy(() => import('./overlays/AnalyticsConsentDialog'));
|
||||
|
||||
const deferredShellElement = (element: ReactNode) => (
|
||||
<Suspense fallback={null}>{element}</Suspense>
|
||||
@@ -129,12 +130,10 @@ const ShellLayout = () => {
|
||||
contextRailTarget, setContextRailTarget,
|
||||
} = useShell();
|
||||
|
||||
const { allSignals: waggleSignals } = useWaggleDance();
|
||||
const overlaysRef = useRef(ov);
|
||||
useEffect(() => {
|
||||
overlaysRef.current = ov;
|
||||
}, [ov]);
|
||||
const waggleUnacknowledged = waggleSignals.filter(s => !s.acknowledged).length;
|
||||
// W2A: no implicit workspaces[0] fallback — the chrome shows a workspace only
|
||||
// when one was explicitly selected. Sidebar/StatusBar accept null names; the
|
||||
// Chat spine item opens the WorkspaceSwitcher when there is no real selection.
|
||||
@@ -189,6 +188,9 @@ const ShellLayout = () => {
|
||||
const { entry: activeChatEntry, setPersona: setActiveChatPersona } =
|
||||
useChatWidgetState(effectiveActiveWorkspaceId ?? 'local-default');
|
||||
|
||||
// ADR-0006: ask about analytics once per launch until the user chooses.
|
||||
const [askAnalyticsConsent, setAskAnalyticsConsent] = useState(shouldAskAnalyticsConsent);
|
||||
|
||||
// User display name for the sidebar user row (PR1 LOW #2). Best-effort via the
|
||||
// existing identity surface; re-fetched on connect-settle because the first
|
||||
// call can race the session-token attach and 401 → name:null. Falls back to
|
||||
@@ -372,9 +374,7 @@ const ShellLayout = () => {
|
||||
const briefingAwayDays = useMemo(() => computeAwayDays(workspaces), [workspaces]);
|
||||
|
||||
// Five-place spine + a power-tier "Pinned" group. Chat resolves to the active
|
||||
// workspace's chat tab (routeFor falls back to /home with no workspace). The
|
||||
// Agents & tasks badge surfaces unacknowledged coordination signals for now;
|
||||
// PR3 refines it to the real pending-approvals/tasks count.
|
||||
// workspace's chat tab (routeFor falls back to /home with no workspace).
|
||||
const isPro = currentTier === 'power' || currentTier === 'admin';
|
||||
const spine: SidebarNavItem[] = useMemo(() => [
|
||||
{ key: 'home', label: 'Home', icon: Home, to: '/home', match: ['/home'] },
|
||||
@@ -392,13 +392,12 @@ const ShellLayout = () => {
|
||||
onClick: navigateToActiveChat,
|
||||
},
|
||||
{ key: 'memory', label: 'Memory', icon: Brain, to: '/memory', match: ['/memory'] },
|
||||
{ key: 'agents', label: 'Agents', icon: ListTodo, to: '/agents', match: ['/agents', '/automations'], badge: waggleUnacknowledged || undefined },
|
||||
{ key: 'agents', label: 'Agents', icon: ListTodo, to: '/agents', match: ['/agents', '/automations'] },
|
||||
{ key: 'library', label: 'Library', icon: Library, to: '/artifacts', match: ['/artifacts', '/files', '/skills'] },
|
||||
], [effectiveActiveWorkspaceId, navigateToActiveChat, waggleUnacknowledged]);
|
||||
], [effectiveActiveWorkspaceId, navigateToActiveChat]);
|
||||
const pinned: SidebarNavItem[] = useMemo(() => {
|
||||
if (!isPro) return [];
|
||||
return [
|
||||
{ key: 'swarm', label: 'Agent swarm', icon: Network, to: '/waggle-dance', match: ['/waggle-dance'] },
|
||||
{ key: 'connectors', label: 'Connectors', icon: Plug, to: '/connectors', match: ['/connectors'] },
|
||||
{ key: 'approvals', label: 'Approvals', icon: Shield, to: '/approvals', match: ['/approvals'] },
|
||||
];
|
||||
@@ -417,11 +416,21 @@ const ShellLayout = () => {
|
||||
}
|
||||
}, [navigate, ov]);
|
||||
|
||||
// ADR-0006: the analytics question (only when the build has a PostHog key and
|
||||
// the user has not chosen yet). On first launch it comes BEFORE the wizard
|
||||
// mounts: the wizard maps a window-level Escape to Skip, so the two must not
|
||||
// be open together, and asking first lets the one PostHog event
|
||||
// (onboarding_complete) be sent if the user allows it.
|
||||
const analyticsConsentDialog = askAnalyticsConsent && deferredShellElement(
|
||||
<AnalyticsConsentDialog onClose={() => setAskAnalyticsConsent(false)} />
|
||||
);
|
||||
|
||||
// FR #33: when the onboarding wizard is active, render ONLY the wizard —
|
||||
// no nav, no canvas, no overlays (§1.2 OnboardingWizard row: full-screen
|
||||
// takeover at the layout level, any URL). Hooks above keep running so
|
||||
// completion re-renders with workspaces/personas already populated.
|
||||
if (!onboardingState.completed) {
|
||||
if (analyticsConsentDialog) return analyticsConsentDialog;
|
||||
return deferredShellElement(
|
||||
<OnboardingWizard
|
||||
serverBaseUrl={adapter.getServerUrl()}
|
||||
@@ -439,7 +448,7 @@ const ShellLayout = () => {
|
||||
const anyModalOpen =
|
||||
ov.showGlobalSearch || ov.showCreateWorkspace || ov.showPersonaSwitcher ||
|
||||
ov.showWorkspaceSwitcher || ov.showNotifications || ov.showKeyboardHelp ||
|
||||
ov.showSpawnAgent;
|
||||
ov.showSpawnAgent || askAnalyticsConsent;
|
||||
|
||||
return (
|
||||
<div className="relative w-screen h-screen overflow-hidden select-none">
|
||||
@@ -574,7 +583,7 @@ const ShellLayout = () => {
|
||||
Lane H item 4: additionally require a ≥7-day absence — otherwise the home
|
||||
hero's recall strip is the catch-up, and this modal stays closed. */}
|
||||
{onboardingState.completed && onboardingState.tooltipsDismissed && ov.showLoginBriefing
|
||||
&& briefingLanding === 'armed' && location.pathname.startsWith('/home') && !offline
|
||||
&& !askAnalyticsConsent && briefingLanding === 'armed' && location.pathname.startsWith('/home') && !offline
|
||||
&& briefingAwayDays >= BRIEFING_ABSENCE_DAYS && (
|
||||
deferredShellElement(
|
||||
<LoginBriefing
|
||||
@@ -593,6 +602,7 @@ const ShellLayout = () => {
|
||||
{contextRailTarget && deferredShellElement(
|
||||
<ContextRail target={contextRailTarget} onClose={() => setContextRailTarget(null)} />
|
||||
)}
|
||||
{analyticsConsentDialog}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ describe('routeGroupKey — keys on the top segment only', () => {
|
||||
describe('routeAnnouncement — the polite-live-region label', () => {
|
||||
it('labels known surfaces', () => {
|
||||
expect(routeAnnouncement('/memory')).toBe('Memory');
|
||||
expect(routeAnnouncement('/waggle-dance')).toBe('Agent swarm');
|
||||
expect(routeAnnouncement('/approvals')).toBe('Approvals');
|
||||
expect(routeAnnouncement('/workspaces/abc/chat')).toBe('Workspaces');
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useCallback, useMemo } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Bot, Plus, Search, AlertCircle, RefreshCw, LibraryBig, ChevronRight, Network, ArrowRight } from 'lucide-react';
|
||||
import { Bot, Plus, Search, AlertCircle, RefreshCw, LibraryBig, ChevronRight } from 'lucide-react';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import BeeLoader from '@/components/ui/BeeLoader';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
@@ -291,36 +291,6 @@ const AgentsApp = ({ workspaces, activeWorkspaceId }: AgentsAppProps) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Promoted swarm CTA (PR6b §16 / D19) — the waggle-dance entry,
|
||||
surfaced as a prominent honey banner instead of a buried link.
|
||||
Navigates to the existing /waggle-dance route. */}
|
||||
<div className="px-4 pt-2.5">
|
||||
<button
|
||||
onClick={() => navigate('/waggle-dance')}
|
||||
className="group w-full flex items-center gap-3 rounded-xl border px-3.5 py-2.5 text-left transition-colors"
|
||||
style={{ background: 'var(--honey-wash)', borderColor: 'var(--honey-line)' }}
|
||||
>
|
||||
<span
|
||||
className="grid place-items-center w-8 h-8 rounded-lg shrink-0"
|
||||
style={{ background: 'var(--honey)', color: '#1a1407' }}
|
||||
>
|
||||
<Network className="w-4 h-4" />
|
||||
</span>
|
||||
<span className="flex-1 min-w-0">
|
||||
<span className="block text-xs font-display font-semibold text-foreground">Run a team of agents</span>
|
||||
<span className="block text-[11px] text-muted-foreground truncate">
|
||||
waggle-dance · let several specialists coordinate on one goal
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
className="inline-flex items-center gap-1 text-[11px] font-display font-semibold shrink-0"
|
||||
style={{ color: 'var(--honey-text)' }}
|
||||
>
|
||||
Start a swarm <ArrowRight className="w-3.5 h-3.5 group-hover:translate-x-0.5 transition-transform" />
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* List */}
|
||||
<div id="agent-center-tab-panel" className="flex-1 overflow-auto p-2.5" role="tabpanel" aria-labelledby={`agent-center-tab-${tab}`}>
|
||||
{/* A post-action reload failure must be visible even when a stale
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Pins the contract:
|
||||
* - renders a grid card per workspace (name + real stats)
|
||||
* - the search box filters by name
|
||||
* - the storage-type pills filter (All / Virtual / Local / Team)
|
||||
* - the storage-type pills filter (All / Virtual / Local)
|
||||
* - a zero-workspace visit shows the create-first empty state (D16)
|
||||
* - NO-FABRICATION: a workspace with undefined memoryCount renders NO memory
|
||||
* chip (W2B: not even a filler "—"), never an invented number (PR3/PR3.5)
|
||||
|
||||
@@ -80,7 +80,6 @@ const STORAGE_FILTERS: { id: StorageFilter; label: string; dot?: string }[] = [
|
||||
{ id: 'all', label: 'All' },
|
||||
{ id: 'virtual', label: 'Virtual', dot: 'var(--intel)' },
|
||||
{ id: 'local', label: 'Local', dot: 'var(--honey)' },
|
||||
{ id: 'team', label: 'Team', dot: 'var(--healthy)' },
|
||||
];
|
||||
|
||||
/** Storage badge: Local=honey, Virtual=intel, Team=healthy (design §04). */
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
* 2. Grants — persistent "always allow" decisions. Revoke individually
|
||||
* or clear the whole list.
|
||||
*
|
||||
* This is the trust control surface for enterprise buyers. Every decision
|
||||
* the user has made about agent autonomy lives here, visible and
|
||||
* reversible.
|
||||
* This is the trust control surface: every decision the user has made
|
||||
* about agent autonomy lives here, visible and reversible.
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
|
||||
@@ -41,7 +41,7 @@ const CAPABILITY_MATRIX: ReadonlyArray<{ capability: string; marks: readonly Mar
|
||||
{ capability: 'Self-evolving skills', marks: ['Y', 'N', 'N', 'N', 'P', 'N'] },
|
||||
{ capability: 'Skills shared across agents/workspaces', marks: ['Y', 'P', 'P', 'N', 'P', 'N'] },
|
||||
{ capability: 'Multi-agent swarm', marks: ['Y', 'P', 'N', 'P', 'P', 'Y'] },
|
||||
{ capability: 'Native desktop app · Win + Mac', marks: ['Y', 'N', 'N', 'P', 'N', 'N'] },
|
||||
{ capability: 'Native desktop app · Windows, macOS, Linux', marks: ['Y', 'N', 'N', 'P', 'N', 'N'] },
|
||||
{ capability: 'Audit-ready / EU AI Act', marks: ['Y', 'P', 'P', 'P', 'N', 'N'] },
|
||||
{ capability: 'Deep coding in the terminal', marks: ['P', 'Y', 'Y', 'P', 'P', 'Y'] },
|
||||
];
|
||||
|
||||
@@ -26,13 +26,6 @@ import {
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { DUR } from '@/lib/motion/tokens';
|
||||
|
||||
export interface TeamMember {
|
||||
id: string;
|
||||
name: string;
|
||||
status: string;
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
type AutonomyLevel = 'normal' | 'trusted' | 'yolo';
|
||||
|
||||
interface ChatAppProps {
|
||||
@@ -49,7 +42,6 @@ interface ChatAppProps {
|
||||
currentModel?: string;
|
||||
onModelChange?: (model: string) => void;
|
||||
availableModels?: string[];
|
||||
teamPresence?: TeamMember[];
|
||||
sessions?: { id: string; title: string; messageCount?: number; lastActive?: string }[];
|
||||
activeSessionId?: string | null;
|
||||
onSelectSession?: (id: string) => void;
|
||||
@@ -557,7 +549,6 @@ const ChatApp = ({
|
||||
messages, isLoading, onSendMessage, onClearHistory,
|
||||
pendingApproval, onApprove, currentPersona,
|
||||
onPersonaChange, currentModel, onModelChange, availableModels,
|
||||
teamPresence,
|
||||
sessions, activeSessionId, onSelectSession, onNewSession,
|
||||
workspaceId, templateId, storageType,
|
||||
autonomyLevel = 'normal', autonomyExpiresAt = null, onAutonomyChange,
|
||||
@@ -612,19 +603,12 @@ const ChatApp = ({
|
||||
const modelPickerRef = useRef<HTMLDivElement>(null);
|
||||
// M-21 / UX-6: observe the agent strip (round-6 fix 1: relocated from the
|
||||
// deleted header row to the composer) to decide whether the informational
|
||||
// chips (storage badge, team presence) should fold into a ⋯ overflow menu.
|
||||
// chips (storage badge) should fold into a ⋯ overflow menu.
|
||||
const stripRef = useRef<HTMLDivElement>(null);
|
||||
const overflowRef = useRef<HTMLDivElement>(null);
|
||||
const stripWidth = useContainerWidth(stripRef);
|
||||
const isStripCompact = shouldCollapseChatHeader(stripWidth);
|
||||
|
||||
// R9 Lane D: presence is meaningful only for OTHER people in the room. The
|
||||
// team endpoint returns the current user as `{ id: 'local', name: 'You' }`
|
||||
// in solo/offline mode, which rendered as an anonymous floating 'Y' avatar on
|
||||
// the composer strip. Drop the self entry so a lone user sees no presence chip
|
||||
// and real teammates still surface.
|
||||
const roomPresence = (teamPresence ?? []).filter(m => m.id !== 'local' && m.name !== 'You');
|
||||
|
||||
// M-28 / ENG-7: suggested next-actions extracted from the most
|
||||
// recent assistant message. Empty array → no chips. Hidden while
|
||||
// the assistant is still streaming to avoid flickering chips as
|
||||
@@ -1573,7 +1557,7 @@ const ChatApp = ({
|
||||
</span>
|
||||
</HintTooltip>
|
||||
|
||||
{/* M-21 / UX-6: storage + team presence render inline at full
|
||||
{/* M-21 / UX-6: the storage badge renders inline at full
|
||||
width, or behind a ⋯ overflow menu when the strip is too
|
||||
narrow. Interactive controls (persona, autonomy, model)
|
||||
stay always visible. */}
|
||||
@@ -1590,37 +1574,9 @@ const ChatApp = ({
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/* Team presence — round-7 fix 2b: the bare avatar chip was
|
||||
unlabeled (a floating 'Y'), so the whole cluster is now one
|
||||
strip pill with a native title naming who's here. */}
|
||||
{!isStripCompact && roomPresence.length > 0 && (
|
||||
<div
|
||||
className={`${STRIP_PILL} px-1.5 text-muted-foreground`}
|
||||
data-testid="chat-header-team-presence"
|
||||
title={roomPresence.length === 1
|
||||
? `${roomPresence[0].name} — active in this chat`
|
||||
: `Active in this chat: ${roomPresence.map(m => m.name).join(', ')}`}
|
||||
>
|
||||
<div className="flex -space-x-1.5">
|
||||
{roomPresence.slice(0, 4).map(m => (
|
||||
<div key={m.id} className="relative">
|
||||
<Avatar className="w-4 h-4 border border-card">
|
||||
{m.avatar ? <AvatarImage src={m.avatar} /> : null}
|
||||
<AvatarFallback className="text-[9px] bg-sky-500/20 text-sky-400">{m.name[0]}</AvatarFallback>
|
||||
</Avatar>
|
||||
<div className={`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full border border-card ${m.status === 'online' ? 'bg-emerald-400' : 'bg-muted-foreground'}`} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
{roomPresence.length > 4 && (
|
||||
<span>+{roomPresence.length - 4}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ⋯ overflow menu — only rendered in compact mode and only
|
||||
when there's at least one informational chip to show. */}
|
||||
{isStripCompact && (storageType || roomPresence.length > 0) && (
|
||||
{isStripCompact && storageType && (
|
||||
<div className="relative" ref={overflowRef}>
|
||||
<button
|
||||
onClick={() => setShowHeaderOverflow(p => !p)}
|
||||
@@ -1650,23 +1606,6 @@ const ChatApp = ({
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{roomPresence.length > 0 && (
|
||||
<div className="px-1" data-testid="chat-header-team-presence">
|
||||
<p className="text-[11px] font-display text-muted-foreground mb-1">In this room</p>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{roomPresence.map(m => (
|
||||
<div key={m.id} className="flex items-center gap-1.5 text-[11px] text-foreground">
|
||||
<Avatar className="w-4 h-4 border border-card">
|
||||
{m.avatar ? <AvatarImage src={m.avatar} /> : null}
|
||||
<AvatarFallback className="text-[10px] bg-sky-500/20 text-sky-400">{m.name[0]}</AvatarFallback>
|
||||
</Avatar>
|
||||
<span className="truncate max-w-[8ch]">{m.name}</span>
|
||||
<span className={`w-1.5 h-1.5 rounded-full shrink-0 ${m.status === 'online' ? 'bg-emerald-400' : 'bg-muted-foreground'}`} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -1674,7 +1613,7 @@ const ChatApp = ({
|
||||
|
||||
<div className="ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1.5">
|
||||
{/* Round-7 fix 2a: subtle divider between the context cluster
|
||||
(sessions · persona · Memory · presence) and the control
|
||||
(sessions · persona · Memory) and the control
|
||||
cluster (autonomy · model · profile). */}
|
||||
<span aria-hidden className="h-4 border-l border-[var(--line-soft)]" />
|
||||
{/* Phase B.5: autonomy toggle — only render when the parent wired a handler */}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useToast } from '@/hooks/use-toast';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
import { formatModelLabel } from '@/lib/model-label';
|
||||
import ChatApp from './ChatApp';
|
||||
import type { TeamMember } from './ChatApp';
|
||||
|
||||
type AutonomyLevel = 'normal' | 'trusted' | 'yolo';
|
||||
|
||||
@@ -104,7 +103,6 @@ const ChatWindowInstance = ({
|
||||
});
|
||||
|
||||
const [availableModels, setAvailableModels] = useState<string[]>([]);
|
||||
const [teamPresence, setTeamPresence] = useState<TeamMember[]>([]);
|
||||
|
||||
const { toast } = useToast();
|
||||
|
||||
@@ -202,25 +200,11 @@ const ChatWindowInstance = ({
|
||||
if (!currentLanded) fetchCurrentModel();
|
||||
}, 2000);
|
||||
|
||||
// Fetch team members for presence display
|
||||
const fetchTeam = async () => {
|
||||
try {
|
||||
const members = await adapter.getTeamMembers();
|
||||
if (cancelled) return;
|
||||
setTeamPresence(members.filter(m => m.status === 'online'));
|
||||
} catch (err) {
|
||||
console.error('[ChatWindowInstance] fetch team failed:', err);
|
||||
if (!cancelled) setTeamPresence([]);
|
||||
}
|
||||
};
|
||||
fetchTeam();
|
||||
const teamInterval = setInterval(fetchTeam, 10000);
|
||||
const refreshModelsOnFocus = () => { void fetchModels(); };
|
||||
window.addEventListener('focus', refreshModelsOnFocus);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
window.removeEventListener('focus', refreshModelsOnFocus);
|
||||
clearInterval(teamInterval);
|
||||
clearInterval(retryInterval);
|
||||
};
|
||||
}, []);
|
||||
@@ -273,7 +257,6 @@ const ChatWindowInstance = ({
|
||||
currentModel={currentModel}
|
||||
onModelChange={handleModelChange}
|
||||
availableModels={availableModels}
|
||||
teamPresence={teamPresence}
|
||||
sessions={displaySessions}
|
||||
activeSessionId={activeSessionId}
|
||||
onSelectSession={setActiveSessionId}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* FilesAppTabs — P16 three-tab layout wrapper around FilesApp.
|
||||
* FilesAppTabs — P16 tab layout wrapper around FilesApp.
|
||||
*
|
||||
* Adds a "Virtual | Local | Team" tab strip above the existing FilesApp
|
||||
* Adds a "Virtual | Local" tab strip above the existing FilesApp
|
||||
* shell. Each tab remounts FilesApp with a different `storageType`; the
|
||||
* remount intentionally resets per-storage navigation state (currentPath,
|
||||
* selection, preview) so flipping back to Virtual doesn't carry a local
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
*
|
||||
* These tests assert the toggle wiring and that Variation B carries the
|
||||
* static explainer content WITHOUT fabricating a live recall.
|
||||
*
|
||||
* Agent hooks, the explainer and Waggle Room tasks are hidden in v1 by the
|
||||
* memory feature map (ADR-0002). Most suites switch them on to keep the hidden
|
||||
* code covered; the "v1 memory features" suite checks the default.
|
||||
*/
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { render, screen, waitFor, cleanup, fireEvent, within } from '@testing-library/react';
|
||||
@@ -24,6 +28,9 @@ const mocks = vi.hoisted(() => ({
|
||||
}));
|
||||
vi.mock('@/lib/adapter', () => ({ adapter: mocks.adapter, default: vi.fn() }));
|
||||
|
||||
const features = vi.hoisted(() => ({ enabled: true }));
|
||||
vi.mock('@/lib/memory-features', () => ({ hasMemoryFeature: () => features.enabled }));
|
||||
|
||||
import LauncherApp, { resetLauncherRouteCache } from './LauncherApp';
|
||||
|
||||
const detectionResp = {
|
||||
@@ -43,6 +50,7 @@ const detectionResp = {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
features.enabled = true;
|
||||
resetLauncherRouteCache();
|
||||
mocks.adapter.detectTools.mockResolvedValue(detectionResp);
|
||||
mocks.adapter.getToolProcesses.mockResolvedValue({ processes: [] });
|
||||
@@ -670,3 +678,36 @@ describe('LauncherApp · hook cohort (#3)', () => {
|
||||
expect(screen.queryByText(/hooks are not supported for Claude Desktop yet/i)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('LauncherApp · v1 memory features (ADR-0002)', () => {
|
||||
it('hides hook controls, the memory-sharing explainer and Room tasks; launch stays', async () => {
|
||||
features.enabled = false;
|
||||
mocks.adapter.detectTools.mockResolvedValue({
|
||||
platform: 'darwin',
|
||||
detectedAt: '2026-07-11T00:00:00.000Z',
|
||||
tools: [
|
||||
{
|
||||
id: 'codex',
|
||||
displayName: 'Codex CLI',
|
||||
installed: true,
|
||||
installedPath: '/usr/local/bin/codex',
|
||||
version: '0.144.1',
|
||||
hooksInstalled: true,
|
||||
hookPointerPath: '/home/.codex/hooks',
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true, structuredProgress: true, resumable: true },
|
||||
permissionModes: ['read-only', 'workspace-write', 'native'],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
render(<LauncherApp />);
|
||||
|
||||
expect(await screen.findByText('Codex CLI')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /^launch$/i })).toBeInTheDocument();
|
||||
expect(screen.queryByRole('tablist', { name: /launcher view/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByText(/hooks active/i)).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: /install hooks|uninstall hooks|^verify$/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByText(/launch only|hook management is not supported/i)).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: /run task/i })).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,6 +30,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
import { hasMemoryFeature } from '@/lib/memory-features';
|
||||
import { createSurfaceCache } from '@/lib/surface-cache';
|
||||
import {
|
||||
promptArgsForTool,
|
||||
@@ -291,6 +292,10 @@ const hookActionDetails = (
|
||||
|
||||
const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: LauncherAppProps = {}) => {
|
||||
const [view, setView] = useState<LauncherView>('a');
|
||||
// ADR-0002: agent memory hooks and Waggle Room are hidden in v1 (memory
|
||||
// feature map). Launch, watch and stop stay.
|
||||
const hooksShown = hasMemoryFeature('agentHooks');
|
||||
const roomShown = hasMemoryFeature('room');
|
||||
const cachedDetection = launcherRouteCache.read('tools');
|
||||
const [detection, setDetection] = useState<DetectionResult | null>(cachedDetection ?? null);
|
||||
const [loading, setLoading] = useState(() => !launcherRouteCache.hasResolved('tools'));
|
||||
@@ -596,6 +601,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
{hooksShown && (
|
||||
<div
|
||||
role="tablist"
|
||||
aria-label="Launcher view"
|
||||
@@ -617,6 +623,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{view === 'a' && (
|
||||
<Button type="button" variant="ghost" size="sm" onClick={refresh} aria-label="Refresh installed tools" className="h-7 w-7 p-0 ml-auto">
|
||||
<RefreshCw className={`w-3.5 h-3.5 ${loading ? 'animate-spin' : ''}`} />
|
||||
@@ -624,7 +631,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
)}
|
||||
</div>
|
||||
|
||||
{view === 'b' ? (
|
||||
{view === 'b' && hooksShown ? (
|
||||
<MemorySharingView />
|
||||
) : (
|
||||
<>
|
||||
@@ -746,8 +753,8 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
)}
|
||||
{tools.map((tool) => {
|
||||
const launchable = toolCanLaunch(tool);
|
||||
const hooksSupported = HOOKS_COHORT.includes(tool.id);
|
||||
const launchOnly = launchable && !hooksSupported;
|
||||
const hooksSupported = hooksShown && HOOKS_COHORT.includes(tool.id);
|
||||
const launchOnly = hooksShown && launchable && !hooksSupported;
|
||||
const isActive = activeAction?.toolId === tool.id;
|
||||
return (
|
||||
<div
|
||||
@@ -769,7 +776,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
Not installed
|
||||
</Badge>
|
||||
)}
|
||||
{tool.hooksInstalled && tool.releaseStatus !== 'roadmap' && (
|
||||
{hooksShown && tool.hooksInstalled && tool.releaseStatus !== 'roadmap' && (
|
||||
<Badge variant="secondary" className="text-[10px] px-1.5 py-0 h-4" style={{ background: 'var(--honey-wash)', color: 'var(--honey)' }}>
|
||||
Hooks active
|
||||
</Badge>
|
||||
@@ -834,7 +841,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
)}
|
||||
Launch
|
||||
</Button>
|
||||
{toolCanRunCapturedTask(tool) && (
|
||||
{roomShown && toolCanRunCapturedTask(tool) && (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="default"
|
||||
@@ -921,7 +928,7 @@ const LauncherApp = ({ activeWorkspaceId, workspaces = [], onOpenRoom }: Launche
|
||||
: 'Hook management is not supported for this tool yet.'}
|
||||
</div>
|
||||
)}
|
||||
{taskToolId === tool.id && toolCanRunCapturedTask(tool) && (
|
||||
{roomShown && taskToolId === tool.id && toolCanRunCapturedTask(tool) && (
|
||||
<div
|
||||
className="rounded-lg border border-primary/30 bg-primary/5 p-3 space-y-3"
|
||||
data-testid={`captured-task-${tool.id}`}
|
||||
|
||||
@@ -14,6 +14,7 @@ import MemoryCenterTab from './memory/MemoryCenterTab';
|
||||
import TimelineTab, { type TimelineTabProps } from './memory/TimelineTab';
|
||||
import ImportReminderBanner from './memory/ImportReminderBanner';
|
||||
import { useOnboarding } from '@/hooks/useOnboarding';
|
||||
import { hasMemoryFeature, isMemoryViewAvailable } from '@/lib/memory-features';
|
||||
|
||||
/**
|
||||
* Memory Center (P3/D2) — the standalone memory surface (ArtifactCenterApp
|
||||
@@ -86,16 +87,22 @@ export interface MemoryCenterAppProps {
|
||||
}
|
||||
|
||||
const MemoryCenterApp = ({
|
||||
mind, onMindChange, view, onViewChange, workspaceId, workspaceName,
|
||||
mind, onMindChange, view: requestedView, onViewChange, workspaceId, workspaceName,
|
||||
timeline, knowledgeGraph, onRefreshKG, kgScope, onKGScopeChange,
|
||||
kgLoading = false, kgError = null, onContextRail,
|
||||
}: MemoryCenterAppProps) => {
|
||||
// Reminder-banner eligibility (carried over from the retired MemoryApp shell).
|
||||
const { state: onboardingState } = useOnboarding();
|
||||
|
||||
// ADR-0002: views of hidden memory features (graph, imports, wiki) are not
|
||||
// offered; a hidden view requested anyway falls back to the default.
|
||||
const view: MemoryView = isMemoryViewAvailable(requestedView) ? requestedView : 'trust';
|
||||
const primaryTabs = PRIMARY_TABS.filter((t) => isMemoryViewAvailable(t.id));
|
||||
const advancedTabs = ADVANCED_TABS.filter((t) => isMemoryViewAvailable(t.id));
|
||||
|
||||
// Advanced flyout (display-level IA regroup): open state + active child.
|
||||
const [advancedOpen, setAdvancedOpen] = useState(false);
|
||||
const activeAdvanced = ADVANCED_TABS.find((t) => t.id === view);
|
||||
const activeAdvanced = advancedTabs.find((t) => t.id === view);
|
||||
|
||||
// Lane HM (Pillar 1.1): the memory tab panel morphs between views (the
|
||||
// Trust↔Memories pair especially) rather than hard-cutting — a keyed
|
||||
@@ -104,11 +111,13 @@ const MemoryCenterApp = ({
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full" data-testid="memory-center-app">
|
||||
<ImportReminderBanner
|
||||
onboardingCompleted={onboardingState.completed}
|
||||
totalFrameCount={timeline.stats.total}
|
||||
onOpenHarvest={() => onViewChange('harvest')}
|
||||
/>
|
||||
{hasMemoryFeature('importHistory') && (
|
||||
<ImportReminderBanner
|
||||
onboardingCompleted={onboardingState.completed}
|
||||
totalFrameCount={timeline.stats.total}
|
||||
onOpenHarvest={() => onViewChange('harvest')}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Tab bar + mind scope — Wave T Lane D (item 4): the memory surface stacked
|
||||
THREE control tiers (tabs · mind pills · the Trust Manage/Why switch).
|
||||
@@ -117,7 +126,7 @@ const MemoryCenterApp = ({
|
||||
not three. Every destination is preserved; only the chrome collapses. */}
|
||||
<div className="flex flex-wrap items-center gap-y-1 border-b border-border/50 bg-background/60">
|
||||
<div role="tablist" aria-label="Memory views" className="flex min-w-0 flex-wrap items-center">
|
||||
{PRIMARY_TABS.map((tab, i) => {
|
||||
{primaryTabs.map((tab, i) => {
|
||||
const Icon = tab.icon;
|
||||
const active = view === tab.id;
|
||||
return (
|
||||
@@ -146,10 +155,11 @@ const MemoryCenterApp = ({
|
||||
{/* Advanced — a flyout tab holding the maintenance/import views. The
|
||||
trigger names the active child (e.g. "Advanced: Imports") so a
|
||||
deep-linked ?tab=harvest never looks like no tab is selected. */}
|
||||
{advancedTabs.length > 0 && (
|
||||
<div className="flex items-center">
|
||||
<div className="w-px h-4 bg-border/60 mx-1" aria-hidden="true" />
|
||||
<div className="relative">
|
||||
<HintTooltip content="Imports, maintenance, and wiki">
|
||||
<HintTooltip content={advancedTabs.map((t) => t.label).join(', ')}>
|
||||
<button
|
||||
role="tab"
|
||||
onClick={() => setAdvancedOpen(o => !o)}
|
||||
@@ -178,7 +188,7 @@ const MemoryCenterApp = ({
|
||||
data-testid="memory-tab-advanced-menu"
|
||||
className="absolute left-0 top-full mt-1 z-50 w-56 bg-card border border-border rounded-xl shadow-xl overflow-hidden"
|
||||
>
|
||||
{ADVANCED_TABS.map((tab) => {
|
||||
{advancedTabs.map((tab) => {
|
||||
const Icon = tab.icon;
|
||||
const active = view === tab.id;
|
||||
return (
|
||||
@@ -204,6 +214,7 @@ const MemoryCenterApp = ({
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Mind pills — folded onto the tab row (Wave T Lane D item 4). Only on
|
||||
@@ -277,9 +288,9 @@ const MemoryCenterApp = ({
|
||||
<HarvestTab />
|
||||
) : view === 'weaver' ? (
|
||||
<WeaverPanel />
|
||||
) : (
|
||||
) : view === 'wiki' ? (
|
||||
<WikiTab />
|
||||
)}
|
||||
) : null}
|
||||
</motion.div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ const SPECS: ReadonlyArray<Spec> = [
|
||||
{ value: '~12 MB', label: 'Install size' },
|
||||
{ value: 'Local', label: 'Data on your disk' },
|
||||
{ value: 'Auto-update', label: 'Signed & notarized' },
|
||||
{ value: 'Win · Mac', label: 'Linux soon' },
|
||||
{ value: 'Win · Mac · Linux', label: 'Desktop platforms' },
|
||||
];
|
||||
|
||||
interface BootStep {
|
||||
@@ -67,7 +67,7 @@ const CHANNELS: ReadonlyArray<Channel> = [
|
||||
icon: Monitor,
|
||||
title: 'Desktop app',
|
||||
blurb: 'The full hive — native, local, fast.',
|
||||
platforms: ['macOS', 'Windows', 'Linux soon'],
|
||||
platforms: ['macOS', 'Windows', 'Linux'],
|
||||
status: 'now',
|
||||
statusLabel: 'Available now',
|
||||
tint: 'var(--honey-wash)',
|
||||
@@ -177,8 +177,8 @@ function DesktopView({ os, onOsChange }: DesktopViewProps) {
|
||||
title={<>A real <em className="not-italic text-honey">desktop app.</em></>}
|
||||
blurb={
|
||||
<>
|
||||
Waggle ships as a native app for <b className="text-[var(--text-2)]">Windows & macOS</b> — built on
|
||||
Tauri, so it’s tiny, fast, and truly local. Your hive lives on your disk; the app just opens a
|
||||
Waggle runs as a native app on <b className="text-[var(--text-2)]">Windows, macOS and Linux</b>. It is
|
||||
built on Tauri, so it’s tiny, fast, and truly local. Your hive lives on your disk; the app just opens a
|
||||
window onto it.
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import {
|
||||
resolveActiveSettingsTab,
|
||||
} from '@/lib/settings-tier-filter';
|
||||
import { requiresYoloConfirm } from '@/lib/autonomy-confirm';
|
||||
import { hasAnalyticsKey, isAnalyticsAllowed, setAnalyticsConsent } from '@/lib/analytics-consent';
|
||||
import { hasMemoryFeature } from '@/lib/memory-features';
|
||||
import ModelSelector from '@/components/os/ModelSelector';
|
||||
import ModelPilotCard from '@/components/os/ModelPilotCard';
|
||||
import EmbeddingRoutingCard from '@/components/os/EmbeddingRoutingCard';
|
||||
@@ -137,8 +139,11 @@ const SettingsApp = () => {
|
||||
// focus-visible, testable confirm row.
|
||||
const [pendingYolo, setPendingYolo] = useState(false);
|
||||
|
||||
// M2-7: Telemetry state
|
||||
const [telemetryEnabled, setTelemetryEnabled] = useState(false);
|
||||
// M2-7: Telemetry state. ADR-0006: when the build has a PostHog key, this one
|
||||
// toggle is also the analytics consent switch, so it shows the stored consent
|
||||
// and drives the local log and PostHog together.
|
||||
const analyticsKey = hasAnalyticsKey();
|
||||
const [telemetryEnabled, setTelemetryEnabled] = useState(() => analyticsKey && isAnalyticsAllowed());
|
||||
// Phase 4.1: GDPR Art. 17 erasure flow. Visible at all tiers — erasure
|
||||
// can't be tier-gated. Dialog handles the typed-phrase confirmation gate
|
||||
// + presents the receipt + relaunch instruction on success.
|
||||
@@ -183,10 +188,10 @@ const SettingsApp = () => {
|
||||
// .catch — a getTelemetryStatus rejection became an unhandled promise
|
||||
// rejection (its siblings above all swallow). Match the local pattern.
|
||||
adapter.getTelemetryStatus().then(s => {
|
||||
setTelemetryEnabled(s.enabled);
|
||||
if (!analyticsKey) setTelemetryEnabled(s.enabled);
|
||||
setTelemetryCount(s.totalEvents);
|
||||
}).catch(() => {});
|
||||
}, []);
|
||||
}, [analyticsKey]);
|
||||
|
||||
const handleSaveModel = async () => {
|
||||
setSaving(true);
|
||||
@@ -432,28 +437,41 @@ const SettingsApp = () => {
|
||||
|
||||
{/* M2-7: Privacy & Telemetry — Phase 4.1: hidden at Essential per ux-disclosure-levels.md
|
||||
§"Settings at Essential" (telemetry surfaced only at Standard+, where the user is
|
||||
already opting into more advanced surface area). */}
|
||||
{userTier !== 'simple' && (
|
||||
already opting into more advanced surface area). ADR-0006: shown at every level
|
||||
when the build has a PostHog key, so analytics consent can always be withdrawn. */}
|
||||
{(userTier !== 'simple' || analyticsKey) && (
|
||||
<div className="space-y-3">
|
||||
<h3 className="text-xs font-display font-semibold text-foreground flex items-center gap-2">
|
||||
<BarChart3 className="w-3.5 h-3.5 text-muted-foreground" />
|
||||
Privacy & Telemetry
|
||||
</h3>
|
||||
<p className="text-[11px] text-muted-foreground leading-relaxed">
|
||||
Help improve Waggle by tracking anonymous usage patterns. All data stays on your machine — nothing is sent to any server. No message content, file paths, or personal info is ever recorded.
|
||||
</p>
|
||||
{analyticsKey ? (
|
||||
<p className="text-[11px] text-muted-foreground leading-relaxed">
|
||||
Usage analytics are off unless you turn them on. When on, Waggle keeps a usage log on this computer and sends one event to PostHog when you finish onboarding, with the template, persona and model you chose. Your chats, files and memories are never sent.
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-[11px] text-muted-foreground leading-relaxed">
|
||||
Help improve Waggle by tracking anonymous usage patterns. All data stays on your machine — nothing is sent to any server. No message content, file paths, or personal info is ever recorded.
|
||||
</p>
|
||||
)}
|
||||
<div className="flex items-center justify-between p-3 rounded-xl bg-secondary/30 border border-border/30">
|
||||
<div>
|
||||
<p className="text-xs font-display font-medium text-foreground">Enable anonymous telemetry</p>
|
||||
<p className="text-xs font-display font-medium text-foreground">
|
||||
{analyticsKey ? 'Share anonymous usage analytics' : 'Enable anonymous telemetry'}
|
||||
</p>
|
||||
<p className="text-[11px] text-muted-foreground">{telemetryCount} events collected</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={telemetryEnabled ? 'Disable anonymous telemetry' : 'Enable anonymous telemetry'}
|
||||
aria-label={analyticsKey
|
||||
? (telemetryEnabled ? 'Disable anonymous usage analytics' : 'Enable anonymous usage analytics')
|
||||
: (telemetryEnabled ? 'Disable anonymous telemetry' : 'Enable anonymous telemetry')}
|
||||
aria-pressed={telemetryEnabled}
|
||||
onClick={async () => {
|
||||
const next = !telemetryEnabled;
|
||||
setTelemetryEnabled(next);
|
||||
// Store the consent first: capture stops before any await.
|
||||
if (analyticsKey) void setAnalyticsConsent(next ? 'granted' : 'denied');
|
||||
await adapter.toggleTelemetry(next);
|
||||
}}
|
||||
className={`relative w-10 h-5 rounded-full transition-colors ${telemetryEnabled ? 'bg-primary' : 'bg-muted'}`}
|
||||
@@ -498,7 +516,7 @@ const SettingsApp = () => {
|
||||
Danger Zone · Erase All Data
|
||||
</h3>
|
||||
<p className="text-[11px] text-muted-foreground leading-relaxed">
|
||||
Schedule a complete wipe of every memory frame, workspace, session, vault entry, and config file in your data dir. The wipe runs at next launch and is unrecoverable from the app — keep a recent <span className="font-mono">.waggle-backup</span> if you might want to restore. Data already sent to cloud providers or Teams servers is not erased — handle those separately per the data-handling policy.
|
||||
Schedule a complete wipe of every memory frame, workspace, session, vault entry, and config file in your data dir. The wipe runs at next launch and is unrecoverable from the app — keep a recent <span className="font-mono">.waggle-backup</span> if you might want to restore. Data already sent to cloud model providers is not erased. Ask those providers to delete it.
|
||||
</p>
|
||||
<button
|
||||
onClick={() => setShowEraseDialog(true)}
|
||||
@@ -769,6 +787,7 @@ const SettingsApp = () => {
|
||||
<p className="text-[11px] text-muted-foreground">Download all workspaces, sessions, and memory as a zip</p>
|
||||
</div>
|
||||
</button>
|
||||
{hasMemoryFeature('importHistory') && (
|
||||
<button className="flex items-center gap-2 w-full p-3 rounded-xl bg-secondary/30 border border-border/30 text-left hover:bg-secondary/50 transition-colors">
|
||||
<Upload className="w-4 h-4 text-honey" />
|
||||
<div>
|
||||
@@ -776,6 +795,7 @@ const SettingsApp = () => {
|
||||
<p className="text-[11px] text-muted-foreground">Import from ChatGPT or Claude export</p>
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Encrypted Backup/Restore */}
|
||||
<div className="pt-4 border-t border-border/30">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Source fidelity: docs/design_handoff_waggle_app/design-files/screens/storage.html (view-a)
|
||||
*/
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Cloud, HardDrive, Server, ShieldCheck, Folder, FileText, Loader2 } from 'lucide-react';
|
||||
import { Cloud, HardDrive, ShieldCheck, Folder, FileText, Loader2 } from 'lucide-react';
|
||||
import type { ElementType } from 'react';
|
||||
import type { FileEntry, StorageType, Workspace } from '@/lib/types';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
@@ -66,16 +66,6 @@ const STORAGE_TYPE_CARDS: readonly StorageTypeCard[] = [
|
||||
accent: 'var(--honey)',
|
||||
wash: 'var(--honey-wash)',
|
||||
},
|
||||
{
|
||||
type: 'team',
|
||||
icon: Server,
|
||||
title: 'Team',
|
||||
where: 'shared, synced',
|
||||
blurb: 'A shared memory + file space for a team — same workspace, role-based access, synced across seats.',
|
||||
privacy: 'Shared with team',
|
||||
accent: 'var(--healthy)',
|
||||
wash: 'var(--healthy-wash)',
|
||||
},
|
||||
];
|
||||
|
||||
const STORAGE_LIVE_LABEL: Record<StorageType, string> = {
|
||||
@@ -246,12 +236,12 @@ const StorageApp = ({ workspaceId, workspaceName, workspace }: StorageAppProps)
|
||||
)}
|
||||
</section>
|
||||
|
||||
{/* Three ways a workspace can live */}
|
||||
{/* Two ways a workspace can live */}
|
||||
<div className="font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground mt-[30px] mb-3.5 flex items-center gap-2.5">
|
||||
Three ways a workspace can live
|
||||
Two ways a workspace can live
|
||||
<span className="flex-1 h-px" style={{ background: 'var(--line-soft)' }} aria-hidden="true" />
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-3.5">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3.5">
|
||||
{STORAGE_TYPE_CARDS.map(card => {
|
||||
const active = card.type === storageType;
|
||||
const Icon = card.icon;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import { Shield, Lock, Users, Crown } from 'lucide-react';
|
||||
|
||||
const TeamGovernanceApp = () => {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-full text-center p-8">
|
||||
<div className="relative mb-4">
|
||||
<Shield className="w-12 h-12 text-muted-foreground/20" />
|
||||
<Lock className="w-5 h-5 text-honey absolute -bottom-1 -right-1" />
|
||||
</div>
|
||||
<h2 className="text-lg font-display font-semibold text-foreground mb-2">Team Governance</h2>
|
||||
<p className="text-sm text-muted-foreground max-w-xs mb-4">
|
||||
Fine-grained permissions, role-based access, and audit controls for your team.
|
||||
</p>
|
||||
<div className="space-y-2 text-left w-full max-w-xs">
|
||||
<div className="flex items-center gap-3 p-3 rounded-lg bg-muted/20 border border-border/30">
|
||||
<Users className="w-4 h-4 text-sky-400 shrink-0" />
|
||||
<div>
|
||||
<p className="text-xs font-display text-foreground">Role-Based Access</p>
|
||||
<p className="text-[11px] text-muted-foreground">Owner, Admin, Member, Viewer</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 p-3 rounded-lg bg-muted/20 border border-border/30">
|
||||
<Shield className="w-4 h-4 text-amber-400 shrink-0" />
|
||||
<div>
|
||||
<p className="text-xs font-display text-foreground">Tool Governance</p>
|
||||
<p className="text-[11px] text-muted-foreground">Per-role tool allow/deny lists</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 p-3 rounded-lg bg-muted/20 border border-border/30">
|
||||
<Crown className="w-4 h-4 text-violet-400 shrink-0" />
|
||||
<div>
|
||||
<p className="text-xs font-display text-foreground">Audit Trail</p>
|
||||
<p className="text-[11px] text-muted-foreground">Full action history per member</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6 px-4 py-2 rounded-xl bg-primary/10 border border-primary/30">
|
||||
<p className="text-xs font-display text-honey">Available on Teams ($49/mo per seat) and Enterprise tiers</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TeamGovernanceApp;
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
import { hasMemoryFeature } from '@/lib/memory-features';
|
||||
|
||||
interface IdentitySuggestion {
|
||||
field: 'name' | 'role' | 'company' | 'industry' | 'bio';
|
||||
@@ -272,7 +273,7 @@ const UserProfileApp = () => {
|
||||
so the user sees "here's what we learned" before seeing the
|
||||
blank inputs. Each row: label + value + confidence dot +
|
||||
accept / dismiss. Block auto-hides when all are handled. */}
|
||||
{suggestions.length > 0 && (
|
||||
{hasMemoryFeature('importHistory') && suggestions.length > 0 && (
|
||||
<div className="rounded-xl bg-accent/10 border border-accent/30 p-3 space-y-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Sparkles className="w-3.5 h-3.5 text-accent" />
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import { Zap, Eye, ArrowRightLeft, Lightbulb, AlertTriangle, Radio, RefreshCw, Check, Send } from 'lucide-react';
|
||||
import { useWaggleDance } from '@/hooks/useWaggleDance';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import type { WaggleSignal } from '@/lib/types';
|
||||
import { sortSignalsForDisplay } from '@/lib/waggle-signals';
|
||||
import { DATE_LOCALE } from '@/lib/date-locale';
|
||||
|
||||
type TypeConfigEntry = { icon: React.ElementType; color: string; label: string };
|
||||
|
||||
const typeConfig: Record<WaggleSignal['type'], TypeConfigEntry> = {
|
||||
discovery: { icon: Eye, color: 'text-amber-400', label: 'Discovery' },
|
||||
handoff: { icon: ArrowRightLeft, color: 'text-sky-400', label: 'Handoff' },
|
||||
insight: { icon: Lightbulb, color: 'text-emerald-400', label: 'Insight' },
|
||||
alert: { icon: AlertTriangle, color: 'text-rose-400', label: 'Alert' },
|
||||
coordination: { icon: Radio, color: 'text-violet-400', label: 'Coordination' },
|
||||
};
|
||||
|
||||
const FALLBACK_TYPE_CONFIG: TypeConfigEntry = {
|
||||
icon: Zap,
|
||||
color: 'text-muted-foreground',
|
||||
label: 'Activity',
|
||||
};
|
||||
|
||||
function getTypeConfig(type: string): TypeConfigEntry {
|
||||
const known = (typeConfig as Record<string, TypeConfigEntry>)[type];
|
||||
return known ?? { ...FALLBACK_TYPE_CONFIG, label: type };
|
||||
}
|
||||
|
||||
const filterTypes: (WaggleSignal['type'] | 'all')[] = ['all', 'discovery', 'handoff', 'insight', 'alert', 'coordination'];
|
||||
|
||||
const WaggleDanceApp = () => {
|
||||
const { signals, allSignals, loading, error, filter, setFilter, refresh, acknowledge } = useWaggleDance();
|
||||
const [selectedSignal, setSelectedSignal] = useState<WaggleSignal | null>(null);
|
||||
// M-41 / P18 — unacknowledged first, severity desc, then recency.
|
||||
const orderedSignals = useMemo(() => sortSignalsForDisplay(signals), [signals]);
|
||||
|
||||
const unacknowledgedCount = allSignals.filter(s => !s.acknowledged).length;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full bg-background text-foreground">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between px-3 py-2 border-b border-border/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<Zap className="w-4 h-4 text-amber-400" />
|
||||
<span className="text-sm font-display font-semibold">Waggle Dance</span>
|
||||
{unacknowledgedCount > 0 && (
|
||||
<Badge data-testid="waggle-unacknowledged-count" variant="destructive" className="text-[11px] px-1.5 py-0 h-4">
|
||||
{unacknowledgedCount}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={refresh}
|
||||
aria-label="Refresh Waggle Dance"
|
||||
className="h-7 w-7 p-0"
|
||||
>
|
||||
<RefreshCw className={`w-3.5 h-3.5 ${loading ? 'animate-spin' : ''}`} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Filter tabs */}
|
||||
<div className="flex gap-1 px-3 py-1.5 border-b border-border/30 overflow-x-auto">
|
||||
{filterTypes.map(t => {
|
||||
const cfg = t === 'all' ? null : typeConfig[t];
|
||||
const Icon = cfg?.icon;
|
||||
return (
|
||||
<button
|
||||
key={t}
|
||||
onClick={() => setFilter(t)}
|
||||
className={`flex items-center gap-1 px-2 py-1 rounded-md text-[11px] font-medium transition-colors whitespace-nowrap
|
||||
${filter === t ? 'bg-primary/20 text-honey' : 'text-muted-foreground hover:bg-muted/50'}`}
|
||||
>
|
||||
{Icon && <Icon className={`w-3 h-3 ${cfg!.color}`} />}
|
||||
{t === 'all' ? 'All' : cfg!.label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="flex flex-1 min-h-0">
|
||||
{/* Signal list */}
|
||||
<ScrollArea className={`${selectedSignal ? 'w-1/2 border-r border-border/30' : 'w-full'}`}>
|
||||
<div className="p-2 space-y-1">
|
||||
{loading && signals.length === 0 && (
|
||||
<div className="text-xs text-muted-foreground text-center py-8">Loading signals…</div>
|
||||
)}
|
||||
{/* P7/D15 B5: the hook already tracks `error` — a load failure must
|
||||
not masquerade as "no signals yet". */}
|
||||
{!loading && error && signals.length === 0 && (
|
||||
<div role="alert" className="flex flex-col items-center gap-2 py-8 text-muted-foreground">
|
||||
<Zap className="w-8 h-8 text-destructive/50" />
|
||||
<p className="text-xs text-foreground">Couldn't load signals</p>
|
||||
<p className="text-[11px] opacity-70 max-w-xs text-center">The Waggle Dance feed is unreachable — this is a load error, not an empty feed.</p>
|
||||
<button onClick={refresh} className="mt-1 text-[11px] px-3 py-1 rounded-lg bg-primary/10 text-honey hover:bg-primary/20 transition-colors">Retry</button>
|
||||
</div>
|
||||
)}
|
||||
{!loading && !error && signals.length === 0 && (
|
||||
<div className="flex flex-col items-center gap-2 py-8 text-muted-foreground">
|
||||
<Zap className="w-8 h-8 opacity-30" />
|
||||
<p className="text-xs">No waggle dance signals yet</p>
|
||||
<p className="text-[11px] opacity-70">Signals appear when agents share findings across workspaces</p>
|
||||
</div>
|
||||
)}
|
||||
{orderedSignals.map(signal => {
|
||||
const cfg = getTypeConfig(signal.type);
|
||||
const Icon = cfg.icon;
|
||||
const isSelected = selectedSignal?.id === signal.id;
|
||||
return (
|
||||
<button
|
||||
key={signal.id}
|
||||
onClick={() => setSelectedSignal(isSelected ? null : signal)}
|
||||
className={`w-full text-left p-2.5 rounded-lg transition-colors group
|
||||
${isSelected ? 'bg-primary/10 ring-1 ring-primary/30' : 'hover:bg-muted/50'}
|
||||
${!signal.acknowledged ? 'border-l-2 border-l-primary/60' : 'border-l-2 border-l-transparent'}`}
|
||||
>
|
||||
<div className="flex items-start gap-2">
|
||||
<Icon className={`w-4 h-4 mt-0.5 ${cfg.color} shrink-0`} />
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span className="text-xs font-semibold truncate">{signal.title}</span>
|
||||
{signal.priority === 'critical' && (
|
||||
<Badge data-testid="waggle-critical-priority" variant="destructive" className="text-[11px] px-1 py-0 h-3.5">CRITICAL</Badge>
|
||||
)}
|
||||
{signal.priority === 'high' && (
|
||||
<Badge className="text-[11px] px-1 py-0 h-3.5 bg-amber-500/20 text-foreground border-amber-500/40">HIGH</Badge>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-[11px] text-muted-foreground line-clamp-2 mt-0.5">{signal.content}</p>
|
||||
<div className="flex items-center gap-2 mt-1">
|
||||
<span className="text-[11px] text-muted-foreground/70">
|
||||
{signal.sourceWorkspaceName || signal.sourceWorkspaceId}
|
||||
</span>
|
||||
{signal.sourceUser && (
|
||||
<span className="text-[11px] text-muted-foreground/70">· {signal.sourceUser}</span>
|
||||
)}
|
||||
<span className="ml-auto text-[11px] text-muted-foreground">
|
||||
{new Date(signal.timestamp).toLocaleTimeString(DATE_LOCALE, { hour: '2-digit', minute: '2-digit' })}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
{/* Detail pane */}
|
||||
{selectedSignal && (
|
||||
<div className="w-1/2 flex flex-col">
|
||||
<div className="p-3 flex-1 overflow-auto">
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
{(() => {
|
||||
const cfg = getTypeConfig(selectedSignal.type);
|
||||
const Icon = cfg.icon;
|
||||
return <Icon className={`w-5 h-5 ${cfg.color}`} />;
|
||||
})()}
|
||||
<Badge variant="outline" className="text-[11px]">{getTypeConfig(selectedSignal.type).label}</Badge>
|
||||
{selectedSignal.priority && selectedSignal.priority !== 'normal' && selectedSignal.priority !== 'low' && (
|
||||
<Badge variant={selectedSignal.priority === 'critical' ? 'destructive' : 'outline'} className="text-[11px]">
|
||||
{selectedSignal.priority.toUpperCase()}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<h3 className="text-sm font-semibold mb-1">{selectedSignal.title}</h3>
|
||||
<p className="text-xs text-muted-foreground mb-3">{selectedSignal.content}</p>
|
||||
|
||||
<div className="space-y-1.5 text-[11px] text-muted-foreground">
|
||||
<div><span className="text-foreground/70">Source:</span> {selectedSignal.sourceWorkspaceName || selectedSignal.sourceWorkspaceId}</div>
|
||||
{selectedSignal.sourceUser && <div><span className="text-foreground/70">User:</span> {selectedSignal.sourceUser}</div>}
|
||||
{selectedSignal.sourceAgentId && <div><span className="text-foreground/70">Agent:</span> {selectedSignal.sourceAgentId}</div>}
|
||||
{selectedSignal.targetWorkspaceId && <div><span className="text-foreground/70">Target:</span> {selectedSignal.targetWorkspaceId}</div>}
|
||||
<div><span className="text-foreground/70">Time:</span> {new Date(selectedSignal.timestamp).toLocaleString(DATE_LOCALE)}</div>
|
||||
</div>
|
||||
|
||||
{selectedSignal.metadata && Object.keys(selectedSignal.metadata).length > 0 && (
|
||||
<div className="mt-3">
|
||||
<p className="text-[11px] uppercase tracking-wider text-[var(--text-tertiary)] mb-1">Metadata</p>
|
||||
<pre className="text-[11px] bg-muted/30 rounded p-2 overflow-auto max-h-32">
|
||||
{JSON.stringify(selectedSignal.metadata, null, 2)}
|
||||
</pre>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-2 border-t border-border/30 flex gap-2">
|
||||
{!selectedSignal.acknowledged && (
|
||||
<Button size="sm" variant="outline" className="text-xs h-7" onClick={() => acknowledge(selectedSignal.id)}>
|
||||
<Check className="w-3 h-3 mr-1" /> Acknowledge
|
||||
</Button>
|
||||
)}
|
||||
<Button size="sm" variant="ghost" className="text-xs h-7 ml-auto" onClick={() => setSelectedSignal(null)}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default WaggleDanceApp;
|
||||
@@ -19,7 +19,7 @@ import type { AgentType, AutonomyLevel, ConnectorDefinition, Scope } from '@wagg
|
||||
* before Create. Elevated selections (connectors / MCP servers) route
|
||||
* through the ApprovalModal before the create fires (§17.3).
|
||||
*
|
||||
* Create is FREE-tier (no gate — agents generate memory, CLAUDE.md §1).
|
||||
* Create has no gate: agents generate memory.
|
||||
* v1 deliberate omissions (rendered honestly, not silently):
|
||||
* - no per-tool grants — tools derive from persona + skills (the create
|
||||
* contract carries no tools field);
|
||||
|
||||
@@ -2,8 +2,8 @@ import { describe, it, expect } from 'vitest';
|
||||
import { initialTabFor, FILES_TAB_ORDER } from './files-tabs';
|
||||
|
||||
describe('FILES_TAB_ORDER', () => {
|
||||
it('is virtual → local → team in that order', () => {
|
||||
expect(FILES_TAB_ORDER).toEqual(['virtual', 'local', 'team']);
|
||||
it('is virtual → local in that order (no Team tab, ADR-0003)', () => {
|
||||
expect(FILES_TAB_ORDER).toEqual(['virtual', 'local']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,10 @@ describe('initialTabFor', () => {
|
||||
it("returns the workspace's configured storageType when it's one of the known tabs", () => {
|
||||
expect(initialTabFor('virtual')).toBe('virtual');
|
||||
expect(initialTabFor('local')).toBe('local');
|
||||
expect(initialTabFor('team')).toBe('team');
|
||||
});
|
||||
|
||||
it("opens a legacy team workspace on 'virtual'", () => {
|
||||
expect(initialTabFor('team')).toBe('virtual');
|
||||
});
|
||||
|
||||
it("falls back to 'virtual' when storageType is undefined", () => {
|
||||
|
||||
@@ -10,16 +10,15 @@ import type { StorageType } from '@/lib/types';
|
||||
* through. See FilesAppTabs.tsx for the key-based remount.
|
||||
*/
|
||||
|
||||
export const FILES_TAB_ORDER: StorageType[] = ['virtual', 'local', 'team'];
|
||||
export const FILES_TAB_ORDER: StorageType[] = ['virtual', 'local'];
|
||||
|
||||
/**
|
||||
* Pick the initial tab for the Files app when it opens. Preference order:
|
||||
* 1. The workspace's configured storageType (if set)
|
||||
* 2. 'virtual' — always available, safe default
|
||||
*
|
||||
* 'team' would be valid in the config but we never default to it on open
|
||||
* because a team workspace without a connected team server has nothing to
|
||||
* show; the tab strip lets the user switch manually.
|
||||
* A legacy 'team' workspace opens on 'virtual': team storage needs a team
|
||||
* server, and team mode is not part of the community edition (ADR-0003).
|
||||
*/
|
||||
export function initialTabFor(
|
||||
configured: StorageType | undefined,
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* AnalyticsConsentDialog — the first-run analytics question (ADR-0006).
|
||||
*
|
||||
* AppShell mounts it only when the build carries a PostHog key and the user
|
||||
* has not chosen yet (`shouldAskAnalyticsConsent`). "Allow" and "Don't allow"
|
||||
* store the choice. Escape closes the dialog without storing anything: nothing
|
||||
* is sent, and the question comes back on the next launch.
|
||||
*
|
||||
* The list of what is sent mirrors the events in `@/lib/posthog`.
|
||||
*/
|
||||
|
||||
import { BarChart3 } from 'lucide-react';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
import { setAnalyticsConsent, type AnalyticsConsent } from '@/lib/analytics-consent';
|
||||
import { useFocusTrap } from '@/hooks/useFocusTrap';
|
||||
|
||||
interface AnalyticsConsentDialogProps {
|
||||
/** Called after a choice is made or the dialog is dismissed. */
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const buttonClass =
|
||||
'px-4 py-2 rounded-xl border border-border/50 bg-secondary/40 text-sm font-display font-semibold text-foreground hover:bg-secondary/70 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60';
|
||||
|
||||
export default function AnalyticsConsentDialog({ onClose }: AnalyticsConsentDialogProps) {
|
||||
const dialogRef = useFocusTrap<HTMLDivElement>(true, onClose);
|
||||
|
||||
const choose = (choice: AnalyticsConsent) => {
|
||||
void setAnalyticsConsent(choice);
|
||||
// The Settings toggle drives the local usage log and PostHog together;
|
||||
// keep the local log in step with this first answer.
|
||||
void adapter.toggleTelemetry(choice === 'granted').catch(() => {});
|
||||
onClose();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[220] flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/60 backdrop-blur-sm" aria-hidden="true" />
|
||||
<div
|
||||
ref={dialogRef}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="analytics-consent-title"
|
||||
aria-describedby="analytics-consent-description"
|
||||
tabIndex={-1}
|
||||
className="relative w-full max-w-md glass-strong rounded-2xl shadow-2xl p-6 space-y-4 focus:outline-none"
|
||||
data-testid="analytics-consent-dialog"
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="p-2 rounded-xl bg-primary/10">
|
||||
<BarChart3 className="w-5 h-5 text-honey" aria-hidden="true" />
|
||||
</div>
|
||||
<h2 id="analytics-consent-title" className="text-lg font-display font-bold text-foreground">
|
||||
Share anonymous usage analytics?
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="analytics-consent-description" className="space-y-2 text-xs text-muted-foreground leading-relaxed">
|
||||
<p>
|
||||
Waggle can send a small amount of usage data to PostHog to help improve the app.
|
||||
Nothing is sent unless you choose Allow.
|
||||
</p>
|
||||
<p className="text-foreground font-medium">What is sent:</p>
|
||||
<ul className="list-disc pl-4 space-y-1">
|
||||
<li>One event when you finish onboarding, with the template, persona and model you chose.</li>
|
||||
<li>A random ID for this install and the browser details PostHog adds, such as browser, operating system and screen size.</li>
|
||||
</ul>
|
||||
<p>Your chats, files and memories are never sent.</p>
|
||||
<p>You can change this later in Settings, under Privacy & Telemetry.</p>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-end gap-3 pt-1">
|
||||
<button type="button" onClick={() => choose('denied')} className={buttonClass}>
|
||||
Don't allow
|
||||
</button>
|
||||
<button type="button" onClick={() => choose('granted')} className={buttonClass}>
|
||||
Allow
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useCallback, useEffect, useRef } from 'react';
|
||||
import {
|
||||
X, Plus, Users, Cloud, HardDrive, Server, FolderOpen, Folder,
|
||||
X, Plus, Users, Cloud, HardDrive, FolderOpen, Folder,
|
||||
FolderPlus, ChevronRight, Home, Check, Loader2, LayoutTemplate,
|
||||
Sparkles, Info, Wand2, Target, Microscope, Code, Megaphone,
|
||||
Rocket, Scale, Building, FileText, Laptop, PenLine, BarChart3,
|
||||
@@ -43,7 +43,7 @@ interface CreateWorkspaceDialogProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
onCreate: (data: {
|
||||
name: string; group: string; persona?: string; agentGroupId?: string; shared?: boolean;
|
||||
name: string; group: string; persona?: string; agentGroupId?: string;
|
||||
storageType?: StorageType; storagePath?: string; templateId?: string;
|
||||
}) => void;
|
||||
}
|
||||
@@ -54,7 +54,6 @@ const GROUPS = [...STANDARD_GROUPS];
|
||||
const STORAGE_OPTIONS: { type: StorageType; label: string; desc: string; icon: React.ElementType; color: string }[] = [
|
||||
{ type: 'virtual', label: 'Virtual', desc: 'Server-managed storage', icon: Cloud, color: 'text-violet-400' },
|
||||
{ type: 'local', label: 'Local', desc: 'Local disk directory', icon: HardDrive, color: 'text-emerald-400' },
|
||||
{ type: 'team', label: 'Team', desc: 'Remote S3/MinIO storage', icon: Server, color: 'text-sky-400' },
|
||||
];
|
||||
|
||||
/** Icon map for known template IDs */
|
||||
@@ -730,7 +729,6 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
const [name, setName] = useState('');
|
||||
const [group, setGroup] = useState('Personal');
|
||||
const [selectedPersona, setSelectedPersona] = useState<string | undefined>();
|
||||
const [shared, setShared] = useState(false);
|
||||
const [storageType, setStorageType] = useState<StorageType>('virtual');
|
||||
const [storagePath, setStoragePath] = useState('');
|
||||
const [showFolderPicker, setShowFolderPicker] = useState(false);
|
||||
@@ -801,11 +799,10 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
name: name.trim(), group,
|
||||
persona: agentMode === 'single' ? selectedPersona : undefined,
|
||||
agentGroupId: agentMode === 'group' ? selectedGroupId : undefined,
|
||||
shared,
|
||||
storageType, storagePath: storagePath.trim() || undefined,
|
||||
templateId: selectedTemplate || undefined,
|
||||
});
|
||||
setName(''); setGroup('Personal'); setSelectedPersona(undefined); setShared(false);
|
||||
setName(''); setGroup('Personal'); setSelectedPersona(undefined);
|
||||
setStorageType('virtual'); setStoragePath(''); setSelectedTemplate(null);
|
||||
setShowTemplateOptions(false); setTemplateSearch(''); setCategoryFilter('all'); setShowAgentOptions(false);
|
||||
setAgentMode('single'); setSelectedGroupId(undefined);
|
||||
@@ -1105,7 +1102,7 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
{/* ── Storage Type ── */}
|
||||
<div>
|
||||
<label className="text-xs text-muted-foreground block mb-1.5">Storage Type</label>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{STORAGE_OPTIONS.map(opt => (
|
||||
<button key={opt.type} onClick={() => setStorageType(opt.type)}
|
||||
className={`flex flex-col items-center gap-1 p-3 rounded-xl transition-colors ${
|
||||
@@ -1156,7 +1153,6 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
<p className="text-[11px] text-muted-foreground/60 mt-1">
|
||||
{storageType === 'virtual' && 'Managed automatically — files stored in server-managed storage.'}
|
||||
{storageType === 'local' && 'Select or type the local directory where workspace files will be stored.'}
|
||||
{storageType === 'team' && 'Browse or type the S3/MinIO bucket and prefix for shared storage.'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1267,22 +1263,6 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
</div>}
|
||||
</div>
|
||||
|
||||
{/* Share toggle */}
|
||||
<div className="flex items-center justify-between mx-6 mb-3 p-3 rounded-xl bg-secondary/30 border border-border/30">
|
||||
<div className="flex items-center gap-2">
|
||||
<Users className="w-4 h-4 text-sky-400" />
|
||||
<div>
|
||||
<p className="text-xs font-display text-foreground">Share with team</p>
|
||||
<p className="text-[11px] text-muted-foreground">Make visible to all team members</p>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onClick={() => setShared(!shared)}
|
||||
aria-label={shared ? 'Stop sharing workspace with team' : 'Share workspace with team'}
|
||||
className={`w-10 h-5 rounded-full transition-colors ${shared ? 'bg-sky-500' : 'bg-muted'}`}>
|
||||
<div className={`w-4 h-4 rounded-full bg-foreground transition-transform mx-0.5 ${shared ? 'translate-x-5' : ''}`} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-2 px-6 py-4 border-t border-border/30">
|
||||
<button type="button" onClick={onClose} className="px-4 py-2 text-xs font-display rounded-lg text-muted-foreground hover:text-foreground transition-colors">Cancel</button>
|
||||
<button type="button" onClick={handleCreate} disabled={!name.trim() || (storageType === 'local' && !storagePath.trim())} aria-label="Create workspace"
|
||||
|
||||
@@ -184,7 +184,7 @@ export default function EraseDataDialog({ open, onClose }: EraseDataDialogProps)
|
||||
file. The wipe is <span className="text-foreground font-medium">not reversible</span> from the app — you'll need a previously-saved <span className="font-mono">.waggle-backup</span> file to restore.
|
||||
</p>
|
||||
<p>
|
||||
Data already sent to cloud providers (Anthropic, OpenAI, Stripe, etc.) and Teams servers is <span className="text-foreground font-medium">not</span> erased by this action — see the data-handling policy for how to handle those separately.
|
||||
Data already sent to cloud model providers (Anthropic, OpenAI and others) is <span className="text-foreground font-medium">not</span> erased by this action. Ask those providers to delete it.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ const shortcuts = [
|
||||
{ keys: ['Ctrl', 'Shift', '6'], action: 'Events' },
|
||||
{ keys: ['Ctrl', 'Shift', '7'], action: 'Settings' },
|
||||
{ keys: ['Ctrl', 'Shift', '8'], action: 'Skills' },
|
||||
{ keys: ['Ctrl', 'Shift', '9'], action: 'Agent Swarm' },
|
||||
]},
|
||||
{ category: 'Quick Actions', items: [
|
||||
{ keys: ['Ctrl', 'K'], action: 'Global Search' },
|
||||
|
||||
@@ -346,16 +346,14 @@ const LoginBriefing = ({ onDismiss, onOpenWorkspace }: LoginBriefingProps) => {
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm font-display font-medium text-foreground">{ws.name}</span>
|
||||
{/* FR #27: tooltip clarifies what the Personal/Team
|
||||
tag means. Personal workspaces are private to the
|
||||
account; Team workspaces are
|
||||
shared. Without this hint the colored chip reads
|
||||
{/* FR #27: tooltip clarifies what the group tag
|
||||
means. Without this hint the colored chip reads
|
||||
as decorative metadata. */}
|
||||
<HintTooltip
|
||||
content={
|
||||
ws.group === 'Personal'
|
||||
? 'Personal workspaces are visible only to you.'
|
||||
: 'Team workspaces (Teams/Enterprise) are shared across the organisation.'
|
||||
: `${ws.group} is a group for sorting your workspaces.`
|
||||
}
|
||||
>
|
||||
<span className="text-[11px] px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground cursor-help">{ws.group}</span>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { motion, AnimatePresence, MotionConfig, useReducedMotion } from 'framer-
|
||||
import beeMascot from '@/assets/personas/general-purpose.png';
|
||||
import { adapter } from '@/lib/adapter';
|
||||
import { captureOnboardingComplete } from '@/lib/posthog';
|
||||
import { hasMemoryFeature } from '@/lib/memory-features';
|
||||
import { useOfflineStatus } from '@/hooks/useOfflineStatus';
|
||||
import type { OnboardingState } from '@/hooks/useOnboarding';
|
||||
import type { UserProfile, ClassifiedHarvestItem } from '@/lib/types';
|
||||
@@ -49,6 +50,17 @@ const LAST_INDEX = STEP_NAMES.length - 1;
|
||||
const FIRST_NAV_INDEX = stepIndex('who-are-you');
|
||||
const LAST_NAV_INDEX = stepIndex('first-task');
|
||||
|
||||
/** ADR-0002: history import is hidden in v1 (memory feature map), so its step
|
||||
* is skipped. It keeps its index, so a persisted `state.step` still resolves. */
|
||||
const isStepShown = (name: StepName): boolean =>
|
||||
name !== 'memory-import' || hasMemoryFeature('importHistory');
|
||||
/** Nearest shown step from `from`, walking forward (1) or back (-1). */
|
||||
const shownStepFrom = (from: number, dir: 1 | -1): number => {
|
||||
let i = from;
|
||||
while (i > 0 && i < LAST_INDEX && !isStepShown(STEP_NAMES[i])) i += dir;
|
||||
return i;
|
||||
};
|
||||
|
||||
const DEFAULT_FIRST_MESSAGE = 'Hello! What can you help me with?';
|
||||
|
||||
/* ─── Main Component (shell) ─── */
|
||||
@@ -57,7 +69,7 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
// `state.step` (5-7) that no longer maps to the re-keyed 5-step chain. Clamp
|
||||
// into [0, LAST_INDEX] so resume always lands on a renderable step rather
|
||||
// than a blank screen. `?forceWizard=true` already resets step to 0.
|
||||
const [step, setStep] = useState(() => Math.min(Math.max(state.step, 0), LAST_INDEX));
|
||||
const [step, setStep] = useState(() => shownStepFrom(Math.min(Math.max(state.step, 0), LAST_INDEX), 1));
|
||||
const autoTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
||||
const offline = useOfflineStatus();
|
||||
const reduceMotion = useReducedMotion();
|
||||
@@ -191,8 +203,9 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
finally { setImporting(false); }
|
||||
};
|
||||
|
||||
/* ── Claude Code auto-detect on mount ── */
|
||||
/* ── Claude Code auto-detect on mount (only when the import step is shown) ── */
|
||||
useEffect(() => {
|
||||
if (!isStepShown('memory-import')) return;
|
||||
let cancelled = false;
|
||||
(async () => {
|
||||
try {
|
||||
@@ -277,10 +290,15 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
const progressPct = LAST_INDEX > 0 ? (step / LAST_INDEX) * 100 : 0;
|
||||
// Nav chrome (Back + "Step N of M" + dots) spans who-are-you → first-task, so
|
||||
// each interactive step has a distinct counter/dot fill (template = 4 of 5,
|
||||
// first-task = 5 of 5) instead of two identical "Step 4 of 4" screens.
|
||||
// first-task = 5 of 5) instead of two identical "Step 4 of 4" screens. A
|
||||
// hidden step (isStepShown) gets no dot and no number.
|
||||
const showNavChrome = step >= FIRST_NAV_INDEX;
|
||||
const navTotal = LAST_NAV_INDEX - FIRST_NAV_INDEX + 1;
|
||||
const navCurrent = step - FIRST_NAV_INDEX + 1;
|
||||
const navSteps = STEP_NAMES
|
||||
.map((name, index) => ({ name, index }))
|
||||
.filter(({ name, index }) => index >= FIRST_NAV_INDEX && index <= LAST_NAV_INDEX && isStepShown(name))
|
||||
.map(({ index }) => index);
|
||||
const navTotal = navSteps.length;
|
||||
const navCurrent = navSteps.indexOf(step) + 1;
|
||||
const recommendedId = recommendTemplateId(profile.workType, profile.role);
|
||||
|
||||
return (
|
||||
@@ -358,7 +376,7 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
<button
|
||||
onClick={() => {
|
||||
clearTimeout(autoTimer.current);
|
||||
goToStep(step - 1);
|
||||
goToStep(shownStepFrom(step - 1, -1));
|
||||
}}
|
||||
className="text-xs text-muted-foreground hover:text-foreground transition-colors font-display px-3 py-2 rounded-md focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
||||
aria-label="Go to previous step"
|
||||
@@ -373,8 +391,7 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
)}
|
||||
{showNavChrome && (
|
||||
<div className="flex gap-1.5" aria-hidden="true">
|
||||
{STEP_NAMES.slice(FIRST_NAV_INDEX, LAST_NAV_INDEX + 1).map((_, idx) => {
|
||||
const navStep = FIRST_NAV_INDEX + idx;
|
||||
{navSteps.map((navStep) => {
|
||||
return (
|
||||
<div
|
||||
key={navStep}
|
||||
@@ -418,7 +435,7 @@ const OnboardingWizard = ({ serverBaseUrl, state, onUpdate, onComplete, onDismis
|
||||
)}
|
||||
{step === stepIndex('model-gate') && (
|
||||
<ModelGateStep
|
||||
onContinue={() => goToName('memory-import')}
|
||||
onContinue={() => goToName(isStepShown('memory-import') ? 'memory-import' : 'template')}
|
||||
onLater={() => {
|
||||
clearTimeout(autoTimer.current);
|
||||
trackTelemetry(serverBaseUrl, 'onboarding_skip', { atStep: step, via: 'model-gate-later' });
|
||||
|
||||
Reference in New Issue
Block a user