Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
feat(action-center): list Getting started's steps in the Actions page (#1235)
Cihan7a73500aee2d
diff --git a/web/messages/en.json b/web/messages/en.jsonindex 75bba19e6..957aa95fb 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -1385,6 +1385,112 @@}}},+ "gettingStarted": {+ "category": "Getting started",+ "card": {+ "title": "Getting started",+ "value": "{done} / {total}",+ "sub": "steps done · at your own pace"+ },+ "firstSignals": "Start with your first signals",+ "note": "AI actions start here as soon as your first signals appear. Usually within a few days.",+ "table": {+ "stage": "Stage",+ "ready": "Ready"+ },+ "stages": {+ "setup": "Set up",+ "explore": "Explore",+ "act": "Act",+ "ready": "Ready"+ },+ "status": {+ "new": "New",+ "done": "Done",+ "waiting": "Waiting for data",+ "skipped": "Skipped"+ },+ "optional": "Optional",+ "everyone": "Everyone in the workspace",+ "readyWhen": {+ "setup": "Now",+ "explore": "First answers · ~3h",+ "dataPrompts": "24h after Search Console or Analytics",+ "act": "Suggestions · ~24h",+ "ready": "After the steps above"+ },+ "opensWhenReady": "Opens when its data is ready: {when}",+ "steps": {+ "kpis": {+ "title": "Set your KPIs",+ "summary": "Pick 3–5 goals. We track them for you."+ },+ "competitors": {+ "title": "Add at least 3 competitors",+ "summary": "Works best with 5–20 competitors."+ },+ "topics": {+ "title": "Add at least 3 topics",+ "summary": "Pick from topic suggestions."+ },+ "prompts": {+ "title": "Add 3 prompts per topic",+ "summary": "Pick from prompt suggestions."+ },+ "gsc": {+ "title": "Connect Google Search Console",+ "summary": "Strongly recommended."+ },+ "ga": {+ "title": "Connect Google Analytics",+ "summary": "See which AI visits engage and convert."+ },+ "snippet": {+ "title": "Add the AI Traffic snippet",+ "summary": "One line in your site’s head."+ },+ "visibility": {+ "title": "See where you stand in Visibility",+ "summary": "Your share of AI answers vs competitors."+ },+ "answers": {+ "title": "Read your first AI answers",+ "summary": "Answers and follow-up searches, per prompt."+ },+ "data_prompts": {+ "title": "Track high-value prompt suggestions",+ "summary": "Built from your Search Console and Analytics data."+ },+ "mentions": {+ "title": "Check what AI says about you",+ "summary": "Mentions and tone."+ },+ "citations": {+ "title": "See who AI quotes",+ "summary": "The pages and sites AI uses as sources."+ },+ "traffic": {+ "title": "See visits from AI",+ "summary": "Which platforms send visitors, to which pages."+ },+ "pick_content": {+ "title": "Pick content from suggestions",+ "summary": "Choose 1–3 suggestions."+ },+ "create_content": {+ "title": "Create your first content",+ "summary": "Draft in your brand voice, then publish."+ },+ "optimize_page": {+ "title": "Optimize a page",+ "summary": "Audit a page, then apply its fixes."+ },+ "ready": {+ "title": "You’re ready",+ "summary": "AI actions start appearing here."+ }+ }+ },"actionTexts": {"recover_visibility": {"title": "Recover visibility across {targets}",diff --git a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsxindex e56d0393d..95d0221a4 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx@@ -3,10 +3,17 @@ import { createRoot, type Root } from 'react-dom/client';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import type { Brand } from '@/types';import type { ActionItem } from '@/lib/actions/action-center';+import {+ buildGettingStarted,+ type GettingStartedFacts,+ type GettingStartedStatus,+} from '@/lib/getting-started/steps';/*** The actions list's Export CSV (AC-005): it reads what each listed action's* Affected tab names, then downloads the list with it, as UTF-8 Excel reads.+ * And Getting started (AC-ALT2 §4): its steps open the page while a brand+ * runs it, and the page is unchanged for a brand that doesn't.*/(@@ -50,10 +57,12 @@ const action: ActionItem = {priorityReason: null,};-const { getActionsAffected, saveBlob, toast } = vi.hoisted(() => ({+const { getActions, getActionsAffected, getGettingStarted, saveBlob, toast } = vi.hoisted(() => ({+ getActions: vi.fn(),getActionsAffected: vi.fn(),+ getGettingStarted: vi.fn(),saveBlob: vi.fn(),- toast: { error: vi.fn(), success: vi.fn() },+ toast: Object.assign(vi.fn(), { error: vi.fn(), success: vi.fn() }),}));vi.mock('next-intl', () => ({@@ -63,16 +72,20 @@ vi.mock('@/stores/use-brand-store', () => ({useBrandStore: (selector: (state: { getActiveBrand: () => Brand }) => unknown) =>selector({ getActiveBrand: () => brand }),}));-vi.mock('@/lib/actions/action-center', () => ({- getActions: vi.fn(async () => [action]),- getActionsAffected,-}));+vi.mock('@/lib/actions/action-center', () => ({ getActions, getActionsAffected }));+vi.mock('@/lib/actions/getting-started', () => ({ getGettingStarted }));vi.mock('@/lib/actions/team', () => ({ listMembers: vi.fn(async () => []) }));vi.mock('@/lib/download', () => ({ saveBlob }));vi.mock('sonner', () => ({ toast }));vi.mock('@/components/action-center/action-center-tabs', () => ({ ActionCenterTabs: () => null }));vi.mock('@/components/action-center/action-table', () => ({ ActionTable: () => null }));vi.mock('@/components/action-center/action-drawer', () => ({ ActionDrawer: () => null }));+vi.mock('@/components/getting-started/getting-started-table', () => ({+ GettingStartedTable: ({ steps, showNote }: { steps: unknown[]; showNote: boolean }) => (+ <div data-testid="steps">{`${steps.length} steps${showNote ? ', with the note' : ''}`}</div>+ ),+ readyWhenKey: () => 'setup',+}));const { default: ActionCenterActionsPage } = await import('./page');@@ -87,6 +100,9 @@ async function render() {}beforeEach(() => {+ window.history.replaceState(null, '', '/');+ getActions.mockReset().mockResolvedValue([action]);+ getGettingStarted.mockReset().mockResolvedValue(null);container = document.createElement('div');document.body.append(container);root = createRoot(container);@@ -147,3 +163,84 @@ describe('the actions list Export CSV', () => {root = createRoot(container);});});++const started = (over: Partial<GettingStartedFacts> = {}): GettingStartedStatus =>+ buildGettingStarted({+ startedAt: '2026-10-20T10:00:00Z',+ dismissedAt: null,+ records: {},+ recordedAt: {},+ kpiSetupAt: null,+ competitors: 1,+ topicPrompts: [],+ gsc: false,+ ga: false,+ firstAnswer: false,+ firstVisit: false,+ dataSuggestions: 0,+ dataTracked: 0,+ contentSuggestions: 0,+ contentPicked: 0,+ contentCreated: 0,+ audits: 0,+ ...over,+ });++const steps = () => container.querySelector('[data-testid="steps"]');+const text = () => container.textContent ?? '';++describe('Getting started in the actions list', () => {+ it("leaves the page as it is for a brand that doesn't run it", async () => {+ getGettingStarted.mockResolvedValue(started({ startedAt: null }));+ await render();++ expect(steps()).toBeNull();+ expect(text()).not.toContain('card.title');+ expect(text()).toContain('cards.priority');+ expect(exportButton()).toBeDefined();+ });++ it('opens on its steps for a new brand, the ranking cards waiting for the first signals', async () => {+ getActions.mockResolvedValue([]);+ getGettingStarted.mockResolvedValue(started());+ await render();++ expect(steps()?.textContent).toBe('17 steps, with the note');+ expect(text()).toContain('card.title');+ expect(text().match(/firstSignals/g)).toHaveLength(3);+ // Getting started takes Highest Priority's place; the filters are for actions.+ expect(text()).not.toContain('cards.priority');+ expect(exportButton()).toBeUndefined();+ });++ // gkhngyk on #1235: Create action, a signal and the history drawer link to+ // ?action=<id>; on a new brand the drawer opened over the steps.+ it('lists the actions for a link to one action, or to a filtered list', async () => {+ for (const search of ['?action=a1', '?status=new', '?q=coffee']) {+ window.history.replaceState(null, '', `/${search}`);+ getGettingStarted.mockResolvedValue(started());+ await render();+ expect(steps(), search).toBeNull();+ act(() => root.unmount());+ root = createRoot(container);+ }+ });++ it('keeps a category the URL names, and lists the actions', async () => {+ window.history.replaceState(null, '', '/?category=all');+ getGettingStarted.mockResolvedValue(started());+ await render();++ expect(steps()).toBeNull();+ expect(text()).toContain('card.title');+ expect(exportButton()).toBeDefined();+ });++ it('reads as before when Getting started cannot be read', async () => {+ getGettingStarted.mockRejectedValue(new Error('offline'));+ await render();++ expect(steps()).toBeNull();+ expect(text()).toContain('cards.priority');+ });+});diff --git a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsxindex 5d8a744af..c6a9d9498 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx@@ -27,6 +27,8 @@ import {type ActionItem,} from '@/lib/actions/action-center';import { listMembers, type TeamMember } from '@/lib/actions/team';+import { getGettingStarted } from '@/lib/actions/getting-started';+import type { GettingStartedStatus, GettingStartedStep } from '@/lib/getting-started/steps';import { readUrlChoice, readUrlParam, writeUrlParams } from '@/lib/url-state';import {ACTION_CATEGORIES,@@ -53,6 +55,11 @@ import {import { ActionCenterTabs } from '@/components/action-center/action-center-tabs';import { ActionTable } from '@/components/action-center/action-table';import { ActionDrawer } from '@/components/action-center/action-drawer';+import {+ GettingStartedTable,+ readyWhenKey,+} from '@/components/getting-started/getting-started-table';+import { GettingStartedSummaryCard } from '@/components/getting-started/summary-card';import { Button } from '@/components/ui/button';import { Card, CardContent } from '@/components/ui/card';import { Input } from '@/components/ui/input';@@ -89,6 +96,16 @@ const CARD_FILTERS = {/** Top Actions is the five highest-priority open actions (AC-006), not a predicate. */type CardFocus = keyof typeof CARD_FILTERS | 'top';+/**+ * Getting started (AC-ALT2 §4) is a category of its own while a brand runs+ * it: its steps, not generated actions, so it lists them in its own table.+ */+const GETTING_STARTED = 'getting_started';+type CategoryChoice = ActionCategory | 'all' | typeof GETTING_STARTED;++/** URL params that ask for the actions themselves, not Getting started. */+const ACTIONS_PARAMS = ['category', 'action', 'priority', 'status', 'assignee', 'q', 'sort'];+export default function ActionCenterActionsPage() {const brand = useBrandStore((s) => s.getActiveBrand());const t = useTranslations('actionCenter.actionsPage');@@ -117,13 +134,17 @@ function ActionsContent({ brand }: { brand: Brand }) {const common = useTranslations('common');const tTexts = useTranslations('actionCenter.actionTexts');const tCategories = useTranslations('actionCenter.actionCategories');+ const tStarted = useTranslations('actionCenter.gettingStarted');const [actions, setActions] = useState<ActionItem[] | null>(null);+ // Null for a brand that doesn't run Getting started, or when it can't be+ // read: the page is then exactly as without it.+ const [gettingStarted, setGettingStarted] = useState<GettingStartedStatus | null>(null);const [members, setMembers] = useState<TeamMember[]>([]);const [isLoading, setIsLoading] = useState(true);const [loadFailed, setLoadFailed] = useState(false);- const [category, setCategory] = useState<ActionCategory | 'all'>('all');+ const [category, setCategory] = useState<CategoryChoice>('all');const [priority, setPriority] = useState<PriorityLevel | 'all'>('all');const [status, setStatus] = useState<ActionStatus | 'all'>('all');const [assignee, setAssignee] = useState<string>('all');@@ -147,9 +168,18 @@ function ActionsContent({ brand }: { brand: Brand }) {// Filters, sort and search live in the URL (#896) so a refresh keeps them// and a filtered view can be shared. Read after mount; defaults stay out.const [urlRead, setUrlRead] = useState(false);+ // A category from the URL is kept, and so is a link to an action or a+ // filtered list (Create action, a signal, the history drawer, an export):+ // the actions were asked for. Without any, Getting started opens first.+ const categoryChosen = useRef(false);useEffect(() => {+ categoryChosen.current = ACTIONS_PARAMS.some((name) => readUrlParam(name) !== '');setCategory(- readUrlChoice<ActionCategory | 'all'>('category', ['all', ...ACTION_CATEGORIES], 'all'),+ readUrlChoice<CategoryChoice>(+ 'category',+ ['all', ...ACTION_CATEGORIES, GETTING_STARTED],+ 'all',+ ),);setPriority(readUrlChoice<PriorityLevel | 'all'>('priority', ['all', ...PRIORITY_LEVELS], 'all'),@@ -192,7 +222,13 @@ function ActionsContent({ brand }: { brand: Brand }) {const load = useCallback(async () => {setLoadFailed(false);try {- setActions(await getActions(brand.id));+ // Together, so the page doesn't show its empty state and then the steps.+ const [list, started] = await Promise.all([+ getActions(brand.id),+ getGettingStarted(brand.id).catch(() => null),+ ]);+ setActions(list);+ if (started) setGettingStarted(started);} catch {setLoadFailed(true);} finally {@@ -200,6 +236,56 @@ function ActionsContent({ brand }: { brand: Brand }) {}}, [brand.id]);+ const startedActive = gettingStarted?.active ?? false;++ // Getting started opens first while it runs, unless the URL named a category.+ useEffect(() => {+ if (!urlRead || !gettingStarted || categoryChosen.current) return;+ categoryChosen.current = true;+ if (gettingStarted.active) setCategory(GETTING_STARTED);+ }, [urlRead, gettingStarted]);+ useEffect(() => {+ if (gettingStarted && !gettingStarted.active && category === GETTING_STARTED) {+ setCategory('all');+ }+ }, [gettingStarted, category]);++ // A step is done in another tab (its page opens in one): read the steps+ // again when this tab is back in front.+ useEffect(() => {+ if (!startedActive) return;+ // focus and visibilitychange both fire on the way back: read once.+ let last = 0;+ const refresh = () => {+ if (document.visibilityState !== 'visible' || Date.now() - last < 1_000) return;+ last = Date.now();+ getGettingStarted(brand.id)+ .then((started) => {+ if (started && mounted.current) setGettingStarted(started);+ })+ .catch(() => {});+ };+ window.addEventListener('focus', refresh);+ document.addEventListener('visibilitychange', refresh);+ return () => {+ window.removeEventListener('focus', refresh);+ document.removeEventListener('visibilitychange', refresh);+ };+ }, [startedActive, brand.id]);++ const openStep = (step: GettingStartedStep) => {+ if (step.state === 'waiting') {+ toast(tStarted('opensWhenReady', { when: tStarted(`readyWhen.${readyWhenKey(step)}`) }));+ return;+ }+ // The last step points at the actions themselves.+ if (step.key === 'ready') {+ setCategory('all');+ return;+ }+ window.open(step.href, '_blank', 'noopener');+ };+// A change made in the drawer, shown in its row at once: reading the whole// list again after each one held the drawer for seconds.const patchAction = useCallback((id: string, patch: Partial<ActionItem>) => {@@ -270,7 +356,9 @@ function ActionsContent({ brand }: { brand: Brand }) {const filtered = (actions ?? []).filter((action) => {if (focus === 'top' ? !topIds.has(action.id) : focus && !CARD_FILTERS[focus](action))return false;- if (category !== 'all' && action.category !== category) return false;+ // Getting started's steps aren't actions: with its table not shown, all.+ if (category !== 'all' && category !== GETTING_STARTED && action.category !== category)+ return false;if (priority !== 'all' && action.priorityLevel !== priority) return false;if (status !== 'all' && action.status !== status) return false;if (assignee !== 'all') {@@ -409,7 +497,7 @@ function ActionsContent({ brand }: { brand: Brand }) {);}- if (!actions?.length) {+ if (!actions?.length && !startedActive) {return (<div className="flex flex-col items-center justify-center rounded-lg border border-dashed py-20 text-center"><ListChecks className="h-8 w-8 text-muted-foreground" />@@ -419,34 +507,51 @@ function ActionsContent({ brand }: { brand: Brand }) {);}+ const list = actions ?? [];+ const showSteps = startedActive && gettingStarted !== null && category === GETTING_STARTED;+ // Before the first signals, the cards that rank actions have nothing to say.+ const noActions = list.length === 0;+ const showStepsCategory = () => {+ setFocus(null);+ setCategory(GETTING_STARTED);+ };+ // A card filters the actions, so it leaves Getting started's table.+ const toggleFocus = (card: CardFocus) => {+ if (category === GETTING_STARTED) setCategory('all');+ setFocus(focus === card ? null : card);+ };+ const rankCard = (card: 'top' | 'atRisk' | 'opportunities', value: number, sub: string) =>+ noActions+ ? { value: '—', sub: tStarted('firstSignals'), dim: true }+ : { value, sub, isActive: focus === card, onClick: () => toggleFocus(card) };+return (<div className="space-y-4"><div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-5">+ {startedActive && gettingStarted && (+ <GettingStartedSummaryCard+ done={gettingStarted.done}+ total={gettingStarted.total}+ isActive={category === GETTING_STARTED}+ onClick={showStepsCategory}+ />+ )}{/* Each card toggles itself as the table's filter, so a count alwayshas a way back to the rows it came from. */}<SummaryCardicon={CircleDot}label={t('cards.top')}- value={summary.top}- sub={t('cards.topSub')}- isActive={focus === 'top'}- onClick={() => setFocus(focus === 'top' ? null : 'top')}+ {...rankCard('top', summary.top, t('cards.topSub'))}/><SummaryCardicon={Shield}label={t('cards.atRisk')}- value={summary.atRisk}- sub={t('cards.atRiskSub')}- isActive={focus === 'atRisk'}- onClick={() => setFocus(focus === 'atRisk' ? null : 'atRisk')}+ {...rankCard('atRisk', summary.atRisk, t('cards.atRiskSub'))}/><SummaryCardicon={Sparkles}label={t('cards.opportunities')}- value={summary.opportunities}- sub={t('cards.opportunitiesSub')}- isActive={focus === 'opportunities'}- onClick={() => setFocus(focus === 'opportunities' ? null : 'opportunities')}+ {...rankCard('opportunities', summary.opportunities, t('cards.opportunitiesSub'))}/><SummaryCardicon={ArrowUpDown}@@ -454,29 +559,40 @@ function ActionsContent({ brand }: { brand: Brand }) {value={summary.inProgress}sub={t('cards.inProgressSub')}isActive={focus === 'inProgress'}- onClick={() => setFocus(focus === 'inProgress' ? null : 'inProgress')}+ onClick={() => toggleFocus('inProgress')}/>- <Card>- <CardContent className="p-4">- <div className="flex items-center gap-2">- <div className="flex h-7 w-7 items-center justify-center rounded-md border bg-muted/40">- <TrendingUp className="h-3.5 w-3.5 text-muted-foreground" />+ {/* Getting started takes the fifth place while it runs. */}+ {!startedActive && (+ <Card>+ <CardContent className="p-4">+ <div className="flex items-center gap-2">+ <div className="flex h-7 w-7 items-center justify-center rounded-md border bg-muted/40">+ <TrendingUp className="h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <p className="text-xs font-medium text-muted-foreground">{t('cards.priority')}</p></div>- <p className="text-xs font-medium text-muted-foreground">{t('cards.priority')}</p>- </div>- <p className="mt-2 text-2xl font-bold">- {summary.highest ? t(`priority.levels.${summary.highest}`) : '—'}- </p>- <p className="mt-0.5 text-xs text-muted-foreground">{t('cards.prioritySub')}</p>- </CardContent>- </Card>+ <p className="mt-2 text-2xl font-bold">+ {summary.highest ? t(`priority.levels.${summary.highest}`) : '—'}+ </p>+ <p className="mt-0.5 text-xs text-muted-foreground">{t('cards.prioritySub')}</p>+ </CardContent>+ </Card>+ )}</div><div className="flex flex-wrap items-center justify-between gap-3"><div className="flex flex-wrap items-center gap-2">+ {startedActive && gettingStarted && (+ <CategoryPill+ label={tStarted('category')}+ count={gettingStarted.total}+ isActive={category === GETTING_STARTED}+ onClick={showStepsCategory}+ />+ )}<CategoryPilllabel={t('allActions')}- count={actions.length}+ count={list.length}isActive={category === 'all'}onClick={() => setCategory('all')}/>@@ -490,86 +606,99 @@ function ActionsContent({ brand }: { brand: Brand }) {/>))}</div>- <Select- value={sort}- onValueChange={(v) => setSort((v ?? 'priority') as ActionSort)}- items={ACTION_SORTS.map((key) => ({ value: key, label: t(`sort.${key}`) }))}- >- <SelectTrigger className="h-8 w-44 text-xs">- <span className="text-muted-foreground">{t('sort.label')}:</span>- <SelectValue />- </SelectTrigger>- <SelectContent>- {ACTION_SORTS.map((key) => (- <SelectItem key={key} value={key}>- {t(`sort.${key}`)}- </SelectItem>- ))}- </SelectContent>- </Select>+ {!showSteps && (+ <Select+ value={sort}+ onValueChange={(v) => setSort((v ?? 'priority') as ActionSort)}+ items={ACTION_SORTS.map((key) => ({ value: key, label: t(`sort.${key}`) }))}+ >+ <SelectTrigger className="h-8 w-44 text-xs">+ <span className="text-muted-foreground">{t('sort.label')}:</span>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {ACTION_SORTS.map((key) => (+ <SelectItem key={key} value={key}>+ {t(`sort.${key}`)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}</div>- <div className="flex flex-wrap items-center gap-2">- <FilterSelect- label={t('filters.priority')}- value={priority}- onChange={(v) => setPriority(v as PriorityLevel | 'all')}- options={PRIORITY_LEVELS.map((v) => ({ value: v, label: t(`priority.levels.${v}`) }))}- allLabel={t('filters.all')}- />- <FilterSelect- label={t('filters.status')}- value={status}- onChange={(v) => setStatus(v as ActionStatus | 'all')}- options={ACTION_STATUSES.map((v) => ({ value: v, label: t(`status.${v}`) }))}- allLabel={t('filters.all')}- />- <FilterSelect- label={t('filters.assignee')}- value={assignee}- onChange={setAssignee}- options={[- { value: 'unassigned', label: t('filters.unassigned') },- ...members.map((member) => ({- value: member.userId,- label: memberLabel(member),- })),- ]}- allLabel={t('filters.all')}- />- <div className="relative">- <Search className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />- <Input- value={search}- onChange={(e) => setSearch(e.target.value)}- placeholder={t('filters.search')}- className="h-8 w-56 pl-8 text-xs"+ {/* The filters, sort and export work on actions; Getting started's+ steps are a fixed list. */}+ {!showSteps && (+ <div className="flex flex-wrap items-center gap-2">+ <FilterSelect+ label={t('filters.priority')}+ value={priority}+ onChange={(v) => setPriority(v as PriorityLevel | 'all')}+ options={PRIORITY_LEVELS.map((v) => ({ value: v, label: t(`priority.levels.${v}`) }))}+ allLabel={t('filters.all')}/>- </div>- {hasActiveFilters && (- <Button variant="ghost" size="sm" className="text-xs" onClick={clearFilters}>- <X className="h-3.5 w-3.5" />- {t('filters.clear')}- </Button>- )}- <Button- type="button"- variant="outline"- size="sm"- className="ml-auto gap-2 text-xs"- onClick={handleExportCsv}- disabled={visible.length === 0 || isExporting}- >- {isExporting ? (- <Loader2 className="h-3.5 w-3.5 animate-spin" />- ) : (- <Download className="h-3.5 w-3.5" />+ <FilterSelect+ label={t('filters.status')}+ value={status}+ onChange={(v) => setStatus(v as ActionStatus | 'all')}+ options={ACTION_STATUSES.map((v) => ({ value: v, label: t(`status.${v}`) }))}+ allLabel={t('filters.all')}+ />+ <FilterSelect+ label={t('filters.assignee')}+ value={assignee}+ onChange={setAssignee}+ options={[+ { value: 'unassigned', label: t('filters.unassigned') },+ ...members.map((member) => ({+ value: member.userId,+ label: memberLabel(member),+ })),+ ]}+ allLabel={t('filters.all')}+ />+ <div className="relative">+ <Search className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />+ <Input+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder={t('filters.search')}+ className="h-8 w-56 pl-8 text-xs"+ />+ </div>+ {hasActiveFilters && (+ <Button variant="ghost" size="sm" className="text-xs" onClick={clearFilters}>+ <X className="h-3.5 w-3.5" />+ {t('filters.clear')}+ </Button>)}- {common('exportCsv')}- </Button>- </div>+ <Button+ type="button"+ variant="outline"+ size="sm"+ className="ml-auto gap-2 text-xs"+ onClick={handleExportCsv}+ disabled={visible.length === 0 || isExporting}+ >+ {isExporting ? (+ <Loader2 className="h-3.5 w-3.5 animate-spin" />+ ) : (+ <Download className="h-3.5 w-3.5" />+ )}+ {common('exportCsv')}+ </Button>+ </div>+ )}- {visible.length > 0 ? (+ {showSteps && gettingStarted ? (+ <GettingStartedTable+ steps={gettingStarted.steps}+ members={members}+ onSelect={openStep}+ showNote={noActions}+ />+ ) : visible.length > 0 ? (<ActionTableactions={visible}onSelect={(action) => selectAction(action.id)}@@ -608,14 +737,17 @@ function SummaryCard({sub,isActive,onClick,+ dim,}: {icon: React.ComponentType<{ className?: string }>;label: string;- value: number;+ value: number | string;sub: string;/** Omit both to render a card that only reports, like Highest Priority. */isActive?: boolean;onClick?: () => void;+ /** Faded: nothing to count yet. */+ dim?: boolean;}) {return (<Card@@ -636,7 +768,7 @@ function SummaryCard({isActive && 'border-foreground/60 bg-muted/40',),}- : {})}+ : { className: cn(dim && 'opacity-60') })}><CardContent className="p-4"><div className="flex items-center gap-2">diff --git a/web/src/components/getting-started/getting-started-table.tsx b/web/src/components/getting-started/getting-started-table.tsxnew file mode 100644index 000000000..16ccc944e--- /dev/null+++ b/web/src/components/getting-started/getting-started-table.tsx@@ -0,0 +1,241 @@+'use client';++import { useTranslations } from 'next-intl';+import {+ BarChart3,+ Check,+ Code,+ FileText,+ Flag,+ Gauge,+ Globe,+ LineChart,+ MessageCircleMore,+ Plug,+ Quote,+ Sparkles,+ Tag,+ Trophy,+} from 'lucide-react';+import { Badge } from '@/components/ui/badge';+import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/ui/table';+import { ACTION_STATUS_BADGE } from '@/components/action-center/action-table';+import { labelInitials, memberLabel } from '@/lib/action-center/display';+import { formatRelative } from '@/lib/format-relative';+import type { TeamMember } from '@/lib/actions/team';+import type {+ GettingStartedState,+ GettingStartedStep,+ GettingStartedStepKey,+} from '@/lib/getting-started/steps';+import { cn } from '@/lib/utils';++const STEP_ICONS: Record<GettingStartedStepKey, React.ComponentType<{ className?: string }>> = {+ kpis: Flag,+ competitors: Trophy,+ topics: Tag,+ prompts: Globe,+ gsc: Plug,+ ga: Plug,+ snippet: Code,+ visibility: BarChart3,+ answers: Globe,+ data_prompts: Globe,+ mentions: MessageCircleMore,+ citations: Quote,+ traffic: LineChart,+ pick_content: FileText,+ create_content: FileText,+ optimize_page: Gauge,+ ready: Sparkles,+};++/** The live action statuses' colours: New, Done (Completed), Skipped (On Hold). */+export const STEP_STATUS_BADGE: Record<GettingStartedState, string> = {+ new: ACTION_STATUS_BADGE.new,+ done: ACTION_STATUS_BADGE.completed,+ waiting: ACTION_STATUS_BADGE.dismissed,+ skipped: ACTION_STATUS_BADGE.on_hold,+};++/** Getting started's chip, in the New status's blue. */+export const GETTING_STARTED_CHIP =+ 'border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400';+const OPTIONAL_CHIP = ACTION_STATUS_BADGE.on_hold;++/** When a step's data is ready, as the Ready column says it. */+export function readyWhenKey(step: GettingStartedStep) {+ return step.key === 'data_prompts' ? 'dataPrompts' : step.stage;+}++export function StepStatusBadge({ state }: { state: GettingStartedState }) {+ const t = useTranslations('actionCenter.gettingStarted');+ return (+ <Badge variant="outline" className={STEP_STATUS_BADGE[state]}>+ <span aria-hidden="true" className="h-1.5 w-1.5 rounded-full bg-current opacity-70" />+ {t(`status.${state}`)}+ </Badge>+ );+}++/** Getting started is everyone's: the workspace's first members, then a count. */+function WorkspaceAvatars({ members }: { members: TeamMember[] }) {+ const t = useTranslations('actionCenter.gettingStarted');+ if (members.length === 0) return <span className="text-xs text-muted-foreground">—</span>;+ const shown = members.slice(0, 3);+ return (+ <div className="flex items-center" title={t('everyone')}>+ {shown.map((member) => (+ <Avatar key={member.userId} className="-ml-1.5 h-6 w-6 ring-2 ring-card first:ml-0">+ {member.avatarUrl && <AvatarImage src={member.avatarUrl} alt="" />}+ <AvatarFallback className="text-[10px]">+ {labelInitials(memberLabel(member)) || '?'}+ </AvatarFallback>+ </Avatar>+ ))}+ {members.length > shown.length && (+ <span className="ml-1 text-[10px] text-muted-foreground">+ +{members.length - shown.length}+ </span>+ )}+ </div>+ );+}++export function GettingStartedTable({+ steps,+ members,+ onSelect,+ showNote,+}: {+ steps: GettingStartedStep[];+ members: TeamMember[];+ onSelect: (step: GettingStartedStep) => void;+ /** Says where the AI actions will appear, while there are none yet. */+ showNote: boolean;+}) {+ const t = useTranslations('actionCenter.gettingStarted');+ const tPage = useTranslations('actionCenter.actionsPage');+ const tCommon = useTranslations('common');++ return (+ <div className="overflow-x-auto rounded-lg border bg-card">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead className="text-xs">{tPage('table.action')}</TableHead>+ <TableHead className="text-xs">{t('table.stage')}</TableHead>+ <TableHead className="text-xs">{tPage('table.status')}</TableHead>+ <TableHead className="text-xs">{tPage('table.assignee')}</TableHead>+ <TableHead className="text-xs">{t('table.ready')}</TableHead>+ <TableHead className="text-xs">{tPage('table.updated')}</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {steps.map((step) => {+ const Icon = STEP_ICONS[step.key];+ const waiting = step.state === 'waiting';+ const done = step.state === 'done';+ return (+ <TableRow+ key={step.key}+ className={waiting ? 'cursor-default' : 'cursor-pointer'}+ onClick={() => onSelect(step)}+ >+ <TableCell className="max-w-[380px]">+ <div className="flex items-start gap-3">+ <div+ className={cn(+ 'mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-muted/40',+ done && ACTION_STATUS_BADGE.completed,+ )}+ >+ {done ? (+ <Check className="h-4 w-4" />+ ) : (+ <Icon className="h-4 w-4 text-muted-foreground" />+ )}+ </div>+ <div className="min-w-0">+ <p+ className={cn(+ 'truncate text-sm font-medium',+ (waiting || done) && 'text-muted-foreground',+ )}+ >+ {t(`steps.${step.key}.title`)}+ </p>+ <p className="truncate text-xs text-muted-foreground">+ {t(`steps.${step.key}.summary`)}+ </p>+ <div className="mt-1 flex flex-wrap gap-1">+ <Badge+ variant="outline"+ className={cn('text-[10px]', GETTING_STARTED_CHIP)}+ >+ {t('category')}+ </Badge>+ <Badge variant="outline" className="text-[10px]">+ {t(`stages.${step.stage}`)}+ </Badge>+ {step.optional && (+ <Badge variant="outline" className={cn('text-[10px]', OPTIONAL_CHIP)}>+ {t('optional')}+ </Badge>+ )}+ </div>+ </div>+ </div>+ </TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {t(`stages.${step.stage}`)}+ </TableCell>+ <TableCell>+ <StepStatusBadge state={step.state} />+ {step.progress && (+ <div className="mt-1.5 w-24">+ <p className="text-[10px] tabular-nums text-muted-foreground">+ {step.progress.value}/{step.progress.target}+ </p>+ <div className="mt-0.5 h-1 w-full overflow-hidden rounded-full bg-muted">+ <div+ className="h-full rounded-full bg-foreground/60"+ style={{+ width: `${Math.round((step.progress.value / step.progress.target) * 100)}%`,+ }}+ />+ </div>+ </div>+ )}+ </TableCell>+ <TableCell>+ <WorkspaceAvatars members={members} />+ </TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {t(`readyWhen.${readyWhenKey(step)}`)}+ </TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {step.updatedAt ? formatRelative(step.updatedAt, tCommon) : '—'}+ </TableCell>+ </TableRow>+ );+ })}+ </TableBody>+ </Table>+ {showNote && (+ <div className="flex items-center gap-3 border-t border-dashed bg-muted/20 px-4 py-3 text-xs text-muted-foreground">+ <Sparkles className="h-4 w-4 shrink-0" />+ <span>{t('note')}</span>+ </div>+ )}+ </div>+ );+}diff --git a/web/src/components/getting-started/summary-card.tsx b/web/src/components/getting-started/summary-card.tsxnew file mode 100644index 000000000..2e9d4e76c--- /dev/null+++ b/web/src/components/getting-started/summary-card.tsx@@ -0,0 +1,60 @@+'use client';++import { useTranslations } from 'next-intl';+import { Flag } from 'lucide-react';+import { Card, CardContent } from '@/components/ui/card';+import { cn } from '@/lib/utils';++/**+ * The Actions page's first summary card while Getting started runs: steps+ * done out of all, and a bar. Like the other cards, it filters the table to+ * what it counts.+ */+export function GettingStartedSummaryCard({+ done,+ total,+ isActive,+ onClick,+}: {+ done: number;+ total: number;+ isActive: boolean;+ onClick: () => void;+}) {+ const t = useTranslations('actionCenter.gettingStarted');+ return (+ <Card+ role="button"+ tabIndex={0}+ aria-pressed={isActive}+ onClick={onClick}+ onKeyDown={(event) => {+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ onClick();+ }+ }}+ className={cn(+ 'cursor-pointer transition-colors hover:border-foreground/30',+ isActive && 'border-foreground/60 bg-muted/40',+ )}+ >+ <CardContent className="p-4">+ <div className="flex items-center gap-2">+ <div className="flex h-7 w-7 items-center justify-center rounded-md border bg-muted/40">+ <Flag className="h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <p className="text-xs font-medium text-muted-foreground">{t('card.title')}</p>+ </div>+ <p className="mt-2 text-2xl font-bold tabular-nums">{t('card.value', { done, total })}</p>+ <p className="mt-0.5 text-xs text-muted-foreground">{t('card.sub')}</p>+ <div className="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-muted">+ <div+ className="h-full rounded-full bg-foreground transition-[width]"+ style={{ width: `${total ? Math.round((done / total) * 100) : 0}%` }}+ />+ </div>+ </CardContent>+ </Card>+ );+}