Skip to content

Self-improving AI Employees for everyone

fix(home): one finish for the Welcome guide, New conversation ends a first day, and the onboarding gaps

trohitg3a8fd05b38b6
diff --git a/cli/tests/test_docs_paths_resolve.py b/cli/tests/test_docs_paths_resolve.py
index e5569ad1..c493dc7f 100644
--- a/cli/tests/test_docs_paths_resolve.py
+++ b/cli/tests/test_docs_paths_resolve.py
@@ -41,7 +41,6 @@ _PATH = re.compile(
_ILLUSTRATIVE = {
"server/nodes/search/acme_search.py",
"server/nodes/search/acme_search/__init__.py",
- "client/src/components/onboarding/steps/NewStep.tsx",
}
diff --git a/client/src/components/__tests__/CredentialsModal.test.tsx b/client/src/components/__tests__/CredentialsModal.test.tsx
index 0c004fbb..e6503a3a 100644
--- a/client/src/components/__tests__/CredentialsModal.test.tsx
+++ b/client/src/components/__tests__/CredentialsModal.test.tsx
@@ -151,7 +151,7 @@ describe('shared credentials host', () => {
expect(ws.sendRequest.mock.calls.some(([type]) => type === 'get_stored_api_key')).toBe(false);
});
- it('keeps AI guidance and key links, and a refused save preserves the input and shows its reason', async () => {
+ it('opens on Connect an AI model with key links, and a refused save preserves the input and shows its reason', async () => {
mount({ categoryId: 'ai', intent: 'connect' }); await open();
expect(await screen.findByRole('dialog', { name: 'Connect an AI model' })).toBeVisible();
expect(screen.queryByRole('button', { name: 'Manage Telegram' })).not.toBeInTheDocument();
diff --git a/client/src/components/ui/ConsolePanel.tsx b/client/src/components/ui/ConsolePanel.tsx
index dcdf6876..ffdf3a69 100644
--- a/client/src/components/ui/ConsolePanel.tsx
+++ b/client/src/components/ui/ConsolePanel.tsx
@@ -145,7 +145,7 @@ const ConsolePanel: React.FC<ConsolePanelProps> = ({
const logsEndRef = useRef<HTMLDivElement>(null);
const chatRef = useRef<ChatPaneHandle>(null);
- // Focus the chat input when requested (onboarding handoff, checklist).
+ // Focus the chat input when requested (the toolbar's `focusChat`).
// Each request is consumed once so later manual panel toggles don't
// re-steal focus.
const chatFocusRequest = useAppStore((s) => s.chatFocusRequest);
diff --git a/client/src/features/home/__tests__/avatar.test.tsx b/client/src/features/home/__tests__/avatar.test.tsx
new file mode 100644
index 00000000..c079e69a
--- /dev/null
+++ b/client/src/features/home/__tests__/avatar.test.tsx
@@ -0,0 +1,21 @@
+/**
+ * The Avatar sizes the onboarding handoff added: 48px on a setup card's
+ * identity row (`card`) and 72px for a new hire arriving on their page
+ * (`xl`), each with the thicker ring and an initial to match.
+ */
+
+import { describe, expect, it } from 'vitest';
+import { render } from '@testing-library/react';
+import { Avatar } from '../ui/primitives';
+
+describe('Avatar', () => {
+ it.each([
+ ['card', ['size-12', 'border-2', 'text-lg']],
+ ['xl', ['size-18', 'border-2', 'text-headline']],
+ ] as const)('draws the %s size', (size, classes) => {
+ const { container } = render(<Avatar name="Maya" colorRole="agent" size={size} />);
+ const avatar = container.firstElementChild;
+ expect(avatar).toHaveClass(...classes);
+ expect(avatar).toHaveTextContent('M');
+ });
+});
diff --git a/client/src/features/home/__tests__/connectorsTab.test.tsx b/client/src/features/home/__tests__/connectorsTab.test.tsx
index f5464d67..516310a5 100644
--- a/client/src/features/home/__tests__/connectorsTab.test.tsx
+++ b/client/src/features/home/__tests__/connectorsTab.test.tsx
@@ -153,4 +153,18 @@ describe('ConnectorsTab', () => {
expect(screen.getByRole('img', { name: 'Verified' })).toBeInTheDocument();
expect(screen.queryByText('OpenAI')).not.toBeInTheDocument();
});
+
+ // The browser takes other words, an embedded size and no cap for the
+ // Welcome guide; Settings keeps the defaults.
+ it('keeps its own words, and shows the top eight on Discover until Show all', () => {
+ providers = Array.from({ length: 10 }, (_, i) => provider({ id: `app${i}`, name: `App ${i}`, kind: 'apiKey', consumer_category: 'messages' }));
+ render(ui());
+ expect(screen.getByRole('heading', { name: 'Connectors' })).toBeInTheDocument();
+ expect(screen.getByLabelText('Connectors to show')).toBeInTheDocument();
+ expect(screen.getByRole('textbox', { name: 'Search connectors' })).toBeInTheDocument();
+ expect(screen.getByText('Top connectors')).toBeInTheDocument();
+ expect(document.querySelectorAll('[data-catalog-item]')).toHaveLength(8);
+ fireEvent.click(screen.getByRole('button', { name: /Show all/ }));
+ expect(document.querySelectorAll('[data-catalog-item]')).toHaveLength(10);
+ });
});
diff --git a/client/src/features/home/__tests__/getStarted.test.tsx b/client/src/features/home/__tests__/getStarted.test.tsx
index b369059d..a27b57a7 100644
--- a/client/src/features/home/__tests__/getStarted.test.tsx
+++ b/client/src/features/home/__tests__/getStarted.test.tsx
@@ -132,6 +132,15 @@ describe('Get started on Home', () => {
expect(useHomeStore.getState().view).toEqual({ kind: 'employee', workflowId: 'w1' });
});
+ it('takes the owner to whoever has a draft waiting, for Approve a first draft', async () => {
+ const sam = { ...MAYA, workflow_id: 'w2', name: 'Sam', hired_at: '2026-10-08T10:00:00+00:00', pending_approvals: 1 };
+ server.employees = [MAYA, sam];
+ renderChecklist();
+ expect(await screen.findByText('Maya, Receptionist')).toBeInTheDocument();
+ fireEvent.click(step(/Approve a first draft/));
+ expect(useHomeStore.getState().view).toEqual({ kind: 'employee', workflowId: 'w2' });
+ });
+
it('latches Say hello once the owner has written to their first hire', async () => {
server.employees = [MAYA];
server.messages = [{ id: 1, role: 'user', message: 'Hi!', timestamp: '2026-10-08T09:05:00+00:00', run_key: 'g1' }];
diff --git a/client/src/features/home/__tests__/homeHeader.test.tsx b/client/src/features/home/__tests__/homeHeader.test.tsx
index 769776b2..98234250 100644
--- a/client/src/features/home/__tests__/homeHeader.test.tsx
+++ b/client/src/features/home/__tests__/homeHeader.test.tsx
@@ -77,15 +77,16 @@ describe('HomeHeader', () => {
expect(screen.queryByText('Ready')).not.toBeInTheDocument();
});
- it('starts a new conversation once the owner confirms', async () => {
+ it('starts a new conversation once the owner confirms, which ends a first day', async () => {
const user = userEvent.setup();
- useHomeStore.setState({ view: { kind: 'employee', workflowId: 'w1' } });
+ useHomeStore.setState({ view: { kind: 'employee', workflowId: 'w1' }, firstDays: { w1: { started: true, nodeCount: 6 } } });
wrap(<HomeHeader title="Maya" employee={maya} scrolled={false} />);
await user.click(screen.getByRole('button', { name: 'New conversation' }));
expect(await screen.findByRole('alertdialog')).toHaveTextContent('This clears the conversation, and Maya forgets it too.');
expect(sendRequest).not.toHaveBeenCalledWith('clear_chat_messages', expect.anything());
await user.click(screen.getByRole('button', { name: 'New conversation' }));
await waitFor(() => expect(sendRequest).toHaveBeenCalledWith('clear_chat_messages', { session_id: 'w1' }));
+ await waitFor(() => expect(useHomeStore.getState().firstDays).toEqual({}));
});
it('offers no new conversation without a talk line', () => {
diff --git a/client/src/features/home/__tests__/welcomeGuide.test.tsx b/client/src/features/home/__tests__/welcomeGuide.test.tsx
index 5140c270..a400f3c2 100644
--- a/client/src/features/home/__tests__/welcomeGuide.test.tsx
+++ b/client/src/features/home/__tests__/welcomeGuide.test.tsx
@@ -48,10 +48,12 @@ vi.mock('@/components/credentials/catalogue', async (importOriginal) => {
};
});
-// The draft pipeline has its own tests; here the guide only hands it a job.
+// The draft pipeline has its own tests (useSendJob sends
+// generate_employee_setup); here the guide only hands it a job.
vi.mock('../genui', async (importOriginal) => ({
...(await importOriginal<typeof import('../genui')>()),
useJobComposer: () => job,
+ useSendJob: () => job.submit,
}));
// A provider's panel (the key field) has its own tests.
vi.mock('@/components/credentials/PanelRenderer', () => ({ default: () => <p>The provider’s panel</p> }));
@@ -224,9 +226,40 @@ describe('WelcomeGuide steps', () => {
await waitFor(() => expect(saves()).toContainEqual({ onboarding_completed: true, onboarding_step: 1 }));
expect(useHomeStore.getState().guide.open).toBe(false);
});
+
+ it('saves the step reached when the owner skips it', async () => {
+ renderGuide();
+ fireEvent.click(await screen.findByRole('button', { name: 'Skip for now' }));
+ await waitFor(() => expect(saves()).toContainEqual({ onboarding_completed: true, onboarding_step: 0 }));
+ expect(useHomeStore.getState().guide.open).toBe(false);
+ });
+
+ it('closes with Esc at the step reached, after first leaving a provider’s page', async () => {
+ settingsRow = { onboarding_completed: false, onboarding_step: 1 };
+ renderGuide();
+ fireEvent.click(await screen.findByRole('button', { name: 'Connect openai' }));
+ fireEvent.keyDown(screen.getByRole('button', { name: 'All AI models' }), { key: 'Escape' });
+ expect(screen.queryByRole('heading', { name: 'Connect openai' })).not.toBeInTheDocument();
+ expect(useHomeStore.getState().guide.open).toBe(true);
+
+ fireEvent.keyDown(screen.getByRole('button', { name: 'Connect openai' }), { key: 'Escape' });
+ expect(useHomeStore.getState().guide.open).toBe(false);
+ await waitFor(() => expect(saves()).toContainEqual({ onboarding_completed: true, onboarding_step: 1 }));
+ });
});
describe('WelcomeGuide first hire', () => {
+ it('leaves the composer’s Create as the only way on', async () => {
+ settingsRow = { onboarding_completed: false, onboarding_step: 2 };
+ providers = [provider('openai', 'ai', true)];
+ renderGuide();
+ await screen.findByRole('heading', { name: 'Who should we hire first?' });
+ expect(screen.getByRole('button', { name: /Create their setup/ })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Back' })).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /Next/ })).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: 'I’ll do this later' })).not.toBeInTheDocument();
+ });
+
it('finishes the guide, shows the hire view and sends the job when there is a model', async () => {
settingsRow = { onboarding_completed: false, onboarding_step: 2 };
providers = [provider('openai', 'ai', true)];
diff --git a/client/src/features/home/data/schemas.ts b/client/src/features/home/data/schemas.ts
index 2436c8d8..908dc852 100644
--- a/client/src/features/home/data/schemas.ts
+++ b/client/src/features/home/data/schemas.ts
@@ -24,7 +24,8 @@ export const TASK_LABELS = ['Now', 'Next', 'Paused', 'Waiting'] as const;
export const TALK_STATES = ['on', 'off', 'unsupported'] as const;
/** How a hire's own start went: `saved` until it is tried, then `blocked`
- * (something to connect first), `running` or `failed`. */
+ * (something to connect first), `running` or `failed`. Only the hire's
+ * own reply says `starting` (it has just started them). */
export const ACTIVATION_STATES = ['saved', 'blocked', 'starting', 'running', 'failed'] as const;
export const appRefSchema = z.object({
diff --git a/client/src/features/home/genui/__tests__/useHireComposer.test.tsx b/client/src/features/home/genui/__tests__/useHireComposer.test.tsx
index 9ed29ee5..376f1d4c 100644
--- a/client/src/features/home/genui/__tests__/useHireComposer.test.tsx
+++ b/client/src/features/home/genui/__tests__/useHireComposer.test.tsx
@@ -24,7 +24,7 @@ import corpus from '../__fixtures__/replies.json';
import { useHomeStore } from '../../state/homeStore';
import { useShellDialogsStore } from '@/stores/shellDialogsStore';
import { resetDraftForTests, useDraftStore } from '../draftStore';
-import { useHireComposer, useJobComposer } from '../useHireComposer';
+import { useHireComposer, useJobComposer, useSendJob } from '../useHireComposer';
const GOOD_REPLY = (corpus as unknown as { name: string; reply: string }[]).find((c) => c.name === 'clean minified reply')!.reply;
@@ -111,3 +111,16 @@ describe('useJobComposer (the Welcome guide’s box)', () => {
expect(useShellDialogsStore.getState().credentialsOpen).toBe(false);
});
});
+
+describe('useSendJob (the Welcome guide’s finish)', () => {
+ it('sends what the box holds when called, as a new job', async () => {
+ sendRequest.mockResolvedValue({ success: true, reply: GOOD_REPLY });
+ const { result } = renderHook(() => useSendJob());
+ useDraftStore.setState({ input: 'Answer my WhatsApp', refining: true });
+ await act(async () => {
+ await result.current();
+ });
+ expect(sendRequest).toHaveBeenCalledWith('generate_employee_setup', expect.not.objectContaining({ refine: expect.anything() }), expect.any(Number));
+ expect(sendRequest.mock.calls[0][1]).toMatchObject({ job: 'Answer my WhatsApp' });
+ });
+});
diff --git a/client/src/features/home/genui/index.ts b/client/src/features/home/genui/index.ts
index 219d5127..a048d967 100644
--- a/client/src/features/home/genui/index.ts
+++ b/client/src/features/home/genui/index.ts
@@ -9,5 +9,5 @@
export { HIRE_LIMITS } from './hirePayload';
export { HireDraftPanel } from './HireDraftPanel';
export { MessagePreview as DraftMessagePreview } from './MessagePreview';
-export { useHireComposer, useJobComposer } from './useHireComposer';
+export { useHireComposer, useJobComposer, useSendJob } from './useHireComposer';
export { useStarterHire } from './useStarterHire';
diff --git a/client/src/features/home/genui/useHireComposer.ts b/client/src/features/home/genui/useHireComposer.ts
index 3e937de0..b82e3c78 100644
--- a/client/src/features/home/genui/useHireComposer.ts
+++ b/client/src/features/home/genui/useHireComposer.ts
@@ -14,6 +14,16 @@ import { useConnectors } from '../data/connectors';
import { useHomeStore } from '../state/homeStore';
import { useDraftActions, useDraftStore } from './draftStore';
+/**
+ * Send the box as a new job (never a change to the current draft). The box
+ * is read when sending, so a caller that only sends (the Welcome guide's
+ * finish) does not re-render as the job is typed.
+ */
+export function useSendJob() {
+ const actions = useDraftActions();
+ return useCallback(() => actions.submit(useDraftStore.getState().input, { refine: false }), [actions]);
+}
+
/**
* The job box alone, with no side effects: its text, whether a setup is
* being written, picking a starter's job, and sending a new job. The
@@ -36,8 +46,7 @@ export function useJobComposer() {
},
[actions],
),
- /** Send the box as a new job (never a change to the current draft). */
- submit: useCallback(() => actions.submit(useDraftStore.getState().input, { refine: false }), [actions]),
+ submit: useSendJob(),
};
}
diff --git a/client/src/features/home/header/NewConversationButton.tsx b/client/src/features/home/header/NewConversationButton.tsx
index 40ffb9b4..f9acea5a 100644
--- a/client/src/features/home/header/NewConversationButton.tsx
+++ b/client/src/features/home/header/NewConversationButton.tsx
@@ -1,7 +1,8 @@
/**
* New conversation, in the header of an employee's page (design handoff
* chat, "Header"). It clears the conversation and what the employee
- * remembers of it (`clear_chat_messages`), so it asks first.
+ * remembers of it (`clear_chat_messages`), so it asks first. A new hire's
+ * first day ends with it, as it does with their first message.
*/
import { SquarePen } from 'lucide-react';
@@ -19,6 +20,7 @@ import {
import { Button } from '@/components/ui/button';
import { useClearChat } from '@/features/chat';
import type { EmployeeSummary } from '../data/schemas';
+import { useHomeStore } from '../state/homeStore';
import { pillToast } from '../ui/pillToast';
export function NewConversationButton({ employee }: { employee: EmployeeSummary }) {
@@ -28,6 +30,7 @@ export function NewConversationButton({ employee }: { employee: EmployeeSummary
const start = () =>
clear.mutate(undefined, {
+ onSuccess: () => useHomeStore.getState().endFirstDay(employee.workflow_id),
onError: () => pillToast('That did not work. Try again.', { tone: 'error' }),
});
diff --git a/client/src/features/home/onboarding/WelcomeGuide.tsx b/client/src/features/home/onboarding/WelcomeGuide.tsx
index 85f79e28..00905610 100644
--- a/client/src/features/home/onboarding/WelcomeGuide.tsx
+++ b/client/src/features/home/onboarding/WelcomeGuide.tsx
@@ -105,10 +105,10 @@ export function WelcomeGuide() {
<WelcomeStep />
</TabsPrimitive.Content>
<TabsPrimitive.Content value="connect" className="outline-none">
- <ConnectStep onFinish={guide.complete} />
+ <ConnectStep onFinish={guide.finish} />
</TabsPrimitive.Content>
<TabsPrimitive.Content value="first-hire" className="outline-none">
- <FirstHireStep onDone={guide.complete} onNeedsModel={() => guide.goTo('connect')} />
+ <FirstHireStep onFinish={guide.finish} onNeedsModel={() => guide.goTo('connect')} />
</TabsPrimitive.Content>
</div>
<div className="flex items-center gap-2 border-t border-border-default bg-bg-panel px-6 py-3.5">
diff --git a/client/src/features/home/onboarding/steps/ConnectStep.tsx b/client/src/features/home/onboarding/steps/ConnectStep.tsx
index 68bfb699..429a589f 100644
--- a/client/src/features/home/onboarding/steps/ConnectStep.tsx
+++ b/client/src/features/home/onboarding/steps/ConnectStep.tsx
@@ -17,7 +17,6 @@ import { useEffect, useMemo, useRef } from 'react';
import { CredentialsBrowser, type CredentialsBrowserCopy } from '@/components/credentials/CredentialsBrowser';
import { ProviderPage } from '@/components/credentials/ProviderPage';
import { isConnected, useCredentialsCatalogue } from '../../data/connectors';
-import { useJobComposer } from '../../genui';
import { useHomeStore } from '../../state/homeStore';
import { pillToast } from '../../ui/pillToast';
@@ -36,7 +35,6 @@ export function ConnectStep({ onFinish }: { onFinish: () => void }) {
const connected = providers.some(isConnected);
const selection = useHomeStore((s) => s.guide.provider);
const setProvider = useHomeStore((s) => s.setGuideProvider);
- const job = useJobComposer();
// Back on the list: focus the card the page was opened from.
const shown = useRef<string | null>(null);
@@ -56,8 +54,6 @@ export function ConnectStep({ onFinish }: { onFinish: () => void }) {
const { guide } = useHomeStore.getState();
if (guide.pendingDraft) {
onFinish();
- useHomeStore.getState().showHire();
- void job.submit();
return;
}
if (guide.provider?.id === id && guide.provider.intent === 'connect') setProvider(null);
diff --git a/client/src/features/home/onboarding/steps/FirstHireStep.tsx b/client/src/features/home/onboarding/steps/FirstHireStep.tsx
index 1b5cad94..f835d959 100644
--- a/client/src/features/home/onboarding/steps/FirstHireStep.tsx
+++ b/client/src/features/home/onboarding/steps/FirstHireStep.tsx
@@ -16,7 +16,7 @@ import { TemplateChips } from '../../hire/TemplateChips';
import { HIRE_TEMPLATES } from '../../hire/templates';
import { useHomeStore } from '../../state/homeStore';
-export function FirstHireStep({ onDone, onNeedsModel }: { onDone: () => void; onNeedsModel: () => void }) {
+export function FirstHireStep({ onFinish, onNeedsModel }: { onFinish: () => void; onNeedsModel: () => void }) {
const job = useJobComposer();
const { connectedApps, hasAi, isLoading } = useConnectors();
const openSettings = useHomeStore((s) => s.openSettings);
@@ -35,9 +35,7 @@ export function FirstHireStep({ onDone, onNeedsModel }: { onDone: () => void; on
toConnect();
return;
}
- onDone();
- useHomeStore.getState().showHire();
- void job.submit();
+ onFinish();
};
return (
diff --git a/client/src/features/home/onboarding/useOnboarding.ts b/client/src/features/home/onboarding/useOnboarding.ts
index fd38d575..ae7bc1c1 100644
--- a/client/src/features/home/onboarding/useOnboarding.ts
+++ b/client/src/features/home/onboarding/useOnboarding.ts
@@ -19,6 +19,7 @@ import { useCallback, useEffect } from 'react';
import { useWebSocketActions } from '@/contexts/WebSocketContext';
import { useSaveUserSettingsMutationCore } from '@/hooks/useUserSettingsQuery';
import { useOwnerSettings } from '../data/profile';
+import { useSendJob } from '../genui';
import { GUIDE_STEPS, useHomeStore, type GuideStep } from '../state/homeStore';
export function useOnboarding() {
@@ -26,6 +27,7 @@ export function useOnboarding() {
const { data: settings, isSuccess } = useOwnerSettings();
const { sendRequest } = useWebSocketActions();
const { mutate: save } = useSaveUserSettingsMutationCore(sendRequest);
+ const sendJob = useSendJob();
useEffect(() => {
if (isSuccess && settings) useHomeStore.getState().checkGuide(settings);
@@ -39,7 +41,7 @@ export function useOnboarding() {
[save],
);
- const finish = useCallback(
+ const done = useCallback(
(step: number) => {
useHomeStore.getState().closeGuide();
save({ onboarding_completed: true, onboarding_step: step });
@@ -60,8 +62,13 @@ export function useOnboarding() {
/** Undefined on the first step. */
back: prevStep ? () => goTo(prevStep) : undefined,
/** Skip for now, the close button, Esc: done, at the step reached. */
- skip: () => finish(index),
- /** The guide's end: the owner asked for their first setup. */
- complete: () => finish(GUIDE_STEPS.length),
+ skip: () => done(index),
+ /** The guide's end, Create their setup: done, then Home's hire view
+ * writes the setup for the job in the box. */
+ finish: () => {
+ done(GUIDE_STEPS.length);
+ useHomeStore.getState().showHire();
+ void sendJob();
+ },
};
}
diff --git a/client/src/lib/pageActivity.ts b/client/src/lib/pageActivity.ts
index 00dd2e21..0b5af935 100644
--- a/client/src/lib/pageActivity.ts
+++ b/client/src/lib/pageActivity.ts
@@ -5,8 +5,8 @@
* pauses CSS keyframe animations while the tab is hidden or the window is
* blurred, but it cannot reach Web Animations started from script or
* requestAnimationFrame loops (the Home orb). Those subscribe here instead.
- * The app shell keeps this in sync with the same visibility / focus events
- * that toggle `data-page-hidden`.
+ * `App.tsx` keeps this in sync (`usePageActivitySync`) with the same
+ * visibility / focus events that toggle `data-page-hidden`.
*
* A plain module store: read it without re-rendering (`isActive()`), or
* subscribe for changes. Deliberately not React state.
diff --git a/client/src/test/README.md b/client/src/test/README.md
index 28ae614d..b6950b8d 100644
--- a/client/src/test/README.md
+++ b/client/src/test/README.md
@@ -6,26 +6,28 @@ Locks in the user-facing invariants from [docs-internal/ARCHIVE/credentials_pane
```bash
cd client
-npm install # picks up the new devDependencies
-npm run test # one-shot (vitest run)
-npm run test:watch # watch mode
-npm run test:coverage # with v8 coverage report
+bun run test # one-shot (vitest run)
+bun run test:watch # watch mode
+bun run test:coverage # with v8 coverage report
```
+Dependencies come from `bun install` at the repo root (the client is a workspace member).
+
## Layout
-51 test files live beside their subjects, almost all under `__tests__/` directories, across adapters/, assets/icons/, components/ (and its subfolders auth/, onboarding/, parameterPanel/, parameterPanel/canvas/, ui/), contexts/, hooks/, lib/, store/, stores/, types/, utils/. Targeted subsets: `npm run test:credentials`, `npm run test:nodepanels`.
+Test files live beside their subjects, almost all under `__tests__/` directories, across adapters/, app/, assets/icons/, components/, contexts/, features/ (chat/, home/), hooks/, lib/, store/, stores/, types/ and utils/. Targeted subsets: `bun run test:credentials`, `bun run test:nodepanels`.
## Tooling
- **Vitest** + **jsdom** for fast component tests
- **@testing-library/react** + **@testing-library/user-event** for behaviour assertions
- **builders.ts** for test-data factories — keep test bodies focused on deltas, not boilerplate
-- **setup.ts** stubs `matchMedia` / `ResizeObserver` / `IntersectionObserver` (jsdom doesn't ship them; antd needs them)
+- **setup.ts** stubs `matchMedia` / `ResizeObserver` / `IntersectionObserver` (jsdom doesn't ship them)
+- **waapi.ts** records Web Animations (`installWaapiStub()`) for tests that assert on motion; jsdom has no `Element.animate`
## What this suite does NOT test
-- Antd internals (Modal, Form, Input, Select)
+- The internals of the shadcn / Radix primitives
- `react-flow` rendering
- Backend handlers (covered by `server/tests/credentials/`)
- Full OAuth round-trip with real X / Google (no network)
diff --git a/docs-internal/frontend_architecture.md b/docs-internal/frontend_architecture.md
index d8014359..49e83f19 100644
--- a/docs-internal/frontend_architecture.md
+++ b/docs-internal/frontend_architecture.md
@@ -76,7 +76,9 @@ client/src/
│ # the message box, ReplyMarkdown
│
├── features/home/ # Normal mode (see docs-internal/normal_mode.md)
-│ ├── HomeShell.tsx # Sidebar + header + current view + Workspace dock + Settings + orb stage
+│ ├── HomeShell.tsx # Sidebar + header + current view + Workspace dock + Settings + orb stage,
+│ │ # plus the Welcome guide and the Get started checklist
+│ ├── onboarding/ # Welcome guide (3 steps) + Get started checklist (docs-internal/onboarding.md)
│ ├── sidebar/ header/ hire/ employee/ settings/ approvals/ data/ state/ ui/
│ ├── workspace/ # Home Workspace dock; shared live Browser tab, lazy Canvas tab
│ ├── genui/ # Setup-screen pipeline; only its index.ts is importable (ESLint)
@@ -109,7 +111,9 @@ client/src/
│ │
│ ├── credentials/ # EXEMPLAR SUBSYSTEM — see "Credentials" section below
│ │ ├── CredentialsModal.tsx # Shared app-level browser + provider dialogs
-│ │ ├── CredentialsBrowser.tsx # Connector cards; also embedded in Home Settings
+│ │ ├── CredentialsBrowser.tsx # Connector cards; also embedded in Home Settings and the Welcome guide
+│ │ ├── ProviderPage.tsx # One provider's page: back, key link, PanelRenderer (dialog + guide)
+│ │ ├── aiProviderLinks.ts # Where to get each AI provider's key
│ │ ├── catalogue.ts # Shared catalogue ordering + category visibility
│ │ ├── PanelRenderer.tsx # Lazy-loads panel by kind
│ │ ├── catalogueAdapter.ts # Server JSON -> ProviderConfig
@@ -397,8 +401,9 @@ components/credentials/catalogueAdapter.ts (hydrate JSON -> ProviderConfig)
│
▼
components/credentials/CredentialsModal.tsx (one AppShell host)
- ├─ CredentialsBrowser.tsx (shared cards, also embedded in Home Settings)
- └─ PanelRenderer.tsx (lazy: ApiKey/OAuth/QrPairing/Email/BrowserProfiles)
+ ├─ CredentialsBrowser.tsx (shared cards, also embedded in Home Settings and the Welcome guide)
+ └─ ProviderPage.tsx (one provider; the Welcome guide shows it inline)
+ └─ PanelRenderer.tsx (lazy: ApiKey/OAuth/QrPairing/Email/BrowserProfiles)
```
**State rules:**
diff --git a/docs-internal/normal_mode.md b/docs-internal/normal_mode.md
index 805fd3d9..c5a59d79 100644
--- a/docs-internal/normal_mode.md
+++ b/docs-internal/normal_mode.md
@@ -546,7 +546,7 @@ sending and drafts belong to the chat (wire and client rules in
set by `welcomeHire` from the response's `started` and `node_count`) shows
this in place of the empty conversation until the first message, and then
never again (a Reset that empties the thread later does not bring it back;
- a reload or deleting them ends it too). Their avatar turns a ring while
+ New conversation, a reload or deleting them ends it too). Their avatar turns a ring while
they start, then glows once with a ready pip; "{Name} joined your team".
The start-up card's rows follow what happened, never timers: Setup saved
and "Workflow built · N blocks" (the hire did both), then "{Name} is
diff --git a/docs-internal/onboarding.md b/docs-internal/onboarding.md
index 9d4a0b0d..a0fc76f1 100644
--- a/docs-internal/onboarding.md
+++ b/docs-internal/onboarding.md
@@ -38,7 +38,7 @@ The open state and the step live in `homeStore` (`guide: { open, step, furthest,
- **First launch.** When the settings query first succeeds it calls `checkGuide(settings)`, which runs once per session (`checked`). For an owner whose `onboarding_completed` is false it opens the guide at `GUIDE_STEPS[onboarding_step]`, or at Welcome when that index is not a step (rows saved by the old four-step wizard can hold 2 or 3). A finished owner never sees it unasked.
- **Moves.** `goTo(step)` (the nav, Next, Back, "I'll do this later") saves `{ onboarding_step }`.
-- **Finishing.** `skip()` (Skip for now, the close button, Esc, a click outside) saves `{ onboarding_completed: true, onboarding_step: <step reached> }`; `complete()` (the last step's Create) saves `onboarding_step: 3`. A replay never writes `onboarding_completed: false`.
+- **Finishing.** `skip()` (Skip for now, the close button, Esc, a click outside) saves `{ onboarding_completed: true, onboarding_step: <step reached> }`; `finish()` (the last step's Create, or a model connected while a job waits) saves `onboarding_step: 3`, shows the hire view and sends the job through genui's `useSendJob` (it reads the box when sending, so the guide does not re-render as the job is typed). A replay never writes `onboarding_completed: false`.
It reads and writes the settings through `useOwnerSettings` / `useSaveUserSettingsMutationCore` with the stable `useWebSocketActions()`, so Home never re-renders on a WebSocket message.
@@ -106,13 +106,13 @@ No onboarding-specific handlers. Progress rides the user settings handlers (`ser
## Tests
-- `features/home/__tests__/welcomeGuide.test.tsx`: opens at the saved step, Welcome for an out-of-range step, never for a finished owner, no reopen on remount; the nav's reachability; Next saves the step; Connect lists every AI model and no apps, "I'll do this later", "You're connected"; the provider page in place of the list, Back and Esc (focus returns to the card), the pill and the return to the list on connect; closing saves the step reached; the last step finishes and sends, or sends nothing without a model until one is connected, which finishes the guide.
+- `features/home/__tests__/welcomeGuide.test.tsx`: opens at the saved step, Welcome for an out-of-range step, never for a finished owner, no reopen on remount; the nav's reachability; Next saves the step; Connect lists every AI model and no apps, "I'll do this later", "You're connected"; the provider page in place of the list, Back and Esc (focus returns to the card), the pill and the return to the list on connect; closing, Skip and Esc save the step reached (Esc leaves a provider's page first); the last step's only way on is the composer's Create, which finishes and sends, or sends nothing without a model until one is connected, which finishes the guide.
- `features/home/__tests__/welcomeDemo.test.tsx` (fake timers): the job typed a character a tick, the beats in turn and round again, a click starting a beat, reduced motion holding the conversation with no bar.
- `features/home/__tests__/guideStore.test.ts`: `checkGuide`, `openGuide`, `goToGuideStep`, `closeGuide`, the provider page and the waiting job.
- `components/__tests__/CredentialsModal.test.tsx`: the dialog around the same `ProviderPage`.
-- `features/home/genui/__tests__/useHireComposer.test.tsx`: `useJobComposer` (no focus taken, a new job only, no dialog of its own).
+- `features/home/genui/__tests__/useHireComposer.test.tsx`: `useJobComposer` (no focus taken, a new job only, no dialog of its own) and `useSendJob` (sends `generate_employee_setup` with what the box holds).
- `composer.test.tsx` (`flat`, the idle label, chips without Hire now), `catalogLayout.test.tsx` (no cap, the list label), `homeHeader.test.tsx` (Guide), `homeSettings.test.tsx` (Help → Replay).
-- `features/home/__tests__/getStarted.test.tsx`: shown once the guide is finished and never over it, each step's click, what is done now, each latch written once (and not for a discarded draft), the folded pill, hiding with its toast.
+- `features/home/__tests__/getStarted.test.tsx`: shown once the guide is finished and never over it, each step's click (Approve a first draft opens whoever has one waiting), what is done now, each latch written once (and not for a discarded draft), the folded pill, hiding with its toast.
- Server: `tests/test_user_settings_contract.py` and `tests/services/test_getting_started_settings.py` (the latch columns, their migration and the getter).
## Key files
@@ -126,7 +126,7 @@ No onboarding-specific handlers. Progress rides the user settings handlers (`ser
| `client/src/components/credentials/ProviderPage.tsx` | One provider's page, shared by the guide and the credentials dialog |
| `client/src/components/credentials/aiProviderLinks.ts` | "Get a key from …" links for the featured AI providers |
| `client/src/components/catalog/CatalogLayout.tsx` | `variant`, `discoverLimit`, `listLabel` |
-| `client/src/features/home/genui/useHireComposer.ts` | `useJobComposer` |
+| `client/src/features/home/genui/useHireComposer.ts` | `useJobComposer`, `useSendJob` |
| `client/src/features/home/onboarding/useGetStarted.ts` | The checklist's steps and latches |
| `server/models/database.py` | `UserSettings.onboarding_completed`, `onboarding_step`, the `getting_started_*` flags |
| `server/core/database.py` | The migration that marks existing owners finished |
diff --git a/server/tests/services/test_getting_started_settings.py b/server/tests/services/test_getting_started_settings.py
index cf532cea..e10be61d 100644
--- a/server/tests/services/test_getting_started_settings.py
+++ b/server/tests/services/test_getting_started_settings.py
@@ -72,6 +72,25 @@ async def test_save_get_round_trip_returns_getting_started_keys(settings_databas
assert settings["getting_started_dismissed"] is False
+async def test_home_checklist_latches_round_trip_one_at_a_time(settings_database):
+ """Home's checklist saves Say hello and Approve a first draft on their
+ own; saving one keeps the other."""
+ assert await settings_database.save_user_settings(
+ {"getting_started_said_hello": True}, user_id="default"
+ )
+ settings = await settings_database.get_user_settings("default")
+ assert settings["getting_started_said_hello"] is True
+ assert settings["getting_started_approved_draft"] is False
+
+ assert await settings_database.save_user_settings(
+ {"getting_started_approved_draft": True}, user_id="default"
+ )
+ settings = await settings_database.get_user_settings("default")
+ assert settings["getting_started_said_hello"] is True
+ assert settings["getting_started_approved_draft"] is True
+
+
@pytest.mark.asyncio
async def test_migration_backfills_dismissed_for_completed_onboarding(settings_database):
# Simulate a pre-feature database: rows exist, new columns absent.