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): open the Content Plan's top rows from Getting started (#1329)
Cihan085bb5c50ab5
diff --git a/supabase/migrations/00234_getting_started_plan_steps.sql b/supabase/migrations/00234_getting_started_plan_steps.sqlnew file mode 100644index 000000000..ca200c1a1--- /dev/null+++ b/supabase/migrations/00234_getting_started_plan_steps.sql@@ -0,0 +1,133 @@+-- ============================================================================+-- 00234: Getting started's content steps open the Content Plan (AC-ALT2)+-- ============================================================================+-- The user's request: Getting started's "Create your first content" and+-- "Optimize a page" steps now open two items of the Content Plan (CE-014)+-- in New content's Start, the Plan's top Create row and its top Optimize+-- row, instead of Content Opportunities and Site Audit.+--+-- getting_started_facts (00197) counts what the Content Editor finished+-- too, so those steps complete there:+-- * drafts_created: the brand's "create" drafts made ready or published;+-- * drafts_optimized: its "optimize" drafts made ready or published.+-- Everything else is 00197's: the old ways to complete the steps (content+-- sent to the CMS or done, a page audited) still count, so a step already+-- done stays done.++create or replace function public.getting_started_facts(p_brand_id uuid)+returns jsonb+language sql+stable+security invoker+set search_path to 'public'+as $$+ select jsonb_build_object(+ 'started_at', gs.started_at,+ 'dismissed_at', gs.dismissed_at,+ 'confirmed_at', gs.confirmed_at,+ 'steps', coalesce((+ select jsonb_object_agg(s.step, jsonb_build_object('state', s.state, 'at', s.updated_at))+ from public.getting_started_steps s+ where s.brand_id = p_brand_id+ ), '{}'::jsonb),+ 'kpi_setup_at', b.kpi_setup_at,+ 'competitors', (+ select count(*) from public.competitors c where c.brand_id = p_brand_id+ ),+ -- Active prompts in each active topic, oldest topic first.+ 'topic_prompts', coalesce((+ select jsonb_agg(n.prompts order by t.created_at, t.id)+ from public.topics t+ cross join lateral (+ select count(*) as prompts+ from public.prompts p+ join public.prompt_sets ps on ps.id = p.prompt_set_id+ where p.topic_id = t.id+ and p.is_active+ and ps.brand_id = p_brand_id+ ) n+ where t.brand_id = p_brand_id+ and t.is_active+ ), '[]'::jsonb),+ -- Connected for the organization and mapped to a property for the brand,+ -- as Settings › Integrations shows it.+ 'gsc', nullif(b.gsc_property, '') is not null and exists (+ select 1 from public.integration_connections ic+ where ic.organization_id = b.organization_id+ and ic.provider = 'google-search-console'+ and ic.status = 'connected'+ ),+ 'ga', nullif(b.ga_property_id, '') is not null and exists (+ select 1 from public.integration_connections ic+ where ic.organization_id = b.organization_id+ and ic.provider = 'google-analytics'+ and ic.status = 'connected'+ ),+ 'first_answer', exists (+ select 1 from public.prompt_results r where r.brand_id = p_brand_id+ ),+ 'first_visit', exists (+ select 1 from public.ai_traffic_logs l where l.brand_id = p_brand_id+ ),+ -- Prompt suggestions built from Search Console and Analytics data.+ 'data_suggestions', (+ select count(*) from public.prompt_suggestions s+ where s.brand_id = p_brand_id and s.source in ('gsc', 'ga')+ ),+ 'data_tracked', (+ select count(*) from public.prompt_suggestions s+ where s.brand_id = p_brand_id and s.source in ('gsc', 'ga') and s.status = 'added'+ ),+ 'content_suggestions', (+ select count(*) from public.content_opportunities o where o.brand_id = p_brand_id+ ),+ -- Picked: reviewed, sent to the Action Center or given a brief (00106).+ 'content_picked', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (o.status in ('reviewed', 'sent', 'in_progress', 'done') or o.brief is not null)+ ),+ -- Created: its work was completed, or it went to the CMS webhook. There+ -- is no published state until the Content Editor.+ 'content_created', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (o.status = 'done' or o.webhook_sent_at is not null)+ ),+ -- Content in the last 30 days, the same way: for the existing-customer+ -- rule (no content in 30 days → offer Getting started).+ 'content_recent', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (+ o.webhook_sent_at >= now() - interval '30 days'+ or (o.status = 'done' and o.updated_at >= now() - interval '30 days')+ )+ ),+ -- Content Editor drafts (00204) made ready or published, by method: the+ -- create and optimize steps now open the Content Plan's rows (00234).+ 'drafts_created', (+ select count(*) from public.content_drafts d+ where d.brand_id = p_brand_id+ and d.method = 'create'+ and d.status in ('ready', 'published')+ ),+ 'drafts_optimized', (+ select count(*) from public.content_drafts d+ where d.brand_id = p_brand_id+ and d.method = 'optimize'+ and d.status in ('ready', 'published')+ ),+ -- Audits a person ran (not the automatic sweep, 00167) that finished.+ 'audits', (+ select count(*) from public.site_audits a+ where a.brand_id = p_brand_id and a.source = 'user' and a.status = 'completed'+ )+ )+ from public.brands b+ left join public.getting_started gs on gs.brand_id = b.id+ where b.id = p_brand_id;+$$;++revoke all on function public.getting_started_facts(uuid) from public, anon;+grant execute on function public.getting_started_facts(uuid) to authenticated;diff --git a/supabase/schema.sql b/supabase/schema.sqlindex ed0a1635d..41415a866 100644--- a/supabase/schema.sql+++ b/supabase/schema.sql@@ -34083,6 +34083,143 @@ grant execute on function public.prompt_visibility_summaries(uuid, timestamptz,comment on function public.prompt_visibility_summaries(uuid, timestamptz, timestamptz, text) is'Per-prompt visibility/mention aggregates for the All Prompts table. p_region scopes to one tracked location (#691); NULL blends every location. Planned with its arguments and read from idx_prompt_results_brand_created_metrics (00232); security definer, no rows when the caller is not a member of the brand''s organization.';+-- ─────────────────────────────────────────────────────────────────────────+-- migrations/00234_getting_started_plan_steps.sql+-- ─────────────────────────────────────────────────────────────────────────+-- ============================================================================+-- 00234: Getting started's content steps open the Content Plan (AC-ALT2)+-- ============================================================================+-- The user's request: Getting started's "Create your first content" and+-- "Optimize a page" steps now open two items of the Content Plan (CE-014)+-- in New content's Start, the Plan's top Create row and its top Optimize+-- row, instead of Content Opportunities and Site Audit.+--+-- getting_started_facts (00197) counts what the Content Editor finished+-- too, so those steps complete there:+-- * drafts_created: the brand's "create" drafts made ready or published;+-- * drafts_optimized: its "optimize" drafts made ready or published.+-- Everything else is 00197's: the old ways to complete the steps (content+-- sent to the CMS or done, a page audited) still count, so a step already+-- done stays done.++create or replace function public.getting_started_facts(p_brand_id uuid)+returns jsonb+language sql+stable+security invoker+set search_path to 'public'+as $$+ select jsonb_build_object(+ 'started_at', gs.started_at,+ 'dismissed_at', gs.dismissed_at,+ 'confirmed_at', gs.confirmed_at,+ 'steps', coalesce((+ select jsonb_object_agg(s.step, jsonb_build_object('state', s.state, 'at', s.updated_at))+ from public.getting_started_steps s+ where s.brand_id = p_brand_id+ ), '{}'::jsonb),+ 'kpi_setup_at', b.kpi_setup_at,+ 'competitors', (+ select count(*) from public.competitors c where c.brand_id = p_brand_id+ ),+ -- Active prompts in each active topic, oldest topic first.+ 'topic_prompts', coalesce((+ select jsonb_agg(n.prompts order by t.created_at, t.id)+ from public.topics t+ cross join lateral (+ select count(*) as prompts+ from public.prompts p+ join public.prompt_sets ps on ps.id = p.prompt_set_id+ where p.topic_id = t.id+ and p.is_active+ and ps.brand_id = p_brand_id+ ) n+ where t.brand_id = p_brand_id+ and t.is_active+ ), '[]'::jsonb),+ -- Connected for the organization and mapped to a property for the brand,+ -- as Settings › Integrations shows it.+ 'gsc', nullif(b.gsc_property, '') is not null and exists (+ select 1 from public.integration_connections ic+ where ic.organization_id = b.organization_id+ and ic.provider = 'google-search-console'+ and ic.status = 'connected'+ ),+ 'ga', nullif(b.ga_property_id, '') is not null and exists (+ select 1 from public.integration_connections ic+ where ic.organization_id = b.organization_id+ and ic.provider = 'google-analytics'+ and ic.status = 'connected'+ ),+ 'first_answer', exists (+ select 1 from public.prompt_results r where r.brand_id = p_brand_id+ ),+ 'first_visit', exists (+ select 1 from public.ai_traffic_logs l where l.brand_id = p_brand_id+ ),+ -- Prompt suggestions built from Search Console and Analytics data.+ 'data_suggestions', (+ select count(*) from public.prompt_suggestions s+ where s.brand_id = p_brand_id and s.source in ('gsc', 'ga')+ ),+ 'data_tracked', (+ select count(*) from public.prompt_suggestions s+ where s.brand_id = p_brand_id and s.source in ('gsc', 'ga') and s.status = 'added'+ ),+ 'content_suggestions', (+ select count(*) from public.content_opportunities o where o.brand_id = p_brand_id+ ),+ -- Picked: reviewed, sent to the Action Center or given a brief (00106).+ 'content_picked', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (o.status in ('reviewed', 'sent', 'in_progress', 'done') or o.brief is not null)+ ),+ -- Created: its work was completed, or it went to the CMS webhook. There+ -- is no published state until the Content Editor.+ 'content_created', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (o.status = 'done' or o.webhook_sent_at is not null)+ ),+ -- Content in the last 30 days, the same way: for the existing-customer+ -- rule (no content in 30 days → offer Getting started).+ 'content_recent', (+ select count(*) from public.content_opportunities o+ where o.brand_id = p_brand_id+ and (+ o.webhook_sent_at >= now() - interval '30 days'+ or (o.status = 'done' and o.updated_at >= now() - interval '30 days')+ )+ ),+ -- Content Editor drafts (00204) made ready or published, by method: the+ -- create and optimize steps now open the Content Plan's rows (00234).+ 'drafts_created', (+ select count(*) from public.content_drafts d+ where d.brand_id = p_brand_id+ and d.method = 'create'+ and d.status in ('ready', 'published')+ ),+ 'drafts_optimized', (+ select count(*) from public.content_drafts d+ where d.brand_id = p_brand_id+ and d.method = 'optimize'+ and d.status in ('ready', 'published')+ ),+ -- Audits a person ran (not the automatic sweep, 00167) that finished.+ 'audits', (+ select count(*) from public.site_audits a+ where a.brand_id = p_brand_id and a.source = 'user' and a.status = 'completed'+ )+ )+ from public.brands b+ left join public.getting_started gs on gs.brand_id = b.id+ where b.id = p_brand_id;+$$;++revoke all on function public.getting_started_facts(uuid) from public, anon;+grant execute on function public.getting_started_facts(uuid) to authenticated;+-- ─────────────────────────────────────────────────────────────────────────-- migrations/00235_service_write_policies_role.sql-- ─────────────────────────────────────────────────────────────────────────diff --git a/web/messages/en.json b/web/messages/en.jsonindex bcd5420d9..0441d0e3f 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -1613,23 +1613,27 @@},"create_content": {"title": "Create your first content",- "summary": "Draft in your brand voice, then publish.",- "open": "Open Content",- "doneWhen": "Sent to your CMS, or its action completed",+ "summary": "Start the new page your Content Plan ranks first.",+ "open": "Open the Plan",+ "doneWhen": "A new page marked ready or published, or sent to your CMS","why": ["Content is the main way to appear in more answers."],"how": [- "Open Content",- "Create a brief for one suggestion",- "Publish it: send it to your CMS, or complete its action"+ "Open the Plan: its top new page opens in Start",+ "Pick who writes it: you, the Content Agent or your team",+ "Mark it ready, then publish it"]},"optimize_page": {"title": "Optimize a page",- "summary": "Audit a page, then apply its fixes.",- "open": "Open Audit",- "doneWhen": "1 page audited",+ "summary": "Improve the page your Content Plan ranks first to optimize.",+ "open": "Open the Plan",+ "doneWhen": "An optimized page marked ready or published, or a page audited","why": ["Small fixes on pages AI already reads can win fast."],- "how": ["Open Audit", "Audit one page", "Apply the fixes it suggests"]+ "how": [+ "Open the Plan: its top page to optimize opens in Start",+ "Improve it in the editor, with its rules and sources",+ "Mark it ready, then publish it"+ ]},"ready": {"title": "You’re ready",@@ -1665,14 +1669,14 @@"failed": "Couldn’t skip the step. Try again."},"start": {- "button": "Start getting started",+ "button": "Get Started","hint": "For admins and managers · about 15 min","started": "{count, plural, =0 {Getting started is on} one {Getting started · # step already done} other {Getting started · # steps already done}}","failed": "Couldn’t start Getting started. Try again."},"skip": {- "button": "Skip getting started",- "title": "Skip getting started?",+ "button": "Skip Get Started",+ "title": "Skip Get Started?","body": "Your actions list goes back to normal. Steps you finished stay done.","later": "You can start again any time from the same button.","confirm": "Skip",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 e3fd6ea5b..fa9c7f7c7 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@@ -226,6 +226,8 @@ const started = (over: Partial<GettingStartedFacts> = {}): GettingStartedStatuscontentCreated: 0,contentRecent: 0,audits: 0,+ draftsCreated: 0,+ draftsOptimized: 0,...over,});diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsxindex 9c307f396..f5cee36d1 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsx@@ -39,12 +39,14 @@ vi.mock('@/components/content/new-content-dialog', () => ({return null;},}));+const push = vi.fn();vi.mock('@/i18n/navigation', () => ({Link: ({ href, children, ...props }: { href: string; children: React.ReactNode }) => (<a href={href} {...props}>{children}</a>),+ useRouter: () => ({ push }),}));const brandState = vi.hoisted(() => ({activeBrandId: 'brand-1' as string | null,@@ -160,6 +162,7 @@ beforeEach(() => {toast.mockReset();toast.error.mockReset();role.canManage = true;+ push.mockReset();dialog.props = null;});@@ -607,3 +610,48 @@ describe('a Plan row’s menu', () => {);});});++describe('Getting started’s content steps (00234)', () => {+ it('opens Start on the top Create row, on the Create card, once', async () => {+ window.history.replaceState(null, '', '/dashboard/content/plan?start=create');+ await renderPage();+ expect(dialog.props).toMatchObject({+ open: true,+ preset: { kind: 'opportunity', id: 'o1', page: null },+ });+ expect(button('Create').getAttribute('aria-pressed')).toBe('true');+ // A reload opens the plan as it is.+ expect(window.location.search).toBe('');+ });++ it('opens the draft already written for the top Optimize row', async () => {+ window.history.replaceState(null, '', '/dashboard/content/plan?start=optimize');+ getContentPlan.mockResolvedValue({+ ...PLAN,+ drafts: [+ {+ id: 'd1',+ author: 'user',+ isMine: true,+ method: 'optimize',+ opportunityId: null,+ sourceUrl: 'https://acme.example/guides/coffee-subscriptions',+ actionId: null,+ assignee: null,+ },+ ],+ });+ await renderPage();+ expect(push).toHaveBeenCalledWith('/dashboard/content/editor/d1');+ expect(dialog.props).toMatchObject({ open: false });+ });++ it('shows the empty card when the plan has no row of that action', async () => {+ window.history.replaceState(null, '', '/dashboard/content/plan?start=optimize');+ getContentPlan.mockResolvedValue({ ...PLAN, pages: [] });+ await renderPage();+ expect(button('Optimize').getAttribute('aria-pressed')).toBe('true');+ expect(dialog.props).toMatchObject({ open: false });+ expect(push).not.toHaveBeenCalled();+ });+});diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.tsxindex b8408c125..8b7cf99cf 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.tsx@@ -16,7 +16,8 @@ import {} from '@/lib/actions/content-plan';import { listMembers, type TeamMember } from '@/lib/actions/team';import { useUserRole } from '@/hooks/use-user-role';-import type { PageType } from '@/lib/content/drafts';+import { useRouter } from '@/i18n/navigation';+import { contentEditorPath, type PageType } from '@/lib/content/drafts';import { pageTypeMix } from '@/lib/content/plan-mix';import { siteTypeOf } from '@/lib/content/page-types';import {@@ -25,12 +26,13 @@ import {buildPlan,earlierPeriod,rowsFor,+ type PlanAction,type PlanCard,type PlanPeriod,type PlanRow,} from '@/lib/content/plan';import { formatNumber } from '@/lib/format';-import { readUrlChoice, writeUrlParams } from '@/lib/url-state';+import { readUrlChoice, readUrlParam, writeUrlParams } from '@/lib/url-state';import { cn } from '@/lib/utils';import { useBrandStore } from '@/stores/use-brand-store';import { AssignDialog } from './_assign-dialog';@@ -62,6 +64,18 @@ const CARD_DOT: Record<PlanCard, string> = {priority: 'bg-foreground',};+/** What New content opens on for a row: its opportunity in Start, or its page to optimize. */+function presetFor(row: PlanRow): DialogPreset {+ return row.opportunityId+ ? {+ kind: 'opportunity',+ id: row.opportunityId,+ // An opportunity for an existing page starts on that page.+ page: row.page ? { url: row.page, title: row.title } : null,+ }+ : { kind: 'page', url: row.page! };+}+/*** The Content plan (Content Editor CE-014, spec v2 §4): what to create,* optimize or protect next, for the last 7, 30 or 90 days. The cards count@@ -71,7 +85,8 @@ const CARD_DOT: Record<PlanCard, string> = {* to optimize) or opens the draft already being written. A row's menu* assigns it to a teammate, and lets admins and managers mark it as a* priority or hide it; hidden rows can be shown again below the list. The- * period lives in the URL (?days=7).+ * period lives in the URL (?days=7). Getting started's content steps open+ * the Plan on its top Create or Optimize row (?start=create, 00234).*/export default function ContentPlanPage() {const t = useTranslations('contentEditor.plan');@@ -100,9 +115,21 @@ export default function ContentPlanPage() {setMixType(null);}+ // Getting started's create or optimize step: start the top row of that action once the plan is in.+ const [startFrom, setStartFrom] = useState<Extract<PlanAction, 'create' | 'optimize'> | null>(+ null,+ );+ const router = useRouter();+useEffect(() => {// eslint-disable-next-line react-hooks/set-state-in-effect -- one read of the URL after mountsetDays(Number(readUrlChoice('days', ['7', '30', '90'], '30')) as PlanPeriod);+ const start = readUrlParam('start');+ if (start === 'create' || start === 'optimize') {+ setStartFrom(start);+ // Once: a reload or a shared link opens the plan as it is.+ writeUrlParams({ start: null });+ }}, []);useEffect(() => {@@ -165,16 +192,6 @@ export default function ContentPlanPage() {writeUrlParams({ days: String(next) }, { days: '30' });};- const presetFor = (row: PlanRow): DialogPreset =>- row.opportunityId- ? {- kind: 'opportunity',- id: row.opportunityId,- // An opportunity for an existing page starts on that page.- page: row.page ? { url: row.page, title: row.title } : null,- }- : { kind: 'page', url: row.page! };-const startRow = (row: PlanRow) => {setPreset(presetFor(row));setStarting(true);@@ -199,6 +216,25 @@ export default function ContentPlanPage() {setStarting(true);};+ // The step's row: the top one of its action not being written yet, or the+ // draft already being written for the top one. With none, the card shows+ // that there is none.+ useEffect(() => {+ if (!startFrom || !plan) return;+ const ofAction = plan.rows.filter((r) => r.action === startFrom);+ const row = ofAction.find((r) => !r.draft) ?? ofAction[0];+ // eslint-disable-next-line react-hooks/set-state-in-effect -- one start per visit from Getting started+ setStartFrom(null);+ setCard(startFrom);+ if (!row) return;+ if (row.draft) {+ router.push(contentEditorPath(row.draft.id));+ return;+ }+ setPreset(presetFor(row));+ setStarting(true);+ }, [startFrom, plan, router]);+const reload = () => setAttempt((n) => n + 1);const markRow = async (row: PlanRow, priority: boolean) => {diff --git a/web/src/lib/getting-started/steps.test.ts b/web/src/lib/getting-started/steps.test.tsindex 022d30f34..c0bcf6cfb 100644--- a/web/src/lib/getting-started/steps.test.ts+++ b/web/src/lib/getting-started/steps.test.ts@@ -35,6 +35,8 @@ const facts = (over: Partial<GettingStartedFacts> = {}): GettingStartedFacts =>contentCreated: 0,contentRecent: 0,audits: 0,+ draftsCreated: 0,+ draftsOptimized: 0,...over,});@@ -199,6 +201,19 @@ describe('buildGettingStarted', () => {expect(step(facts({ audits: 1 }), 'optimize_page').state).toBe('done');});+ it('opens the Content Plan’s top rows, and counts a draft made ready there (00234)', () => {+ const href = (key: string) => GETTING_STARTED_STEPS.find((s) => s.key === key)!.href;+ expect(href('create_content')).toBe('/dashboard/content/plan?start=create');+ expect(href('optimize_page')).toBe('/dashboard/content/plan?start=optimize');++ const suggested = facts({ contentSuggestions: 4 });+ expect(step({ ...suggested, draftsCreated: 1 }, 'create_content').state).toBe('done');+ expect(step({ ...suggested, draftsOptimized: 1 }, 'optimize_page').state).toBe('done');+ // A draft of the other method completes neither.+ expect(step({ ...suggested, draftsOptimized: 1 }, 'create_content').state).toBe('new');+ expect(step({ ...suggested, draftsCreated: 1 }, 'optimize_page').state).toBe('new');+ });+it('is ready once every other step is done or skipped', () => {const all = facts({records: {@@ -298,6 +313,8 @@ describe('parseGettingStartedFacts', () => {content_created: 0,content_recent: 2,audits: 1,+ drafts_created: 1,+ drafts_optimized: 3,}),).toEqual({startedAt: '2026-10-20T10:00:00+00:00',@@ -319,6 +336,8 @@ describe('parseGettingStartedFacts', () => {contentCreated: 0,contentRecent: 2,audits: 1,+ draftsCreated: 1,+ draftsOptimized: 3,});});diff --git a/web/src/lib/getting-started/steps.ts b/web/src/lib/getting-started/steps.tsindex 1e801e278..66b0e9543 100644--- a/web/src/lib/getting-started/steps.ts+++ b/web/src/lib/getting-started/steps.ts@@ -63,8 +63,9 @@ export const GETTING_STARTED_STEPS: readonly GettingStartedStepDef[] = [{ key: 'citations', stage: 'explore', href: '/dashboard/citations' },{ key: 'traffic', stage: 'explore', href: '/dashboard/traffic' },{ key: 'pick_content', stage: 'act', href: '/dashboard/content' },- { key: 'create_content', stage: 'act', href: '/dashboard/content' },- { key: 'optimize_page', stage: 'act', href: '/dashboard/audit' },+ // The Content Plan's top Create row and top Optimize row, open in Start (00234).+ { key: 'create_content', stage: 'act', href: '/dashboard/content/plan?start=create' },+ { key: 'optimize_page', stage: 'act', href: '/dashboard/content/plan?start=optimize' },{ key: 'ready', stage: 'ready', href: '/dashboard/action-center/actions' },];@@ -122,6 +123,9 @@ export interface GettingStartedFacts {/** Content sent to the CMS or completed in the last 30 days. */contentRecent: number;audits: number;+ /** Content Editor drafts made ready or published, by method (00234). */+ draftsCreated: number;+ draftsOptimized: number;}export interface GettingStartedProgress {@@ -199,6 +203,8 @@ export function parseGettingStartedFacts(raw: unknown): GettingStartedFacts | nucontentCreated: num(r.content_created),contentRecent: num(r.content_recent),audits: num(r.audits),+ draftsCreated: num(r.drafts_created),+ draftsOptimized: num(r.drafts_optimized),};}@@ -272,10 +278,18 @@ function stepState(}case 'pick_content':return { state: stateOf(f.contentPicked > 0, f.contentSuggestions > 0), progress: null };+ // A draft made ready or published in the Content Editor completes them+ // (00234); the old ways still count, so a step already done stays done.case 'create_content':- return { state: stateOf(f.contentCreated > 0, f.contentSuggestions > 0), progress: null };+ return {+ state: stateOf(f.contentCreated > 0 || f.draftsCreated > 0, f.contentSuggestions > 0),+ progress: null,+ };case 'optimize_page':- return { state: stateOf(f.audits > 0, f.contentSuggestions > 0), progress: null };+ return {+ state: stateOf(f.draftsOptimized > 0 || f.audits > 0, f.contentSuggestions > 0),+ progress: null,+ };case 'ready':// Filled in once the others are known.return { state: 'waiting', progress: null };