Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat([issue-716]): workflow-teaching empty states on early-user pages

[._.]/ Adam Eivy4ca8044af567
diff --git a/client/src/components/EmptyState.jsx b/client/src/components/EmptyState.jsx
new file mode 100644
index 0000000000..e444ad8a5e
--- /dev/null
+++ b/client/src/components/EmptyState.jsx
@@ -0,0 +1,54 @@
+import { Link } from 'react-router-dom';
+import { Info } from 'lucide-react';
+
+/**
+ * Workflow-teaching empty state.
+ *
+ * A "no data" state should not just say "Nothing here" — it should name the
+ * next action that unlocks the feature, e.g. "Configure one API provider to
+ * enable autonomous CoS" or "Connect calendar to unlock schedule-aware goals".
+ *
+ * Props:
+ * icon — Lucide component for the centered glyph (default: Info)
+ * title — optional bold heading (the "what's missing")
+ * message — the teaching hint that names the next action
+ * actionTo — internal route for the call-to-action Link
+ * actionLabel — text for the call-to-action
+ * onAction — render a <button> instead of a Link (in-page action)
+ *
+ * Back-compat: the original `{ message, linkTo, linkLabel }` API still works —
+ * `actionTo`/`actionLabel` are preferred, `linkTo`/`linkLabel` are aliases.
+ */
+export default function EmptyState({
+ icon: Icon = Info,
+ title,
+ message,
+ actionTo,
+ actionLabel,
+ onAction,
+ linkTo,
+ linkLabel,
+}) {
+ const to = actionTo ?? linkTo;
+ const label = actionLabel ?? linkLabel;
+ const actionClass =
+ 'mt-4 px-4 py-2 rounded-lg text-sm font-medium bg-port-accent/10 text-port-accent hover:bg-port-accent/20 transition-colors';
+
+ return (
+ <div className="flex flex-col items-center justify-center py-16 text-center">
+ {Icon && <Icon size={32} className="text-gray-600 mb-3" />}
+ {title && <h3 className="text-white font-semibold mb-1">{title}</h3>}
+ {message && <p className="text-gray-400 text-sm max-w-xs">{message}</p>}
+ {label && onAction && (
+ <button type="button" onClick={onAction} className={actionClass}>
+ {label}
+ </button>
+ )}
+ {label && !onAction && to && (
+ <Link to={to} className={actionClass}>
+ {label}
+ </Link>
+ )}
+ </div>
+ );
+}
diff --git a/client/src/components/EmptyState.test.jsx b/client/src/components/EmptyState.test.jsx
new file mode 100644
index 0000000000..ee8fd4b005
--- /dev/null
+++ b/client/src/components/EmptyState.test.jsx
@@ -0,0 +1,48 @@
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, fireEvent } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+import EmptyState from './EmptyState';
+
+const renderWithRouter = (ui) => render(<MemoryRouter>{ui}</MemoryRouter>);
+
+describe('EmptyState', () => {
+ it('renders the title and teaching message', () => {
+ renderWithRouter(
+ <EmptyState title="No providers configured" message="Configure one provider to enable CoS." />
+ );
+ expect(screen.getByText('No providers configured')).toBeTruthy();
+ expect(screen.getByText('Configure one provider to enable CoS.')).toBeTruthy();
+ });
+
+ it('renders a route Link when actionTo + actionLabel are provided', () => {
+ renderWithRouter(
+ <EmptyState message="msg" actionTo="/calendar/config" actionLabel="Connect Calendar" />
+ );
+ const link = screen.getByText('Connect Calendar').closest('a');
+ expect(link.getAttribute('href')).toBe('/calendar/config');
+ });
+
+ it('renders a button and fires onAction instead of a Link', () => {
+ const onAction = vi.fn();
+ renderWithRouter(
+ <EmptyState message="msg" actionLabel="Add Provider" onAction={onAction} actionTo="/ignored" />
+ );
+ const btn = screen.getByText('Add Provider');
+ expect(btn.tagName).toBe('BUTTON');
+ expect(screen.queryByText('Add Provider').closest('a')).toBeNull();
+ fireEvent.click(btn);
+ expect(onAction).toHaveBeenCalledTimes(1);
+ });
+
+ it('supports the legacy { linkTo, linkLabel } API', () => {
+ renderWithRouter(<EmptyState message="msg" linkTo="/meatspace/genome" linkLabel="Upload Genome" />);
+ const link = screen.getByText('Upload Genome').closest('a');
+ expect(link.getAttribute('href')).toBe('/meatspace/genome');
+ });
+
+ it('renders no action element when only a label is given', () => {
+ const { container } = renderWithRouter(<EmptyState message="msg" actionLabel="Nowhere" />);
+ expect(container.querySelector('a')).toBeNull();
+ expect(container.querySelector('button')).toBeNull();
+ });
+});
diff --git a/client/src/components/brain/tabs/NotesTab.jsx b/client/src/components/brain/tabs/NotesTab.jsx
index ff4e89d091..b3815ae518 100644
--- a/client/src/components/brain/tabs/NotesTab.jsx
+++ b/client/src/components/brain/tabs/NotesTab.jsx
@@ -391,8 +391,8 @@ export default function NotesTab({ onRefresh }) {
<BrailleSpinner /> Scanning vault...
</div>
) : displayNotes.length === 0 ? (
- <div className="flex items-center justify-center h-32 text-gray-500 text-sm">
- {searchResults ? 'No matches found' : 'No notes yet'}
+ <div className="flex items-center justify-center h-32 px-4 text-center text-gray-500 text-sm">
+ {searchResults ? 'No matches found' : 'No notes yet — capture notes in your vault to enrich Ask Yourself and your digital twin.'}
</div>
) : (
<div className="divide-y divide-port-border/50">
diff --git a/client/src/components/goals/GoalsListView.jsx b/client/src/components/goals/GoalsListView.jsx
index fbca62d1be..e8a8b7968c 100644
--- a/client/src/components/goals/GoalsListView.jsx
+++ b/client/src/components/goals/GoalsListView.jsx
@@ -7,6 +7,7 @@ import { DndContext, DragOverlay, PointerSensor, useSensor, useSensors, useDragg
import * as api from '../../services/api';
import GoalDetailPanel, { CATEGORY_CONFIG, HORIZON_OPTIONS, GOAL_TYPE_CONFIG, DEFAULT_NEW_GOAL } from './GoalDetailPanel';
import { applyOrganizationSuggestion } from './applyOrganization';
+import EmptyState from '../EmptyState';
import useProviderModels from '../../hooks/useProviderModels';
import ProviderModelSelector from '../ProviderModelSelector';
import { enabledApiProviderFilter } from '../../utils/providers';
@@ -445,9 +446,19 @@ export default function GoalsListView({ data, onRefresh }) {
<div className="flex-1 overflow-y-auto">
<RootDropZone />
{filteredRoots.length === 0 ? (
- <div className="flex items-center justify-center h-full text-gray-500 text-sm">
- {searchQuery ? 'No matching goals found.' : 'No goals yet. Add a root goal to get started.'}
- </div>
+ searchQuery ? (
+ <div className="flex items-center justify-center h-full text-gray-500 text-sm">
+ No matching goals found.
+ </div>
+ ) : (
+ <EmptyState
+ icon={Crown}
+ title="No goals yet"
+ message="Add a root goal above to get started — or connect your calendar to unlock schedule-aware goals."
+ actionTo="/calendar/config"
+ actionLabel="Connect Calendar"
+ />
+ )
) : (
filteredRoots.map(root => (
<GoalRow
diff --git a/client/src/components/insights/EmptyState.jsx b/client/src/components/insights/EmptyState.jsx
deleted file mode 100644
index 916bbbe607..0000000000
--- a/client/src/components/insights/EmptyState.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Link } from 'react-router-dom';
-import { Info } from 'lucide-react';
-
-export default function EmptyState({ message, linkTo, linkLabel }) {
- return (
- <div className="flex flex-col items-center justify-center py-16 text-center">
- <Info size={32} className="text-gray-600 mb-3" />
- <p className="text-gray-400 text-sm max-w-xs">{message}</p>
- {linkTo && linkLabel && (
- <Link
- to={linkTo}
- className="mt-4 px-4 py-2 rounded-lg text-sm font-medium bg-port-accent/10 text-port-accent hover:bg-port-accent/20 transition-colors"
- >
- {linkLabel}
- </Link>
- )}
- </div>
- );
-}
diff --git a/client/src/components/insights/GenomeHealthTab.jsx b/client/src/components/insights/GenomeHealthTab.jsx
index cf24263c38..2323f1a3f0 100644
--- a/client/src/components/insights/GenomeHealthTab.jsx
+++ b/client/src/components/insights/GenomeHealthTab.jsx
@@ -5,7 +5,7 @@ import { getGenomeHealthCorrelations } from '../../services/api';
import InsightCard from './InsightCard';
import ConfidenceBadge from './ConfidenceBadge';
import ProvenancePanel from './ProvenancePanel';
-import EmptyState from './EmptyState';
+import EmptyState from '../EmptyState';
// Map string icon names from server to Lucide components
const ICON_MAP = {
@@ -220,9 +220,9 @@ export default function GenomeHealthTab() {
if (!data?.available) {
return (
<EmptyState
- message="No genome data uploaded yet. Upload your 23andMe or similar raw genome file to see health correlations."
- linkTo="/meatspace/genome"
- linkLabel="Upload Genome"
+ message="Add your birth date and upload a raw genome file (23andMe or similar) to unlock longevity estimates and health correlations."
+ actionTo="/meatspace/genome"
+ actionLabel="Upload Genome"
/>
);
}
diff --git a/client/src/components/insights/TasteIdentityTab.jsx b/client/src/components/insights/TasteIdentityTab.jsx
index 52681766a8..e3f6e66614 100644
--- a/client/src/components/insights/TasteIdentityTab.jsx
+++ b/client/src/components/insights/TasteIdentityTab.jsx
@@ -3,7 +3,7 @@ import { RefreshCw, ChevronDown, ChevronRight } from 'lucide-react';
import { getInsightThemes, refreshInsightThemes } from '../../services/api';
import InsightCard from './InsightCard';
import ConfidenceBadge from './ConfidenceBadge';
-import EmptyState from './EmptyState';
+import EmptyState from '../EmptyState';
import { timeAgo } from '../../utils/formatters';
// Map theme strength to confidence level
diff --git a/client/src/pages/AIProviders.jsx b/client/src/pages/AIProviders.jsx
index c88638721e..3629cfdbed 100644
--- a/client/src/pages/AIProviders.jsx
+++ b/client/src/pages/AIProviders.jsx
@@ -3,6 +3,7 @@ import toast from '../components/ui/Toast';
import * as api from '../services/api';
import socket from '../services/socket';
import { filterSelectableModels, providerTypeClass, isTuiProvider, isApiProvider, isProcessProvider, isClaudeCodePlanCli } from '../utils/providers';
+import EmptyState from '../components/EmptyState';
import {
formatDurationMs,
parseTimeoutMs,
@@ -549,9 +550,12 @@ export default function AIProviders() {
))}
{providers.length === 0 && (
- <div className="text-center py-12 text-gray-500">
- No providers configured. Add a provider to get started.
- </div>
+ <EmptyState
+ title="No providers configured"
+ message="Configure at least one API provider to enable autonomous CoS, voice, and AI-assisted features across PortOS."
+ actionLabel="Add Provider"
+ onAction={() => { setEditingProvider(null); setShowForm(true); }}
+ />
)}
</div>
diff --git a/client/src/pages/Apps.jsx b/client/src/pages/Apps.jsx
index c9c187232f..062e0d900d 100644
--- a/client/src/pages/Apps.jsx
+++ b/client/src/pages/Apps.jsx
@@ -182,7 +182,7 @@ export default function Apps() {
{showArchived ? 'No archived apps' : 'No apps registered'}
</h3>
<p className="text-gray-500 mb-6">
- {showArchived ? 'Archived apps will appear here' : 'Add your first app to get started'}
+ {showArchived ? 'Archived apps will appear here' : 'Register your first app to monitor its health, restart it, and surface it on your dashboard.'}
</p>
{!showArchived && (
<Link