Skip to content

feat(action-center): start and skip Getting started, and ask before running it for another brand - #1243

Merged
gkhngyk merged 17 commits into
ansvisor:mainfrom
cihan-gyk:feature/getting-started-existing
Oct 20, 2026
Merged

gkhngyk merged 17 commits into
ansvisor:mainfrom
cihan-gyk:feature/getting-started-existing

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

New Ansvisor: Action Center + Getting started, PR 7 of 7 (AC-ALT2 spec, §5). Stacked on #1236 → #1235 → #1234; merge after them. This PR's own change is the last commit (c2730156).

Existing customers

  • When a brand's setup is incomplete, Start getting started shows at the top right of Actions, with "Only you see this · about 15 min".
    • Incomplete means the spec's suggested rule: fewer than 3 competitors, fewer than 3 topics, no Search Console, or no content in 30 days.
    • Clicking it runs Getting started and checks the steps already done (toast "Getting started · 4 steps already done").
    • Their action list is unchanged until then.
  • Skip getting started shows while it runs.
    • It asks once: "Your actions list goes back to normal. Steps you finished stay done." / "You can start again any time from the same button."
    • After a skip the page is exactly today's, and Start stays available.

A second brand

Only admins and managers see and use these, as they can set the steps up. Everyone else sees the list as before.

Migration 00197_getting_started_start_skip.sql (applied on the dev DB)

  • getting_started.confirmed_at. The brands trigger leaves it null for a later brand, which then asks first. Rows from 00196 are filled in.
  • Insert and update policies on getting_started for admins and managers, as for kpi_definitions.
  • getting_started_facts adds confirmed_at and content_recent: content sent to the CMS or completed in 30 days, for the rule.

Web

  • buildGettingStarted returns asking, needsSetup and skipped. active now also needs confirmed_at.
  • New actions startGettingStarted (upsert, clears a skip) and skipGettingStarted.
  • The page title moved into ActionsHeader, so Start/Skip sit beside it in every state: loading, empty or listed.

Decision to confirm

  • "Skip getting started" is offered to new users too. The mockup shows it only in the existing-customer view. Hiding it for new users would need one more field; happy to add it.

Related issue

New Ansvisor (AC-ALT2). Depends on #1234–#1236.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

Deploy order: apply 00196, then 00197, then deploy the web.

  1. Existing brand with fewer than 3 topics. As an admin, open Actions.
    • "Start getting started" shows at the top right.
    • Click it. The steps already done are checked and the Getting started view opens.
  2. Skip. Click "Skip getting started". It asks first. Choose Skip: you're back to the usual list, and Start is still there.
  3. Second brand. Add a second brand to the same organization and open Actions for it.
    • The question opens.
    • Run Getting started starts it at 0 / 17.
    • Skip goes straight to the actions.
  4. Members. As an analyst, neither the buttons nor the question show.

Verified on the dev DB in a rolled-back transaction:

  • A second brand starts with confirmed_at null; a new organization's first brand is confirmed.
  • An admin can start and skip their brand; another organization's brand is refused by RLS.

Unit tests:

  • steps.test.ts: asking, the existing-customer rule.
  • page.test.tsx: Start for managers only and only when the setup is incomplete; Skip after the question; the second-brand question runs it.

Checked in light and dark, at 1440 and 1024px.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

yarn test (1820) and yarn build pass, and schema.sql is rebuilt with bash supabase/build-schema.sh.

🤖 Generated with Claude Code

cihan-gyk and others added 4 commits October 20, 2026 03:48
… steps from the brand's data

New Ansvisor (AC-ALT2 spec, §4), PR 2 of 7: the data behind Getting
started, the 17 setup steps that will sit in the Actions page.

- Migration 00196: getting_started (one row per brand that runs it; a
  trigger starts it for every new brand, existing brands have none) and
  getting_started_steps (what a person did that the data can't show: a
  page opened, an optional step skipped, KPIs saved), member RLS.
- getting_started_facts reads everything the steps need in one call;
  getting_started_page_opened records an explore page once the brand's
  first answers are in.
- lib/getting-started/steps.ts turns the facts into the 17 steps (New,
  Done, Waiting for data, Skipped, with progress); unlocks follow the
  data, not days.
- Saving from the KPI screen marks the KPI step (the ready-made set
  appears on a visit, so it doesn't count).
- The dashboard layout records the explore pages however they're opened.

Nothing is shown yet; the Actions page list follows in the next PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
New Ansvisor (AC-ALT2 spec, §4), PR 3 of 7, on top of the Getting started
data. While a brand runs Getting started:

- the first summary card shows "x / 17 · steps done · at your own pace"
  with a bar, in Highest Priority's place; before the first actions, Top
  Actions, At Risk and Opportunities show "—" and "Start with your first
  signals";
- a "Getting started 17" chip opens first (unless the URL names a
  category) and lists the steps: Action · Stage · Status · Assignee ·
  Ready · Updated, with the live status colours (New, Done, Skipped) and
  progress under the status;
- a step opens its page in a new tab; one still waiting for data says
  when it opens; the steps are read again when the tab is back in front.

A brand that doesn't run it, or skipped it, sees the page exactly as
before. The right-side card for each step follows in the next PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d step

New Ansvisor (AC-ALT2 spec, §6), PR 4 of 7, on top of the Getting started
list. A step opens a card beside the list instead of its page:

- status and stage chips, "Optional · recommended" where it applies,
  title and summary, "Everyone in the workspace" and when it's ready;
- Why it's important (1–3 reasons) and How to do this: a 16:9 place
  saying "Videos coming soon" until the videos are recorded, then the
  numbered steps;
- Done when, with progress (e.g. 2/3);
- the button opens the step's page in a new tab; Search Console and
  Analytics can be skipped after a last-chance question ("Skip anyway"
  / "Connect now"); a skipped step says it can still be connected.

The card isn't modal: the list stays usable and makes room for it from
1300px; Escape or X closes it. The high-value prompts step opens Prompt
Suggestions on a new "From your data" filter (?source=data: Search
Console or Analytics suggestions, fromYourData()).

Standard actions keep today's drawer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…unning it for another brand

New Ansvisor (AC-ALT2 spec, §5), PR 7 of 7, on top of the step card.

- Existing customers: "Start getting started" at the top right of
  Actions ("Only you see this · about 15 min") when the brand's setup is
  incomplete (fewer than 3 competitors or topics, no Search Console, or
  no content in 30 days), and after a skip. It runs with the steps
  already done checked ("Getting started · 4 steps already done").
- "Skip getting started" asks once ("Your actions list goes back to
  normal. Steps you finished stay done."); the page is then today's.
- A brand added to an organization that already has one asks "Run
  Getting started for [brand]?" (Run / Skip); the first brand, from
  onboarding, runs it at once.
- Admins and managers start and skip it.

Migration 00197: getting_started.confirmed_at (null while a later brand
asks; the trigger fills it for an organization's first brand), insert and
update policies for admins and managers, and getting_started_facts adds
confirmed_at and content_recent for the rule.

The page's title moved into ActionsHeader so Start/Skip sit beside it in
every state of the page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk New Ansvisor PR 7/7 (last), stacked on #1236 → #1235 → #1234. Existing customers get "Start getting started" when the setup is incomplete (spec's suggested rule: <3 competitors, <3 topics, no Search Console or no content in 30 days), "Skip getting started" asks once, and a brand added beside others asks "Run Getting started for [brand]?". Migration 00197 (confirmed_at, admin/manager write policies, facts fields) is applied on the dev DB; deploy 00196 → 00197 → web. One decision to confirm: Skip is offered to new users too (the mockup shows it only for existing customers).

@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 20, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

00197 keeps the function signatures, and starting or skipping is admin and manager only. I'll apply 00196 and 00197 on prod before the merge.

That order matters, because the web deploys on merge. Without 00197:

  • confirmedAt reads as null, so every running brand asks "Run Getting started for X?".
  • The modal has no close and no onOpenChange.
  • Run fails on the missing confirmed_at column, and Skip fails because 00196 has no UPDATE policy on getting_started.
  • So managers can't close the modal, and with #1238 that is the home page.

Two changes so a failure can't trap anyone:

  1. Let the second-brand question close. At least for the session, and also when start or skip fails.
    • In switchGettingStarted, if start succeeds but the re-read fails, the old asking status stays and the modal opens again.
  2. Read confirmed_at defensively: 'confirmed_at' in r ? str(r.confirmed_at) : str(r.started_at).

Nit: "Only you see this" isn't accurate, since every admin and manager sees Start.

cihan-gyk and others added 12 commits October 20, 2026 10:26
…rted-data

# Conflicts:
#	supabase/schema.sql
…ting started step

gkhngyk's review: the step policies let any member write any state, so
an analyst could skip Search Console and Analytics, or mark a step done
through PostgREST. Recording an opened page stays open to every member;
skipped and done now need an admin or a manager, as the other Getting
started and KPI writes do (insert check, and the update's with check).

updated_by is dropped: nothing set it after the first write, so it only
ever named whoever opened the page first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…steps once on return

gkhngyk's review:
- About 15 places link to /dashboard/action-center/actions?action=<id>
  (Create action, a signal, content, the history drawer, the task-send
  and export links). On a brand running Getting started, the drawer
  opened over the steps. A link to an action or to a filtered list
  (priority, status, assignee, q, sort) now counts as a chosen view, as
  a category does.
- focus and visibilitychange both fire when the tab is back in front:
  the steps are read once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ted-card

# Conflicts:
#	web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx
…and leave Escape to an open dialog

gkhngyk's review:
- Skip on the step card shows only for admins and managers, who are the
  only ones the step policies let skip (00196).
- The card's Escape handler no longer closes it while a dialog is open
  over the page (its Skip question, or "Skip getting started"), so one
  press closes only that dialog.
- The steps table showed each step's stage twice: the badge under the
  title goes, the Stage column stays.
- panel.nextStep, unused, is gone from en.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d read confirmed_at defensively

gkhngyk's review: the web deploys on merge, and without 00197 every
running brand would ask "Run Getting started for X?" in a modal with no
close, whose Run and Skip both fail.

- The question closes like any dialog, and stays closed for the visit
  once answered or closed, even when the answer can't be saved or the
  steps can't be read back.
- Without a confirmed_at in the facts (00197 not applied), a running
  brand reads as confirmed.
- The Start hint says who sees it: "For admins and managers".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closing the question left neither the question nor Start: the brand
could no longer run Getting started from the page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk Done in 00223d8e and 4251fccf, with #1236 merged in:

  • The second-brand question can always close. It has a close button, and once answered or closed it stays closed for the visit. That holds when Run or Skip fails, and when the steps can't be read back. Start then takes its place, so the brand can still run Getting started later.
  • confirmed_at: without it in the facts (00197 not applied), a running brand reads as confirmed, so nobody gets the question.
  • The hint reads "For admins and managers · about 15 min".

Takes main after the ansvisor#1234, ansvisor#1235 and ansvisor#1236 squashes; only this PR's own
changes are applied on top, and schema.sql is rebuilt with build-schema.sh.

Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, both changes are in:

  • The second-brand question closes like any dialog, and stays closed for the visit even when the answer can't be saved or read back. Start takes its place.
  • confirmed_at is read defensively.

The Start hint now says who sees it. 00197 is unchanged since my last review, and 00196 and 00197 are both applied to production.

Still open on our side, as a follow-up: Getting started keeps opening by default after ready is done.

@gkhngyk
gkhngyk merged commit 2041298 into ansvisor:main Oct 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants