# analytics-scope-2 — live-reaction redo (operator, 2026-07-22)

> Kickoff: Fable, 2026-07-22. Source: operator's first live reaction to the
> Analytics screen (screenshot evidence: the question card renders at ~half
> the viewport width, right half empty). Verdict, verbatim intent: "the
> ui/ux and how the data is brought and visualized is bad. it's hard to get
> the info you want to know immediately."

## Operator steers (law for this package)

1. **Remove the "five questions" meta-framing** — no page heading "The five
   questions" ("it's stupid"), no "QUESTION 1 ·" numbering. The
   question-set is an internal design tool, not UI copy.
2. **Labels are plain nouns** — e.g. a label like "who is this bot" must be
   "Identity"; eyebrow/category labels: Volume, Outcomes, … (one word where
   possible).
3. ~~Headings stay phrased as questions~~ **REVERSED by operator
   2026-07-22 (same day): "the analytics heads are still brought and
   written as questions" — headings must NOT be questions either.** Every
   heading is a plain statement/noun phrase ("Inbound volume", not "How
   much came in, and through which channel?"). No question-phrased copy
   anywhere on the screen.
4. **Full-width layout** — the screen must use the whole content width like
   every other screen; the half-width card is a defect.
5. **Data must answer at a glance** — restructure how each card brings and
   visualizes its data so the key number/answer is immediately visible
   (invoke the `dataviz` skill BEFORE touching any chart).

## Scope

- `apps/web` Analytics screen (+ its css). API aggregation endpoints only if
  a presentation need forces a shape change — no new metrics.
- Check `analytics-scope-1-kickoff.md` gate section first; this package
  supersedes its presentation decisions but keeps its computed-empty-state
  bar (no fabricated numbers, genuine empties).

## Acceptance criteria (gate)

- No "five questions"/"QUESTION n" copy anywhere on the screen (grep-proof).
- Labels nouns, no question-phrased copy anywhere (steer 3 as amended),
  plain words throughout (simplify law).
- Full content width at 320/375/768 and desktop; no horizontal overflow;
  screenshots into `plans/rethink/evidence/analytics-scope-2/`.
- Each card leads with its answer (the headline stat/visual), detail below.
- Web tests green (forks pool, maxForks=2); vite build passes; published.

## Out of scope

New metrics, new questions, api schema changes beyond presentation needs,
any other screen.

## Seat F — data correctness (added same day, operator follow-up)

Operator, verbatim intent: "the analytics doesn't seem complete and even
retrieve the data. there is fields and data that exist but the analytics
says it doesn't exist. analytics section needs to be reviewed."

- Scope: the Analytics aggregation endpoints (api). Review every metric's
  query against the real schema + live data: does it read the right
  tables/fields/enums, right channel filters, right date math? Screenshot
  clue: "Agent replies out: 0" while the bot has replied on live;
  channels/fields with data reporting as absent.
- Method: for each card, run the endpoint's query logic against prod
  (read-only psql) and independently count the truth with your own SQL;
  every mismatch is a defect — root-cause (wrong column, wrong enum value,
  wrong join, missing channel, wrong time window), fix at source, pin with
  a test.
- Acceptance: per-metric truth table (endpoint value vs independent SQL
  count) all matching on prod; api tests green; deploy + health check.
- Coordination: Seat E owns the web presentation — do not touch apps/web;
  if a fix changes a response shape, note it in your report for Seat E/gate.

## Stage log

- 2026-07-22: kickoff written; Seat E dispatched.
- 2026-07-22: Seat F (data correctness) added + dispatched; Seat E notified
  to stay presentation-only.
- 2026-07-22: Seat E presentation redo shipped (`db86e6d`). Framing copy gone
  (grep-proof: no "five questions"/"QUESTION n" in rendered copy or aria-labels;
  page title now "Analytics"; drill breadcrumb/eyebrow re-worded to "Analytics ·
  Outcomes"). Eyebrows are plain nouns (Volume, Outcomes, Campaigns, Delivery,
  Cost); headings stay question-phrased. Each block rebuilt as a two-column body
  — hero answer left (total inbound / automation % / campaigns / Meta state /
  spend), visualization right — stacking below 768px. `.an-wrap` widened
  900px → `--cm-content-max` (1360px): the reported half-width defect. Values
  rendered verbatim from the endpoint (no web-side fabrication/band-aid). Oracle:
  web `Analytics.test.tsx` 8/8 + `analytics-api.test.ts` 3/3 (capped forks);
  web typecheck + lint (0 errors) + vite build exit 0. Evidence (real components
  + real CSS, stubbed overview, headless Chrome own-profile) at 320/375/768/1440
  in `plans/rethink/evidence/analytics-scope-2/`, no horizontal overflow at any
  width. NOT verified by Seat E: production publish (left to gate/orchestrator);
  live data against the real API.
- 2026-07-22: Seat E follow-up round shipped (`2ac23bd`). (1) Headings de-
  questioned — plain statements ("Inbound volume by channel", "Agent outcomes",
  "Campaign activity", "Delivery health", "LLM spend"); grep bar met, no heading
  ends with "?"; drill title aligned. (2) Default window 30d→90d so older
  WhatsApp/campaign activity isn't hidden; active range shown prominently
  ("Showing Apr 24 to Jul 22 · 90 days"). (3) Sub-cent: fmtUsd sub-cent branch
  pinned by test AND fixed the Cost bar scale (a `Math.max(1, …)` $1 floor was
  rendering sub-cent bars as invisible slivers — real prod-data bug). (4) Busiest-
  day ISO humanised ("9 Jul") via fmtDayMonth. (5) agentRepliesOut = agent's own
  replies sent (0 in shadow mode) — label now "Agent replies sent". (6) Spacing
  normalised to a 16/20/32 token rhythm, ad-hoc inline margins removed. (7) Per-
  day chart rebuilt with legible magnitudes: 0→peak axis, peak direct-labelled,
  a live readout tracking the hovered day, native title tooltips; hover titles
  added to channel/cost/split/failure bars (sweep). Oracle: analytics-shared 7/7
  + Analytics 8/8 + analytics-api 3/3 (capped forks); my files lint+typecheck
  clean (the one full-tsc error is another seat's `agent/Situations.test.tsx`,
  not analytics); vite build exit 0. Evidence refreshed at 320/375/768/1440,
  no overflow. Still NOT verified by Seat E: production publish; live-API data.
