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

give the five zero-account calendar views a path to Add Account (#7282)

[._.]/ Adam Eivy7f083cb551c7
diff --git a/client/src/components/calendar/AgendaTab.jsx b/client/src/components/calendar/AgendaTab.jsx
index f0fc8cf669..536e0ca84d 100644
--- a/client/src/components/calendar/AgendaTab.jsx
+++ b/client/src/components/calendar/AgendaTab.jsx
@@ -210,7 +210,7 @@ export default function AgendaTab({ accounts }) {
icon={Clock}
title="No calendar connected"
message="Connect a calendar account to see upcoming events."
- actionTo="/calendar/sync"
+ actionTo="/calendar/config"
actionLabel="Connect a calendar"
/>
) : (
diff --git a/client/src/components/calendar/AgendaTab.test.jsx b/client/src/components/calendar/AgendaTab.test.jsx
index 7ce89c0609..76bfcd52c8 100644
--- a/client/src/components/calendar/AgendaTab.test.jsx
+++ b/client/src/components/calendar/AgendaTab.test.jsx
@@ -50,13 +50,13 @@ describe('AgendaTab empty states', () => {
await renderAgenda([{ id: 'disabled', name: 'Personal', enabled: false }]);
const connectLink = await screen.findByRole('link', { name: 'Connect a calendar' });
- expect(connectLink.getAttribute('href')).toBe('/calendar/sync');
+ expect(connectLink.getAttribute('href')).toBe('/calendar/config');
expect(screen.getByText('No calendar connected')).toBeTruthy();
expect(screen.queryByText('Sync your calendar accounts to see events here')).toBeNull();
expect(screen.getByRole('button', { name: 'Sync' })).toBeDisabled();
fireEvent.click(connectLink);
- expect(screen.getByTestId('pathname')).toHaveTextContent('/calendar/sync');
+ expect(screen.getByTestId('pathname')).toHaveTextContent('/calendar/config');
});
it('offers an enabled in-page sync action when accounts have no events', async () => {
diff --git a/client/src/components/calendar/DayView.jsx b/client/src/components/calendar/DayView.jsx
index 09d79b9aad..18eae69539 100644
--- a/client/src/components/calendar/DayView.jsx
+++ b/client/src/components/calendar/DayView.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useMemo } from 'react';
-import {ChevronLeft, ChevronRight, MapPin} from 'lucide-react';
+import {CalendarDays, ChevronLeft, ChevronRight, MapPin} from 'lucide-react';
import * as api from '../../services/api';
import socket from '../../services/socket';
import EventDetail from './EventDetail';
@@ -7,6 +7,7 @@ import ChronotypeOverlay from './ChronotypeOverlay';
import { buildSubcalendarColorMap, eventChipStyle, getEventDayMinutes } from './calendarUtils';
import { formatDateFull, formatHourOfDay } from '../../utils/formatters';
import BrailleSpinner from '../BrailleSpinner';
+import EmptyState from '../EmptyState';
import { useThemeContext } from '../ThemeContext';
import useUrlParams from '../../hooks/useUrlParams';
@@ -168,6 +169,14 @@ export default function DayView({ accounts }) {
<div className="flex items-center justify-center py-12">
<BrailleSpinner text="Loading" />
</div>
+ ) : accounts.length === 0 ? (
+ <EmptyState
+ icon={CalendarDays}
+ title="No calendar connected"
+ message="Connect a calendar account to see your day."
+ actionTo="/calendar/config"
+ actionLabel="Add a calendar account"
+ />
) : (
<>
{/* All-day events */}
diff --git a/client/src/components/calendar/MonthView.jsx b/client/src/components/calendar/MonthView.jsx
index 2e1761643b..622d9d5796 100644
--- a/client/src/components/calendar/MonthView.jsx
+++ b/client/src/components/calendar/MonthView.jsx
@@ -1,11 +1,12 @@
import { useState, useEffect, useMemo, useRef } from 'react';
-import {ChevronLeft, ChevronRight} from 'lucide-react';
+import {CalendarDays, ChevronLeft, ChevronRight} from 'lucide-react';
import * as api from '../../services/api';
import socket from '../../services/socket';
import EventDetail from './EventDetail';
import Drawer from '../Drawer';
import { buildSubcalendarColorMap, eventChipStyle } from './calendarUtils';
import BrailleSpinner from '../BrailleSpinner';
+import EmptyState from '../EmptyState';
import { useThemeContext } from '../ThemeContext';
import { formatMonthYear, formatTimeOfDay, formatDateFull, localDateKey } from '../../utils/formatters';
import useUrlParams from '../../hooks/useUrlParams';
@@ -138,6 +139,14 @@ export default function MonthView({ accounts }) {
<div className="flex items-center justify-center py-12">
<BrailleSpinner text="Loading" />
</div>
+ ) : accounts.length === 0 ? (
+ <EmptyState
+ icon={CalendarDays}
+ title="No calendar connected"
+ message="Connect a calendar account to see your month."
+ actionTo="/calendar/config"
+ actionLabel="Add a calendar account"
+ />
) : (
<div className="border border-port-border rounded-lg overflow-hidden bg-port-card">
{/* Day name headers */}
diff --git a/client/src/components/calendar/ReviewTab.jsx b/client/src/components/calendar/ReviewTab.jsx
index 4a9339e2f8..ed03c59b4c 100644
--- a/client/src/components/calendar/ReviewTab.jsx
+++ b/client/src/components/calendar/ReviewTab.jsx
@@ -1,12 +1,13 @@
import { useState, useEffect, useCallback } from 'react';
-import {Check, X, ChevronLeft, ChevronRight, Clock, Target, AlertTriangle} from 'lucide-react';
+import {Check, X, ChevronLeft, ChevronRight, Clock, Target, AlertTriangle, CalendarDays} from 'lucide-react';
import toast from '../ui/Toast';
import * as api from '../../services/api';
import { formatDurationMin, formatTimeOfDay } from '../../utils/formatters';
import BrailleSpinner from '../BrailleSpinner';
+import EmptyState from '../EmptyState';
import { localDateStr } from '../meatspace/constants';
-export default function ReviewTab() {
+export default function ReviewTab({ accounts = [] }) {
const [date, setDate] = useState(localDateStr());
const [review, setReview] = useState(null);
const [loading, setLoading] = useState(true);
@@ -164,10 +165,19 @@ export default function ReviewTab() {
{/* Events */}
{(!review?.events?.length) ? (
- <div className="text-center py-12 text-gray-500">
- <p>No events for this date</p>
- <p className="text-sm mt-1">Sync your calendar to see events here</p>
- </div>
+ accounts.length === 0 ? (
+ <EmptyState
+ icon={CalendarDays}
+ title="No calendar connected"
+ message="Connect a calendar account to review your events."
+ actionTo="/calendar/config"
+ actionLabel="Add a calendar account"
+ />
+ ) : (
+ <div className="text-center py-12 text-gray-500">
+ <p>No events for this date</p>
+ </div>
+ )
) : (
<div className="space-y-2">
{[...review.events]
diff --git a/client/src/components/calendar/ReviewTab.test.jsx b/client/src/components/calendar/ReviewTab.test.jsx
index 1ab1b17db3..2ee7bfad01 100644
--- a/client/src/components/calendar/ReviewTab.test.jsx
+++ b/client/src/components/calendar/ReviewTab.test.jsx
@@ -1,4 +1,5 @@
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
import { afterEach, describe, expect, it, vi } from 'vitest';
vi.mock('../../services/api', () => ({
@@ -25,7 +26,7 @@ describe('ReviewTab', () => {
it('defaults to the local calendar date', async () => {
vi.setSystemTime(new Date(2026, 0, 1, 20));
- render(<ReviewTab />);
+ render(<MemoryRouter><ReviewTab /></MemoryRouter>);
await waitFor(() => expect(api.getDailyReview).toHaveBeenCalledWith('2026-01-01'));
expect(screen.getByLabelText('Review date').value).toBe('2026-01-01');
@@ -36,7 +37,7 @@ describe('ReviewTab', () => {
process.env.TZ = 'Pacific/Kiritimati';
vi.setSystemTime(new Date(2026, 0, 1, 20));
- render(<ReviewTab />);
+ render(<MemoryRouter><ReviewTab /></MemoryRouter>);
await waitFor(() => expect(api.getDailyReview).toHaveBeenCalledWith('2026-01-01'));
fireEvent.click(screen.getByRole('button', { name: 'Next' }));
@@ -44,4 +45,27 @@ describe('ReviewTab', () => {
await waitFor(() => expect(api.getDailyReview).toHaveBeenCalledWith('2026-01-02'));
expect(screen.getByLabelText('Review date').value).toBe('2026-01-02');
});
+
+ it('shows a connect-calendar empty state with 0 accounts instead of a generic no-events message', async () => {
+ vi.setSystemTime(new Date(2026, 0, 1, 20));
+
+ render(<MemoryRouter><ReviewTab accounts={[]} /></MemoryRouter>);
+ await waitFor(() => expect(api.getDailyReview).toHaveBeenCalled());
+
+ expect(screen.getByText('No calendar connected')).toBeTruthy();
+ const link = screen.getByRole('link', { name: 'Add a calendar account' });
+ expect(link.getAttribute('href')).toBe('/calendar/config');
+ expect(screen.queryByText('No events for this date')).toBeNull();
+ });
+
+ it('shows the plain no-events message when accounts exist but nothing happened that day', async () => {
+ vi.setSystemTime(new Date(2026, 0, 1, 20));
+
+ render(<MemoryRouter><ReviewTab accounts={[{ id: 'acct-1', name: 'Personal' }]} /></MemoryRouter>);
+ await waitFor(() => expect(api.getDailyReview).toHaveBeenCalled());
+
+ expect(screen.getByText('No events for this date')).toBeTruthy();
+ expect(screen.queryByText('No calendar connected')).toBeNull();
+ expect(screen.queryByText('Sync your calendar to see events here')).toBeNull();
+ });
});
diff --git a/client/src/components/calendar/SyncTab.jsx b/client/src/components/calendar/SyncTab.jsx
index e527442295..64dfeb029f 100644
--- a/client/src/components/calendar/SyncTab.jsx
+++ b/client/src/components/calendar/SyncTab.jsx
@@ -1,10 +1,11 @@
import { useState, useEffect, useCallback } from 'react';
-import { RefreshCw, AlertCircle, Trash2, TestTube, Calendar } from 'lucide-react';
+import { RefreshCw, AlertCircle, Trash2, TestTube, Calendar, CalendarDays } from 'lucide-react';
import toast from '../ui/Toast';
import { formatDateTime } from '../../utils/formatters';
import * as api from '../../services/api';
import socket from '../../services/socket';
import { useAccountSyncStatus } from '../../hooks/useAccountSyncStatus';
+import EmptyState from '../EmptyState';
export default function SyncTab({ accounts, onRefresh }) {
const [tokenStatus, setTokenStatus] = useState(null);
@@ -73,7 +74,13 @@ export default function SyncTab({ accounts, onRefresh }) {
<div>
<h2 className="text-lg font-semibold text-white mb-3">Sync Status</h2>
{accounts.length === 0 && (
- <p className="text-gray-500 text-sm">No accounts configured. Add one in the Config tab.</p>
+ <EmptyState
+ icon={CalendarDays}
+ title="No calendar connected"
+ message="Add a calendar account to start syncing events."
+ actionTo="/calendar/config"
+ actionLabel="Add a calendar account"
+ />
)}
<div className="space-y-2">
{accounts.map((account) => (
diff --git a/client/src/components/calendar/SyncTab.test.jsx b/client/src/components/calendar/SyncTab.test.jsx
index 22a728fe17..2b39ff5203 100644
--- a/client/src/components/calendar/SyncTab.test.jsx
+++ b/client/src/components/calendar/SyncTab.test.jsx
@@ -1,5 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
import SyncTab from './SyncTab';
const api = vi.hoisted(() => ({
@@ -27,6 +28,18 @@ beforeEach(() => {
api.getCalendarTokenStatus.mockResolvedValue({ providers: [] });
});
+describe('SyncTab empty state', () => {
+ it('shows a connect-calendar empty state with a link to Config when there are 0 accounts', async () => {
+ render(<MemoryRouter><SyncTab accounts={[]} onRefresh={vi.fn()} /></MemoryRouter>);
+ await waitFor(() => expect(api.getCalendarTokenStatus).toHaveBeenCalled());
+
+ expect(screen.getByText('No calendar connected')).toBeTruthy();
+ const link = screen.getByRole('link', { name: 'Add a calendar account' });
+ expect(link.getAttribute('href')).toBe('/calendar/config');
+ expect(screen.queryByText(/Add one in the Config tab/)).toBeNull();
+ });
+});
+
describe('Calendar sync lifecycle', () => {
it('releases failed and partial syncs without claiming success, then accepts a new legacy success', async () => {
const onRefresh = vi.fn();
diff --git a/client/src/components/calendar/WeekView.jsx b/client/src/components/calendar/WeekView.jsx
index da9b5188a8..38c6c05daf 100644
--- a/client/src/components/calendar/WeekView.jsx
+++ b/client/src/components/calendar/WeekView.jsx
@@ -1,11 +1,12 @@
import { useState, useEffect, useCallback, useMemo } from 'react';
-import {ChevronLeft, ChevronRight} from 'lucide-react';
+import {CalendarDays, ChevronLeft, ChevronRight} from 'lucide-react';
import * as api from '../../services/api';
import socket from '../../services/socket';
import EventDetail from './EventDetail';
import ChronotypeOverlay from './ChronotypeOverlay';
import { buildSubcalendarColorMap, eventChipStyle, getEventDayMinutes } from './calendarUtils';
import BrailleSpinner from '../BrailleSpinner';
+import EmptyState from '../EmptyState';
import { useThemeContext } from '../ThemeContext';
import { formatMonthDay, formatWeekdayShort, formatDateShort, formatHourOfDay } from '../../utils/formatters';
import useUrlParams from '../../hooks/useUrlParams';
@@ -189,6 +190,14 @@ export default function WeekView({ accounts }) {
<div className="flex items-center justify-center py-12">
<BrailleSpinner text="Loading" />
</div>
+ ) : accounts.length === 0 ? (
+ <EmptyState
+ icon={CalendarDays}
+ title="No calendar connected"
+ message="Connect a calendar account to see your week."
+ actionTo="/calendar/config"
+ actionLabel="Add a calendar account"
+ />
) : (
<div className="border border-port-border rounded-lg overflow-auto bg-port-card">
{/* Day headers */}
diff --git a/client/src/components/calendar/calendarEventChips.test.jsx b/client/src/components/calendar/calendarEventChips.test.jsx
index 35dd0a8786..d4d61b7547 100644
--- a/client/src/components/calendar/calendarEventChips.test.jsx
+++ b/client/src/components/calendar/calendarEventChips.test.jsx
@@ -127,7 +127,7 @@ describe.each([
});
it('falls back to the accent chip when the subcalendar has no color', async () => {
- await renderView(renderTarget([]));
+ await renderView(renderTarget([{ subcalendars: [] }]));
for (const title of titles) {
// `var(--port-accent, #3b82f6)` was the old fallback and is not a color —
@@ -145,6 +145,21 @@ describe.each([
});
});
+describe.each([
+ ['MonthView', (accounts) => <MonthView accounts={accounts} />],
+ ['WeekView', (accounts) => <WeekView accounts={accounts} />],
+ ['DayView', (accounts) => <DayView accounts={accounts} />],
+])('%s zero-account empty state', (_name, renderTarget) => {
+ it('renders a connect-calendar empty state instead of an empty grid when there are 0 accounts', async () => {
+ await renderView(renderTarget([]));
+
+ expect(screen.getByText('No calendar connected')).toBeInTheDocument();
+ const link = screen.getByRole('link', { name: 'Add a calendar account' });
+ expect(link.getAttribute('href')).toBe('/calendar/config');
+ expect(screen.queryByText('12 AM')).not.toBeInTheDocument();
+ });
+});
+
describe.each([
['DayView', DayView],
['WeekView', WeekView],
diff --git a/client/src/pages/Calendar.jsx b/client/src/pages/Calendar.jsx
index fe5e87f4f7..a76b7ab9d6 100644
--- a/client/src/pages/Calendar.jsx
+++ b/client/src/pages/Calendar.jsx
@@ -71,7 +71,7 @@ export default function Calendar() {
case 'lifetime':
return <CalendarLifetimeTab />;
case 'review':
- return <ReviewTab />;
+ return <ReviewTab accounts={accounts} />;
case 'config':
return <ConfigTab accounts={accounts} setAccounts={setAccounts} />;
case 'sync':