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

fix: collapse the timeline's seven backfill importers behind one disclosure (#3789)

[._.]/ Adam Eivy15be05efcfa4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9835765a3a..dae75c4024 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -72,3 +72,4 @@
- **Settings → Backup now keeps Save and Run Backup Now in reach.** The tab handed most of its height to the built-in Default Exclusions catalog — 15+ rows of internal path patterns, each with a toggle and a paragraph of explanation — and put both commit actions below it, so the ordinary edit (destination, Enabled, schedule) meant scrolling past a wall of infrastructure toggles to find the button, with nothing on screen saying the change was still unsaved. The exclusions catalog is now collapsed behind a disclosure that summarizes it ("Default exclusions — N paths skipped", plus a count of any you re-included), and Save/Run Backup Now sit in a sticky bar pinned to the bottom of the tab carrying an "Unsaved changes"/"Saving…" hint. The Enabled toggle and the cron schedule also count as unsaved edits now: they ride the same save as the destination path, but only the destination fed the dirty check, so flipping the schedule and hitting Run Backup Now would silently run against the old saved value.
While collapsing that catalog, one more thing surfaced: an overridable default's switch reported the *effective* rsync outcome rather than the user's own override, so a re-included path that a custom exclude pattern still shadowed rendered as switched off — and clicking it dropped the override while appearing to do nothing. The switch now reports the override, and the existing "(still excluded via Additional Exclude Paths)" note keeps carrying the effective state.
- **The "install out of sync" and "update available" notices no longer sit on top of the screen you're using.** Both were raised as permanent corner toasts, and on a phone the card landed squarely on the bottom of the viewport — covering the Ask composer and its Send button, the Add Peer form on Instances, and the process list on System Health. Since neither notice ever times out, that was the resting state of the app after any `git pull`: you had to find the small Dismiss link before the screen worked again, and the toast came back on the next poll. They are now inline banners in the app chrome, directly under the header and in normal document flow, so they push the page down instead of covering it, and dismissing the out-of-sync notice sticks for the commit you dismissed it on — a later pull raises it again.
+- **The Timeline's seven backfill importers no longer outrank the day you came to look at.** Every one-time "Import … history" panel — Gmail, Spotify, Google location, Discord, WhatsApp, browser, YouTube — rendered permanently at full width between the date picker and the content, taking the whole top half of a 1440x900 viewport (and effectively the entire screen on a phone) before the activity chart or a single event appeared. They now live behind one "Import history (7)" toggle beside the date, and lay out two-per-row once expanded, so the chart and the day's events start at the top of the content area. A day with nothing recorded offers a "Backfill from an export" button in its empty state, which opens the same set — the setup path stays one click away instead of one screen tall.
diff --git a/client/src/components/timeline/TimelineImportPanels.jsx b/client/src/components/timeline/TimelineImportPanels.jsx
new file mode 100644
index 0000000000..48f3120fb4
--- /dev/null
+++ b/client/src/components/timeline/TimelineImportPanels.jsx
@@ -0,0 +1,35 @@
+import SpotifyImportPanel from './SpotifyImportPanel';
+import TakeoutLocationImportPanel from './TakeoutLocationImportPanel';
+import DiscordImportPanel from './DiscordImportPanel';
+import WhatsappImportPanel from './WhatsappImportPanel';
+import BrowserHistoryImportPanel from './BrowserHistoryImportPanel';
+import YoutubeImportPanel from './YoutubeImportPanel';
+import GmailMboxImportPanel from './GmailMboxImportPanel';
+
+// The one-time bulk-backfill importers (#2160), grouped behind a single
+// disclosure on /timeline (#3789). They used to render permanently at full
+// width between the date picker and the day's activity, which pushed the
+// content the page exists to show below the fold on every day view. They now
+// live under the "Import history" toggle and lay out in a two-column grid so
+// even the expanded list stays compact.
+const PANELS = [
+ { id: 'gmail', Component: GmailMboxImportPanel },
+ { id: 'spotify', Component: SpotifyImportPanel },
+ { id: 'location', Component: TakeoutLocationImportPanel },
+ { id: 'discord', Component: DiscordImportPanel },
+ { id: 'whatsapp', Component: WhatsappImportPanel },
+ { id: 'browser', Component: BrowserHistoryImportPanel },
+ { id: 'youtube', Component: YoutubeImportPanel },
+];
+
+// Count of connectors, surfaced on the toggle so the collapsed control still
+// says how much is behind it.
+export const IMPORT_SOURCE_COUNT = PANELS.length;
+
+export default function TimelineImportPanels({ onImported }) {
+ return (
+ <div className="grid gap-2 sm:grid-cols-2">
+ {PANELS.map(({ id, Component }) => <Component key={id} onImported={onImported} />)}
+ </div>
+ );
+}
diff --git a/client/src/pages/Timeline.jsx b/client/src/pages/Timeline.jsx
index 1e35eba2af..39a130f4f7 100644
--- a/client/src/pages/Timeline.jsx
+++ b/client/src/pages/Timeline.jsx
@@ -2,17 +2,11 @@ import { useState, useEffect, useMemo } from 'react';
import { useParams, useNavigate } from 'react-router';
import {
CalendarClock, ChevronLeft, ChevronRight, Mail, MailOpen, Send,
- CalendarDays, Music, Play, MessageSquare, Activity, MapPin, Globe,
+ CalendarDays, Music, Play, MessageSquare, Activity, MapPin, Globe, Download,
} from 'lucide-react';
import PageSkeleton from '../components/ui/PageSkeleton';
import PageHeader from '../components/PageHeader';
-import SpotifyImportPanel from '../components/timeline/SpotifyImportPanel';
-import TakeoutLocationImportPanel from '../components/timeline/TakeoutLocationImportPanel';
-import DiscordImportPanel from '../components/timeline/DiscordImportPanel';
-import WhatsappImportPanel from '../components/timeline/WhatsappImportPanel';
-import BrowserHistoryImportPanel from '../components/timeline/BrowserHistoryImportPanel';
-import YoutubeImportPanel from '../components/timeline/YoutubeImportPanel';
-import GmailMboxImportPanel from '../components/timeline/GmailMboxImportPanel';
+import TimelineImportPanels, { IMPORT_SOURCE_COUNT } from '../components/timeline/TimelineImportPanels';
import * as api from '../services/api';
import toast from '../components/ui/Toast';
import { formatClockTime, formatDurationSec } from '../utils/formatters';
@@ -140,6 +134,10 @@ export default function Timeline() {
const [loading, setLoading] = useState(true);
// Bumped after a bulk import lands so the current day view re-fetches.
const [reloadKey, setReloadKey] = useState(0);
+ // The bulk-backfill importers are one-time setup affordances, so they stay
+ // behind a collapsed disclosure instead of outranking the day's activity
+ // (#3789). The empty-day state offers the same toggle for discoverability.
+ const [showImports, setShowImports] = useState(false);
useEffect(() => {
let active = true;
@@ -214,16 +212,26 @@ export default function Timeline() {
</button>
)}
</div>
- <div className="text-sm text-gray-400">{dayLabel}</div>
+ <div className="flex items-center gap-2">
+ <span className="text-sm text-gray-400">{dayLabel}</span>
+ <button
+ type="button"
+ onClick={() => setShowImports((v) => !v)}
+ aria-expanded={showImports}
+ aria-controls="timeline-import-panels"
+ className="inline-flex items-center gap-1.5 rounded border border-port-border bg-port-card px-2.5 py-1.5 text-xs text-gray-400 hover:border-port-accent hover:text-gray-200"
+ >
+ <Download size={14} />
+ Import history ({IMPORT_SOURCE_COUNT})
+ </button>
+ </div>
</div>
- <GmailMboxImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <SpotifyImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <TakeoutLocationImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <DiscordImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <WhatsappImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <BrowserHistoryImportPanel onImported={() => setReloadKey((k) => k + 1)} />
- <YoutubeImportPanel onImported={() => setReloadKey((k) => k + 1)} />
+ {showImports && (
+ <div id="timeline-import-panels">
+ <TimelineImportPanels onImported={() => setReloadKey((k) => k + 1)} />
+ </div>
+ )}
<Histogram histogram={histogram} />
@@ -242,6 +250,16 @@ export default function Timeline() {
<div className="rounded border border-dashed border-port-border py-12 text-center text-gray-500">
No recorded activity on this day.
<div className="mt-1 text-xs">Activity populates as your message and calendar accounts sync.</div>
+ {!showImports && (
+ <button
+ type="button"
+ onClick={() => setShowImports(true)}
+ className="mt-3 inline-flex items-center gap-1.5 rounded border border-port-border bg-port-card px-3 py-1.5 text-xs text-gray-300 hover:border-port-accent hover:text-gray-100"
+ >
+ <Download size={14} />
+ Backfill from an export
+ </button>
+ )}
</div>
) : (
<div className="flex flex-col gap-2 pb-6">
diff --git a/client/src/pages/Timeline.test.jsx b/client/src/pages/Timeline.test.jsx
new file mode 100644
index 0000000000..9a0d92b617
--- /dev/null
+++ b/client/src/pages/Timeline.test.jsx
@@ -0,0 +1,55 @@
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, fireEvent } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
+
+vi.mock('../services/api', () => ({
+ getTimelineDay: vi.fn(() => Promise.resolve({
+ date: '2026-01-02',
+ today: '2026-01-02',
+ events: [],
+ counts: { total: 0, bySource: {}, byKind: {} },
+ histogram: Array.from({ length: 24 }, (_, hour) => ({ hour, count: 0 })),
+ })),
+ importSpotifyHistory: vi.fn(),
+ importTakeoutLocationHistory: vi.fn(),
+ importDiscordHistory: vi.fn(),
+ importWhatsappHistory: vi.fn(),
+ importBrowserHistory: vi.fn(),
+ importYoutubeHistory: vi.fn(),
+ importGmailMbox: vi.fn(),
+}));
+
+import Timeline from './Timeline';
+import { IMPORT_SOURCE_COUNT } from '../components/timeline/TimelineImportPanels';
+
+const renderPage = () => render(<MemoryRouter><Timeline /></MemoryRouter>);
+
+describe('Timeline import-history disclosure (#3789)', () => {
+ it('keeps the backfill importers collapsed so the day view stays above the fold', async () => {
+ renderPage();
+ await screen.findByText('No recorded activity on this day.');
+ const toggle = screen.getByRole('button', { name: `Import history (${IMPORT_SOURCE_COUNT})` });
+ expect(toggle.getAttribute('aria-expanded')).toBe('false');
+ expect(screen.queryByText('Import Spotify history')).toBeNull();
+ // The day's own content still renders without expanding anything.
+ expect(screen.getByLabelText('Hourly activity histogram')).toBeTruthy();
+ });
+
+ it('reveals every source panel when the disclosure is opened', async () => {
+ renderPage();
+ await screen.findByText('No recorded activity on this day.');
+ fireEvent.click(screen.getByRole('button', { name: `Import history (${IMPORT_SOURCE_COUNT})` }));
+ expect(screen.getByText('Import Spotify history')).toBeTruthy();
+ // Every registered connector renders one collapsed panel header.
+ expect(screen.getAllByText('Backfill')).toHaveLength(IMPORT_SOURCE_COUNT);
+ });
+
+ it('offers the backfill affordance from the empty-day state', async () => {
+ renderPage();
+ const backfill = await screen.findByRole('button', { name: 'Backfill from an export' });
+ fireEvent.click(backfill);
+ expect(screen.getByText('Import Spotify history')).toBeTruthy();
+ // The empty-state shortcut disappears once the panels are showing.
+ expect(screen.queryByRole('button', { name: 'Backfill from an export' })).toBeNull();
+ });
+});