Skip to content

feat(report): align SPA with HTML, add "What's Changed" trend section#427

Merged
arberx merged 2 commits intomainfrom
arberx/align-report-html-spa
May 7, 2026
Merged

feat(report): align SPA with HTML, add "What's Changed" trend section#427
arberx merged 2 commits intomainfrom
arberx/align-report-html-spa

Conversation

@arberx
Copy link
Copy Markdown
Member

@arberx arberx commented May 7, 2026

Summary

  • SPA mirrors the downloaded HTML report: same DTO, same copy, same layout. Subtitles rewritten to HTML's terse versions, titles in Title Case, Executive Summary gains the headline + 3-card hero, Action Plan uses ranked collapsible cards with "Win condition" labels, channel/category breakdowns swap card grids for stacked share bars, Indexing Health trims to 3 metrics + coverage bar, Recommended Next Steps flattens to a linear list, Agency Diagnostics filters out "Location caveat", Content Opportunities adds top-3 highlight cards, GSC top-queries column order matches HTML, GA4 drops the 12-row landing-page slice, opportunity score renders as 87/100. Dedup helpers (dedupeReportActions, dedupeReportOpportunities) extracted to packages/contracts/src/report-dedup.ts so both surfaces collapse intent duplicates the same way.
  • New "What's Changed" trend section added at Section 2 in both client and agency modes. Computed at the API layer in buildWhatsChanged from existing DTO data — no new DB queries. Surfaces five delta tiles (citation/mention rate, cited queries, GSC clicks, AI referral sessions over a 14-day half-window), per-provider movements, wins, and regressions. Reuses isTrendBaseline for the empty/baseline state.
  • Section eyebrows renumbered (Section 2-14 → 3-15) across both surfaces. Bumped to 4.10.0.

Test plan

  • pnpm run typecheck clean across the workspace
  • pnpm run test — 2079 tests pass (3 new in report.test.ts covering baseline, run-over-run math, wins/regressions filtering)
  • pnpm run lint clean
  • Visual sanity check: open the report in the SPA against a project with ≥4 completed runs; confirm What's Changed renders deltas + wins/regressions, and that section headings match the downloaded report.html for the same audience
  • Visual sanity check: open the report against a project with <4 runs; confirm baseline copy ("Establishing baseline (X of Y runs collected)") instead of empty tiles

arberx added 2 commits May 7, 2026 16:41
Merges two threads of report work:

- SPA mirrors the downloaded HTML report. Both surfaces consume the same
  ProjectReportDto and now share copy, layout, and structure: subtitles
  rewritten to HTML's terse versions, titles in Title Case, Executive
  Summary gains the headline + 3-card hero, Action Plan uses ranked
  collapsible cards with "Win condition" labels, channel/category
  breakdowns swap card grids for stacked share bars, Indexing Health
  trims to 3 metrics + coverage bar, Recommended Next Steps flattens to
  a linear list, Agency Diagnostics filters out "Location caveat",
  Content Opportunities adds top-3 highlight cards, GSC top-queries
  reorders columns (Query, Clicks, Imp., CTR, Pos., Category), GA4
  drops the 12-row landing-page slice, opportunity score renders as
  87/100. Dedup helpers (dedupeReportActions, dedupeReportOpportunities)
  extracted from report-renderer.ts to a new packages/contracts/src/
  report-dedup.ts so both surfaces collapse intent duplicates the same
  way.

- New trend-focused "What's Changed" section (act 2) added at Section 2
  in both client and agency modes. Computed at the API layer in
  buildWhatsChanged from existing DTO data — no new DB queries. Surfaces
  five delta tiles (citation/mention rate, cited queries, GSC clicks,
  AI referral sessions), provider movements, wins, and regressions.
  14-day half-window for traffic deltas; baseline gating reuses
  isTrendBaseline so N=2 doesn't read as a crisis. Section eyebrows
  renumbered Section 2-14 -> 3-15 across both surfaces. Three new tests
  in report.test.ts cover baseline, run-over-run math, and
  wins/regressions filtering.

Bumps to 4.10.0.
Replace canonry-flavored vocabulary with marketing-natural terms across
both report surfaces, since the report is shared externally with users
who don't speak canonry's internal language:

- "(visibility) sweep" → "check" in subtitles, empty states, action copy
- "runs collected" → "checks completed"
- "Establishing baseline" → "Building baseline"
- "Trend deltas" → "Trends"
- "Δ" column → "Change"
- "Provider movements" → "AI engine movements"
- "Per-provider rates" → "Per-engine rates"
- "Run-by-run breakdown" → "Check-by-check breakdown"
- "Run" column header → "Check"

Touches HTML renderer, SPA, server-built copy in report.ts (executive
findings, action plan items, client summary), and test fixtures /
assertions. Internal code comments and CLI command names ("canonry run")
left as-is.

Bumps to 4.10.1.
@arberx arberx merged commit 00acad9 into main May 7, 2026
2 checks passed
@arberx arberx deleted the arberx/align-report-html-spa branch May 7, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant