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-5640]): give a fresh install a first-run card that stages one PortOS slice (#5935)

atomanticagentef01600074de
diff --git a/client/src/components/onboarding/FirstRunCard.jsx b/client/src/components/onboarding/FirstRunCard.jsx
new file mode 100644
index 0000000000..54efd6e704
--- /dev/null
+++ b/client/src/components/onboarding/FirstRunCard.jsx
@@ -0,0 +1,178 @@
+import { useCallback, useEffect, useState } from 'react';
+import { useLocation, useNavigate, useSearchParams } from 'react-router';
+import {
+ ArrowRight, Brain, Clapperboard, ListChecks, Monitor, Sparkles, X,
+} from 'lucide-react';
+import toast from '../ui/Toast';
+import useEscapeKey from '../../hooks/useEscapeKey.js';
+import {
+ publishInstanceFeatures,
+ useInstanceFeatures,
+} from '../../hooks/useInstanceFeatures.js';
+import {
+ FIRST_RUN_HIDE_SETTING,
+ FIRST_RUN_MISSIONS,
+ FIRST_RUN_QUERY_PARAM,
+ FIRST_RUN_SESSION_KEY,
+ featuresToEnable,
+ parseFirstRunQueryParam,
+ shouldShowFirstRunCard,
+} from '../../lib/firstRunMissions.js';
+import { safeReadSession, safeWriteSession } from '../../lib/safeStorage.js';
+import * as api from '../../services/api';
+
+const MISSION_ICONS = { Brain, Clapperboard, ListChecks, Monitor };
+
+const dismissSession = () => safeWriteSession(FIRST_RUN_SESSION_KEY, '1');
+
+export default function FirstRunCard() {
+ const { pathname } = useLocation();
+ const navigate = useNavigate();
+ const [searchParams] = useSearchParams();
+ const { features } = useInstanceFeatures();
+ const [settingsLoaded, setSettingsLoaded] = useState(false);
+ const [hideSetting, setHideSetting] = useState(false);
+ const [sessionDismissed, setSessionDismissed] = useState(
+ () => safeReadSession(FIRST_RUN_SESSION_KEY) === '1',
+ );
+ const [busy, setBusy] = useState(false);
+
+ useEffect(() => {
+ let active = true;
+ api.getSettings({ silent: true })
+ .then((settings) => {
+ if (!active) return;
+ setHideSetting(settings?.[FIRST_RUN_HIDE_SETTING] === true);
+ setSettingsLoaded(true);
+ })
+ .catch(() => {
+ if (!active) return;
+ setHideSetting(false);
+ setSettingsLoaded(true);
+ });
+ return () => { active = false; };
+ }, []);
+
+ const queryForce = parseFirstRunQueryParam(searchParams.get(FIRST_RUN_QUERY_PARAM));
+ const visible = shouldShowFirstRunCard({
+ pathname,
+ queryForce,
+ settingsLoaded,
+ hideSetting,
+ sessionDismissed,
+ });
+
+ const hideForSession = useCallback(() => {
+ dismissSession();
+ setSessionDismissed(true);
+ }, []);
+
+ useEscapeKey(visible && !busy, hideForSession);
+
+ const pickMission = (mission) => {
+ if (busy || !mission) return;
+ setBusy(true);
+ const ids = featuresToEnable(mission, features);
+ ids.reduce(
+ (chain, id) => chain.then(() => api.updateInstanceFeature(id, true, { silent: true })),
+ Promise.resolve(null),
+ )
+ .then((result) => {
+ if (result?.features) publishInstanceFeatures(result.features);
+ })
+ .catch((err) => {
+ toast.error(err.message || 'Could not enable those features');
+ })
+ .finally(() => {
+ hideForSession();
+ navigate(mission.to);
+ });
+ };
+
+ const hideForever = () => {
+ if (busy) return;
+ setBusy(true);
+ api.updateSettings({ [FIRST_RUN_HIDE_SETTING]: true }, { silent: true })
+ .then(() => {
+ setHideSetting(true);
+ hideForSession();
+ })
+ .catch((err) => {
+ toast.error(err.message || 'Could not save that preference');
+ })
+ .finally(() => setBusy(false));
+ };
+
+ if (!visible) return null;
+
+ return (
+ <section
+ aria-labelledby="first-run-heading"
+ className="bg-port-card border border-port-accent/40 rounded-xl p-4 sm:p-5"
+ >
+ <div className="flex items-start gap-2 sm:gap-3">
+ <Sparkles size={18} className="text-port-accent shrink-0 mt-0.5" />
+ <div className="min-w-0 flex-1">
+ <h3 id="first-run-heading" className="text-base font-semibold text-white">
+ Where do you want to start?
+ </h3>
+ <p className="mt-1 text-sm text-gray-400">
+ Pick a mission to turn on that slice of PortOS and jump in. Exploring
+ on your own, or pressing escape, just hides this for the session.
+ </p>
+ </div>
+ <button
+ type="button"
+ onClick={hideForSession}
+ disabled={busy}
+ aria-label="Dismiss for this session"
+ title="Dismiss for this session"
+ className="p-1 rounded text-gray-500 hover:text-white hover:bg-port-border/60 disabled:opacity-50 min-h-[32px] min-w-[32px]"
+ >
+ <X size={14} />
+ </button>
+ </div>
+
+ <div className="mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
+ {FIRST_RUN_MISSIONS.map((mission) => {
+ const Icon = MISSION_ICONS[mission.icon] || Sparkles;
+ return (
+ <button
+ key={mission.id}
+ type="button"
+ onClick={() => pickMission(mission)}
+ disabled={busy}
+ className="flex items-start gap-2 text-left p-3 rounded-lg border border-port-border hover:border-port-accent transition-colors disabled:opacity-50 min-h-[40px]"
+ >
+ <Icon size={16} className="text-port-accent shrink-0 mt-0.5" />
+ <span className="min-w-0 flex-1">
+ <span className="block text-sm font-medium text-white">{mission.label}</span>
+ <span className="block text-xs text-gray-500 mt-0.5">{mission.description}</span>
+ </span>
+ <ArrowRight size={14} className="text-port-accent shrink-0 mt-0.5" />
+ </button>
+ );
+ })}
+ </div>
+
+ <div className="mt-4 flex flex-wrap items-center gap-3 text-sm">
+ <button
+ type="button"
+ onClick={hideForSession}
+ disabled={busy}
+ className="text-gray-400 hover:text-white disabled:opacity-50"
+ >
+ Explore on my own
+ </button>
+ <button
+ type="button"
+ onClick={hideForever}
+ disabled={busy}
+ className="text-gray-400 hover:text-white disabled:opacity-50"
+ >
+ Don&apos;t show this again
+ </button>
+ </div>
+ </section>
+ );
+}
diff --git a/client/src/components/onboarding/FirstRunCard.test.jsx b/client/src/components/onboarding/FirstRunCard.test.jsx
new file mode 100644
index 0000000000..434268b1b6
--- /dev/null
+++ b/client/src/components/onboarding/FirstRunCard.test.jsx
@@ -0,0 +1,147 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { createMemoryRouter, RouterProvider } from 'react-router';
+
+const mock = vi.hoisted(() => ({
+ getSettings: vi.fn(),
+ updateSettings: vi.fn(),
+ getInstanceFeatures: vi.fn(),
+ updateInstanceFeature: vi.fn(),
+}));
+
+vi.mock('../../services/api', () => mock);
+vi.mock('../ui/Toast', () => ({
+ default: Object.assign(vi.fn(), { success: vi.fn(), error: vi.fn() }),
+}));
+
+import { __resetInstanceFeatureCache } from '../../hooks/useInstanceFeatures.js';
+import {
+ FIRST_RUN_HIDE_SETTING,
+ FIRST_RUN_MISSIONS,
+ FIRST_RUN_SESSION_KEY,
+} from '../../lib/firstRunMissions.js';
+import FirstRunCard from './FirstRunCard.jsx';
+
+const FEATURES = [
+ { id: 'health', enabled: false },
+ { id: 'gsd', enabled: false },
+ { id: 'openclaw', enabled: false },
+ { id: 'post', enabled: true },
+];
+
+const heading = 'Where do you want to start?';
+
+const renderCard = async (path = '/') => {
+ const router = createMemoryRouter([
+ { path: '/', element: <FirstRunCard /> },
+ { path: '/apps', element: <FirstRunCard /> },
+ { path: '/start-story', element: <div>Start a story</div> },
+ { path: '/brain/inbox', element: <div>Brain inbox</div> },
+ { path: '/cos/tasks', element: <div>CoS tasks</div> },
+ ], { initialEntries: [path] });
+ render(<RouterProvider router={router} />);
+ await act(async () => {});
+ return router;
+};
+
+beforeEach(() => {
+ vi.clearAllMocks();
+ __resetInstanceFeatureCache();
+ mock.getSettings.mockResolvedValue({});
+ mock.updateSettings.mockResolvedValue({ [FIRST_RUN_HIDE_SETTING]: true });
+ mock.getInstanceFeatures.mockResolvedValue({ features: FEATURES });
+ mock.updateInstanceFeature.mockImplementation(async (id) => ({
+ features: FEATURES.map((feature) => (
+ feature.id === id ? { ...feature, enabled: true } : feature
+ )),
+ }));
+});
+
+describe('FirstRunCard show/hide', () => {
+ it('shows on / after settings load', async () => {
+ await renderCard('/');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ for (const mission of FIRST_RUN_MISSIONS) {
+ expect(screen.getByRole('button', { name: new RegExp(mission.label) })).toBeInTheDocument();
+ }
+ });
+
+ it('never shows on a deep link, even when forced on', async () => {
+ await renderCard('/apps?firstRun=1');
+ await act(async () => {});
+ expect(screen.queryByRole('heading', { name: heading })).not.toBeInTheDocument();
+ });
+
+ it('hides for the rest of the session after explore / escape / the X', async () => {
+ await renderCard('/');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'Explore on my own' }));
+ expect(screen.queryByRole('heading', { name: heading })).not.toBeInTheDocument();
+ expect(sessionStorage.getItem(FIRST_RUN_SESSION_KEY)).toBe('1');
+ expect(mock.updateSettings).not.toHaveBeenCalled();
+ });
+
+ it('lets ?firstRun=1 force the card on even when durably suppressed', async () => {
+ mock.getSettings.mockResolvedValue({ [FIRST_RUN_HIDE_SETTING]: true });
+ await renderCard('/?firstRun=1');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ });
+
+ it('lets ?firstRun=0 force the card off', async () => {
+ await renderCard('/?firstRun=0');
+ await act(async () => {});
+ expect(screen.queryByRole('heading', { name: heading })).not.toBeInTheDocument();
+ });
+});
+
+describe('FirstRunCard durable suppress', () => {
+ it('stays hidden when general settings already suppress it', async () => {
+ mock.getSettings.mockResolvedValue({ [FIRST_RUN_HIDE_SETTING]: true });
+ await renderCard('/');
+ await act(async () => {});
+ expect(screen.queryByRole('heading', { name: heading })).not.toBeInTheDocument();
+ });
+
+ it('writes hideFirstRunCard on general settings, not localStorage', async () => {
+ await renderCard('/');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: "Don't show this again" }));
+ await waitFor(() => {
+ expect(mock.updateSettings).toHaveBeenCalledWith(
+ { [FIRST_RUN_HIDE_SETTING]: true },
+ { silent: true },
+ );
+ });
+ expect(localStorage.getItem(FIRST_RUN_HIDE_SETTING)).toBe(null);
+ expect(localStorage.getItem(FIRST_RUN_SESSION_KEY)).toBe(null);
+ await waitFor(() => {
+ expect(screen.queryByRole('heading', { name: heading })).not.toBeInTheDocument();
+ });
+ });
+});
+
+describe('FirstRunCard mission feature writes', () => {
+ it('writes only the matching Features toggles, then lands on the mission path', async () => {
+ const router = await renderCard('/');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: /Personal knowledge/ }));
+ await waitFor(() => {
+ expect(mock.updateInstanceFeature).toHaveBeenCalledWith('health', true, { silent: true });
+ });
+ expect(mock.updateInstanceFeature).toHaveBeenCalledTimes(1);
+ expect(mock.updateInstanceFeature.mock.calls.every(([id]) => id === 'health')).toBe(true);
+ await waitFor(() => {
+ expect(router.state.location.pathname).toBe('/brain/inbox');
+ });
+ });
+
+ it('does not PATCH features for a mission that has none', async () => {
+ const router = await renderCard('/');
+ expect(await screen.findByRole('heading', { name: heading })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: /Creative studio/ }));
+ await waitFor(() => {
+ expect(router.state.location.pathname).toBe('/start-story');
+ });
+ expect(mock.updateInstanceFeature).not.toHaveBeenCalled();
+ });
+});
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 9e2ab91277..eb74c8c425 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -123,6 +123,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `dndTransform.js` | `dndTransformToCss(transform)` — render a dnd-kit `useSortable` transform (`{ x, y, scaleX, scaleY }` or `null`) as a CSS `transform` string. Owned replacement for `@dnd-kit/utilities`' `CSS.Transform.toString()`; use it in every `useSortable` style object instead of re-adding that dependency. |
| `downloadBlob.js` | `downloadBlob(data, filename, type?)` — trigger a browser "Save as…" for a Blob / ArrayBuffer / typed array / string, with object-URL + temporary `<a>` cleanup. Use instead of inlining `URL.createObjectURL` + `<a download>`. |
| `extensionErrors.js` | `isExtensionError(payload)` — true when an error report came from a browser extension's injected content script rather than from PortOS, so `clientErrorReporter` can drop it instead of spending its 1/sec throttle slot on an error we can't fix. Client mirror of the authoritative `server/lib/extensionErrors.js` (parity enforced by `server/lib/extensionErrors.mirror.test.js`); the server re-checks, since a long-lived tab can still be running an old bundle. |
+| `firstRunMissions.js` | Dashboard first-run missions (#5640). `FIRST_RUN_MISSIONS` is the four-slice catalog (Creative studio → `/start-story`, Personal knowledge → `/brain/inbox`, Run my machines → `/apps`, Delegate work → `/cos/tasks`) plus the matching Settings → Features ids each mission writes. `shouldShowFirstRunCard` / `parseFirstRunQueryParam` / `featuresToEnable` are the show/hide and write-set helpers — `/` only, session dismiss vs durable `hideFirstRunCard`, `?firstRun=` force on/off. Pure / React-free; the card lives in `components/onboarding/`. |
| `genUtils.js` | Shared bits between Image Gen and Video Gen pages. |
| `repoUrl.js` | `parseRepoUrl(url)` / `isRepoUrl(url)` / `repoBrowseUrl(parsed)` / `parseGitHubUrl(url)` / `isGitHubRepoUrl(url)` — client mirror of the authoritative `server/lib/repoUrl.js` (parity enforced by `server/lib/repoUrl.mirror.test.js`), covering github.com and gitlab.com. The Brain capture boxes use it to tell the user a bare repo URL will be cloned and to reveal the post-clone agent options (malware scan / learn-from-repo). |
| `healthProvenance.js` | `PROVENANCE_LEVELS` / `getProvenanceLevel(level)` — the `data-backed`/`inferred`/`experimental`/`speculative` trust taxonomy (label, tone, description, "what would change this?" copy) behind the `ProvenanceChip` source-style chips on MeatSpace / genome / death-clock / longevity views. Pure data; the chip component maps tone→color and id→icon. |
diff --git a/client/src/lib/firstRunMissions.js b/client/src/lib/firstRunMissions.js
new file mode 100644
index 0000000000..4b83b05274
--- /dev/null
+++ b/client/src/lib/firstRunMissions.js
@@ -0,0 +1,88 @@
+// First-run missions (issue #5640).
+//
+// Pure data + visibility helpers for the dashboard first-run card. One mission
+// per top-level PortOS slice that has a natural entry point. A mission writes
+// ONLY the matching Settings → Features toggles (via the existing features
+// PUT) and nothing else — no AI provider, no credential, no LLM call.
+//
+// Auto-detected integrations (datadog, jira, eidoverse, facetime) are omitted
+// on purpose: enabling them without the integration they front is noise, and
+// eidoverse's PUT 409s until Worlds is installed. POST is its own section.
+
+export const FIRST_RUN_QUERY_PARAM = 'firstRun';
+export const FIRST_RUN_HIDE_SETTING = 'hideFirstRunCard';
+export const FIRST_RUN_SESSION_KEY = 'portos-first-run-dismissed';
+export const FIRST_RUN_PATH = '/';
+
+export const FIRST_RUN_MISSIONS = Object.freeze([
+ Object.freeze({
+ id: 'creative-studio',
+ label: 'Creative studio',
+ description: 'Start a story, universe, or production pipeline.',
+ to: '/start-story',
+ icon: 'Clapperboard',
+ features: Object.freeze([]),
+ }),
+ Object.freeze({
+ id: 'personal-knowledge',
+ label: 'Personal knowledge',
+ description: 'Capture thoughts into your inbox and notes.',
+ to: '/brain/inbox',
+ icon: 'Brain',
+ features: Object.freeze(['health']),
+ }),
+ Object.freeze({
+ id: 'run-my-machines',
+ label: 'Run my machines',
+ description: 'Launch and manage the apps on this install.',
+ to: '/apps',
+ icon: 'Monitor',
+ features: Object.freeze(['gsd']),
+ }),
+ Object.freeze({
+ id: 'delegate-work',
+ label: 'Delegate work',
+ description: 'Hand a task to the Chief of Staff agent queue.',
+ to: '/cos/tasks',
+ icon: 'ListChecks',
+ features: Object.freeze(['openclaw']),
+ }),
+]);
+
+const QUERY_ON = new Set(['1', 'true', 'on', 'yes']);
+const QUERY_OFF = new Set(['0', 'false', 'off', 'no']);
+
+// `?firstRun=1` / `on` / `true` forces the card on; `0` / `off` / `false`
+// forces it off. Anything else (including a missing param) is no override —
+// the URL is demonstration-only and is never persisted.
+export function parseFirstRunQueryParam(raw) {
+ if (raw == null || raw === '') return null;
+ const value = String(raw).trim().toLowerCase();
+ if (QUERY_ON.has(value)) return true;
+ if (QUERY_OFF.has(value)) return false;
+ return null;
+}
+
+export function featuresToEnable(mission, instanceFeatures) {
+ const list = Array.isArray(instanceFeatures) ? instanceFeatures : [];
+ return (mission?.features || []).filter((id) => {
+ const feature = list.find((item) => item?.id === id);
+ return !feature || feature.enabled !== true;
+ });
+}
+
+export function shouldShowFirstRunCard({
+ pathname,
+ queryForce = null,
+ settingsLoaded = false,
+ hideSetting = false,
+ sessionDismissed = false,
+} = {}) {
+ if (pathname !== FIRST_RUN_PATH) return false;
+ if (queryForce === true) return true;
+ if (queryForce === false) return false;
+ if (!settingsLoaded) return false;
+ if (hideSetting) return false;
+ if (sessionDismissed) return false;
+ return true;
+}
diff --git a/client/src/lib/firstRunMissions.test.js b/client/src/lib/firstRunMissions.test.js
new file mode 100644
index 0000000000..5bee02ee49
--- /dev/null
+++ b/client/src/lib/firstRunMissions.test.js
@@ -0,0 +1,100 @@
+import { describe, expect, it } from 'vitest';
+import {
+ FIRST_RUN_HIDE_SETTING,
+ FIRST_RUN_MISSIONS,
+ FIRST_RUN_PATH,
+ FIRST_RUN_QUERY_PARAM,
+ featuresToEnable,
+ parseFirstRunQueryParam,
+ shouldShowFirstRunCard,
+} from './firstRunMissions.js';
+
+describe('firstRunMissions data', () => {
+ it('stages the four PortOS slices on their natural entry points', () => {
+ expect(FIRST_RUN_MISSIONS.map((m) => [m.id, m.to])).toEqual([
+ ['creative-studio', '/start-story'],
+ ['personal-knowledge', '/brain/inbox'],
+ ['run-my-machines', '/apps'],
+ ['delegate-work', '/cos/tasks'],
+ ]);
+ });
+
+ it('only names known Settings → Features ids, never auto-detected integrations', () => {
+ const ids = FIRST_RUN_MISSIONS.flatMap((m) => m.features);
+ expect(ids.sort()).toEqual(['gsd', 'health', 'openclaw']);
+ expect(ids).not.toContain('datadog');
+ expect(ids).not.toContain('jira');
+ expect(ids).not.toContain('eidoverse');
+ expect(ids).not.toContain('facetime');
+ expect(ids).not.toContain('post');
+ });
+
+ it('keeps the query-param and durable-setting names stable', () => {
+ expect(FIRST_RUN_QUERY_PARAM).toBe('firstRun');
+ expect(FIRST_RUN_HIDE_SETTING).toBe('hideFirstRunCard');
+ expect(FIRST_RUN_PATH).toBe('/');
+ });
+});
+
+describe('parseFirstRunQueryParam', () => {
+ it('forces on/off from the demonstration contract and ignores anything else', () => {
+ expect(parseFirstRunQueryParam('1')).toBe(true);
+ expect(parseFirstRunQueryParam('on')).toBe(true);
+ expect(parseFirstRunQueryParam('TRUE')).toBe(true);
+ expect(parseFirstRunQueryParam('0')).toBe(false);
+ expect(parseFirstRunQueryParam('off')).toBe(false);
+ expect(parseFirstRunQueryParam('false')).toBe(false);
+ expect(parseFirstRunQueryParam(null)).toBe(null);
+ expect(parseFirstRunQueryParam('')).toBe(null);
+ expect(parseFirstRunQueryParam('maybe')).toBe(null);
+ });
+});
+
+describe('featuresToEnable', () => {
+ const knowledge = FIRST_RUN_MISSIONS.find((m) => m.id === 'personal-knowledge');
+ const creative = FIRST_RUN_MISSIONS.find((m) => m.id === 'creative-studio');
+
+ it('writes only matching features that are not already on', () => {
+ expect(featuresToEnable(knowledge, [{ id: 'health', enabled: false }])).toEqual(['health']);
+ expect(featuresToEnable(knowledge, [{ id: 'health', enabled: true }])).toEqual([]);
+ expect(featuresToEnable(knowledge, [])).toEqual(['health']);
+ expect(featuresToEnable(creative, [{ id: 'health', enabled: false }])).toEqual([]);
+ });
+});
+
+describe('shouldShowFirstRunCard', () => {
+ const shown = {
+ pathname: '/',
+ queryForce: null,
+ settingsLoaded: true,
+ hideSetting: false,
+ sessionDismissed: false,
+ };
+
+ it('shows on / once settings have loaded and nothing has dismissed it', () => {
+ expect(shouldShowFirstRunCard(shown)).toBe(true);
+ });
+
+ it('never shows off the dashboard index (deep links / ⌘K / voice ui_navigate)', () => {
+ expect(shouldShowFirstRunCard({ ...shown, pathname: '/apps' })).toBe(false);
+ expect(shouldShowFirstRunCard({ ...shown, pathname: '/start-story' })).toBe(false);
+ expect(shouldShowFirstRunCard({ ...shown, pathname: '/brain/inbox' })).toBe(false);
+ expect(shouldShowFirstRunCard({ ...shown, pathname: '/cos/tasks' })).toBe(false);
+ });
+
+ it('hides until the durable setting has been read, so a suppressed install does not flash', () => {
+ expect(shouldShowFirstRunCard({ ...shown, settingsLoaded: false })).toBe(false);
+ });
+
+ it('hides for a durable suppress and for a session dismiss', () => {
+ expect(shouldShowFirstRunCard({ ...shown, hideSetting: true })).toBe(false);
+ expect(shouldShowFirstRunCard({ ...shown, sessionDismissed: true })).toBe(false);
+ });
+
+ it('lets ?firstRun= force on or off without inventing extra persistence', () => {
+ expect(shouldShowFirstRunCard({ ...shown, hideSetting: true, queryForce: true })).toBe(true);
+ expect(shouldShowFirstRunCard({ ...shown, sessionDismissed: true, queryForce: true })).toBe(true);
+ expect(shouldShowFirstRunCard({ ...shown, queryForce: false })).toBe(false);
+ expect(shouldShowFirstRunCard({ ...shown, pathname: '/apps', queryForce: true })).toBe(false);
+ });
+});
diff --git a/client/src/lib/index.js b/client/src/lib/index.js
index 94ea0a0e68..15d89fec79 100644
--- a/client/src/lib/index.js
+++ b/client/src/lib/index.js
@@ -95,6 +95,7 @@ export * from './diffWords.js';
export * from './dndTransform.js';
export * from './downloadBlob.js';
export * from './extensionErrors.js';
+export * from './firstRunMissions.js';
export * from './genUtils.js';
export * from './repoUrl.js';
export * from './healthProvenance.js';
diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx
index bc39cd32a0..fbd7e32d23 100644
--- a/client/src/pages/Dashboard.jsx
+++ b/client/src/pages/Dashboard.jsx
@@ -7,6 +7,7 @@ import LayoutEditor from '../components/dashboard/LayoutEditor';
import DashboardGrid, { readingOrderIds, reconcileGrid, synthesizeGrid } from '../components/dashboard/DashboardGrid.jsx';
import { WIDGETS_BY_ID, FALLBACK_LAYOUT } from '../components/dashboard/widgetRegistry.jsx';
import WidgetSkeleton from '../components/dashboard/WidgetSkeleton';
+import FirstRunCard from '../components/onboarding/FirstRunCard.jsx';
import { DASHBOARD_LAYOUT_CHANGED, INSTANCE_FEATURES_CHANGED } from '../constants/events.js';
import { ChevronsDownUp, GripHorizontal, Monitor, Move, Save, X } from 'lucide-react';
import * as api from '../services/api';
@@ -429,6 +430,7 @@ export default function Dashboard() {
return (
<div className="space-y-6">
+ <FirstRunCard />
<div className="flex flex-row items-center justify-between gap-2 sm:gap-4">
<h2 className="flex items-center gap-2.5 text-2xl font-bold text-white">
Dashboard
diff --git a/server/lib/validation.js b/server/lib/validation.js
index c046186b17..8216ff9118 100644
--- a/server/lib/validation.js
+++ b/server/lib/validation.js
@@ -1507,6 +1507,11 @@ export const locationSettingsSchema = z.object({
{ message: 'Provide both lat and lon, or neither.' },
);
+// Durable "don't show this again" for the dashboard first-run card (#5640).
+// Top-level general-settings boolean — same record as timezone/location, never
+// localStorage. Absent means show; only an explicit true suppresses.
+export const hideFirstRunCardSchema = z.boolean();
+
// Grok Imagegen settings slice (`imageGen.grok`) — the Grok Build CLI backend
// (#2859). No model/effort knobs: grok's image tools run on xAI's fixed image
// backend, so only the enable gate, binary path, default aspect ratio, and
diff --git a/server/routes/settings.js b/server/routes/settings.js
index 85859bf02d..11040f5c3f 100644
--- a/server/routes/settings.js
+++ b/server/routes/settings.js
@@ -20,7 +20,7 @@ import { asyncHandler } from '../lib/errorHandler.js';
import { isPlainObject } from '../lib/objects.js';
import { agentContextSettingsSchema } from '../lib/agentContextValidation.js';
import { EFFORT_LEVELS } from '../lib/providerModels.js';
-import { backupConfigSchema, sharingSettingsPatchSchema, featureProviderConfigSchema, autofixerSettingsSchema, codeReviewSettingsSchema, locationSettingsSchema, settingsEmbeddingsSchema, localLlmSettingsSchema, imessageConfigSchema, signalConfigSchema, spotifyConfigSchema, youtubeConfigSchema, apiAccessSettingsSchema, instanceFeatureSettingsSchema, instanceFeatureIdSchema, instanceFeatureUpdateSchema, loraTrainingConfigSchema, pipelineEditorialChecksSettingsSchema, creativeDirectorSettingsSchema, musicSettingsSchema, federationSettingsSchema, privacySettingsSchema, seriesAutopilotSettingsSchema, layeredIntelligenceSettingsSchema, imageGenGrokSettingsSchema, imageGenAgySettingsSchema, renderDefaultsSettingsSchema, videoGenSettingsSchema, subscriptionCostsMapSchema, usageApiBilledInstanceIdsSchema, validateRequest } from '../lib/validation.js';
+import { backupConfigSchema, sharingSettingsPatchSchema, featureProviderConfigSchema, autofixerSettingsSchema, codeReviewSettingsSchema, locationSettingsSchema, hideFirstRunCardSchema, settingsEmbeddingsSchema, localLlmSettingsSchema, imessageConfigSchema, signalConfigSchema, spotifyConfigSchema, youtubeConfigSchema, apiAccessSettingsSchema, instanceFeatureSettingsSchema, instanceFeatureIdSchema, instanceFeatureUpdateSchema, loraTrainingConfigSchema, pipelineEditorialChecksSettingsSchema, creativeDirectorSettingsSchema, musicSettingsSchema, federationSettingsSchema, privacySettingsSchema, seriesAutopilotSettingsSchema, layeredIntelligenceSettingsSchema, imageGenGrokSettingsSchema, imageGenAgySettingsSchema, renderDefaultsSettingsSchema, videoGenSettingsSchema, subscriptionCostsMapSchema, usageApiBilledInstanceIdsSchema, validateRequest } from '../lib/validation.js';
const router = Router();
@@ -272,6 +272,9 @@ router.put('/', asyncHandler(async (req, res) => {
if (req.body?.location !== undefined) {
validateRequest(locationSettingsSchema, req.body.location);
}
+ if (req.body?.hideFirstRunCard !== undefined) {
+ validateRequest(hideFirstRunCardSchema, req.body.hideFirstRunCard);
+ }
if (req.body?.embeddings !== undefined) {
validateRequest(settingsEmbeddingsSchema.partial(), req.body.embeddings);
}
diff --git a/server/routes/settings.test.js b/server/routes/settings.test.js
index c34786287c..d07b6b5c73 100644
--- a/server/routes/settings.test.js
+++ b/server/routes/settings.test.js
@@ -681,3 +681,23 @@ describe('Settings routes — credential inventory', () => {
expect(JSON.stringify(res.body)).not.toMatch(/hf_|sk-|ghp_/);
});
});
+
+describe('Settings routes — hideFirstRunCard (#5640)', () => {
+ beforeEach(() => {
+ store = {};
+ vi.clearAllMocks();
+ });
+
+ it('accepts a boolean durable suppress on the general settings record', async () => {
+ const res = await request(buildApp()).put('/api/settings').send({ hideFirstRunCard: true });
+ expect(res.status).toBe(200);
+ expect(res.body.hideFirstRunCard).toBe(true);
+ });
+
+ it('rejects a non-boolean hideFirstRunCard', async () => {
+ const res = await request(buildApp()).put('/api/settings').send({ hideFirstRunCard: 'yes' });
+ expect(res.status).toBe(400);
+ expect(res.body.code).toBe('VALIDATION_ERROR');
+ });
+});
+