Skip to content

feat(analytics): overview reports shared records, workbook activity, providers and spend - #185

Merged
velixio merged 27 commits into
mainfrom
fix/analytics-current-model
Nov 19, 2026
Merged

velixio merged 27 commits into
mainfrom
fix/analytics-current-model

Conversation

@velixio

@velixio velixio commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Builds on #184 (and #183). This branch is stacked on #184, so its diff against main includes that PR until it merges; the analytics change itself is the last commit.

What changed

The analytics overview read legacy leads only. A workspace with companies, people and workbook runs saw zeros.

  • GET /api/analytics/overview keeps every existing field in the same order and adds, after them: records (companies, people, people with email, verified emails, companies needing a domain, percentages), activity (30-day window: workbooks, workbooks run, running, failed, cells filled, cells with no data, fill rate, per-day series), providers (per provider: cells filled, share of filled cells, paid attempts, settled spend), spend (window, total, per-day) and legacy (present, leads).
  • All queries run inside the caller's tenancy.InWorkspace transaction and also name the workspace explicitly. Email definitions are the same as the Overview page.
  • Web: the default view is records and workbooks. "Legacy leads (N)" is a secondary scope button shown only when legacy.present. A backend without the new fields still gets the old page. The response check accepts an absent block and rejects a malformed one.

Decisions to review

  • Provider "hit rate" is reported as share of filled cells plus paid attempts and settled spend. provider_stats has no workspace column (so no row-level security) and would mix tenants; workbook_enrichments records the provider only for cells that got a value, so per-provider failure rates are not available from tenant-scoped data.
  • legacy.present is true when the workspace has legacy lead rows. Legacy leads are also projected into company records, so company counts include those.

How tested

  • go test -tags integration ./internal/analytics against my own Postgres (compose project opengtm-e2e): ok. New tests cover counts, email and verified definitions, per-day series, provider shares, spend from settled attempts only (released ones excluded), legacy flag, an empty workspace, and isolation between two workspaces.
  • go test -tags integration ./internal/api -run 'Analytics|Overview|Enrichment|Pipeline': ok. The 25 recorded Python fixtures still pass with the new keys removed before comparing; key order and the empty-workspace body are asserted explicitly.
  • bun run lint, bun test tests (206), bun run build, bun run test:a11y (56, including the legacy scope in both themes and a case where the toggle is absent): pass. Fixtures in fixtures/real-shapes.ts carry the new fields.
  • Query cost: 100k rows each in workbook_enrichments, workbook_spend_attempts, person_entities, company_entities in one workspace, EXPLAIN ANALYZE: 5 to 26 ms per query (parallel sequential scans, since one workspace holds every row; the workspace_id indexes exist for the multi-tenant case). No migration added.

Not tested

  • The whole internal/api integration package hit the 10 minute test timeout on my database, so only the analytics-related tests above were verified. I did not find the cause.
  • EXPLAIN was run as a superuser with one workspace holding all rows; a mixed multi-tenant table was not measured.
  • Other databases than PostgreSQL 16.

…tegy

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Nine declarative manifests (Anymail Finder, Bouncer, MillionVerifier,
Findymail, ContactOut) with docs-derived fixtures and one generic test,
a wiring test across catalog, workbook and settings registries, and a
rewritten manifest format guide.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Replace every native confirm/prompt with useConfirm()/usePrompt() (focus managed, destructive style, named objects). Fix target-size at shared level via --gtm-target-min (accounts for the shell's CSS zoom), fix contrast and unnamed controls, add six routes to the axe gate, and empty the baseline.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…ls; changelog for the Go cutover

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…_verify words

response.value_maps translates a mapped value with an explicit default,
request.omit_empty drops empty headers, query parameters and body keys,
and values substituted into request.url are escaped. The three verifier
manifests now emit only valid, invalid, catch_all, risky, unknown.
Adds Settings key cards for LeadMagic and Prospeo.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Audience and automation delivery adds a lead to a HeyReach (LinkedIn) or lemlist (email) campaign with the workspace's own API key. Workbook output columns are not part of this change.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…ints

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Upserts each member as an Attio person matched on email and links or creates its company by domain, with the workspace's own token.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… train/2026-11-19

# Conflicts:
#	apps/backend-go/internal/settings/registry.json
…11-19

# Conflicts:
#	apps/backend-go/internal/settings/registry.json
…rain/2026-11-19

# Conflicts:
#	apps/web/src/components/command-menu-content.tsx
Drives the built app against a running stack (setup, Get started, sample run,
every route in light and dark, one action per area), records API statuses,
console output and error states, and writes screenshots and findings.json.
Separate config and script; not part of test:a11y and not run in CI.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…nalytics trend contrast

The mocked suite answered unmatched endpoints with [], so /overview, /analytics and
/settings rendered their error states (or a skeleton) and were never audited with
content. Add shapes captured from the real API, fail any page that shows an
error state, and wait for the query retry before auditing. The analytics page,
now rendered with data, exposed low-contrast trend text (emerald-500 and red-400
on white); use the 700/400 pair.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Loading the sample completes step 3, and done steps carry no actions, so
Open it from step 3 pointed at nothing. The workbook link is step 4's.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
The list search cast accepted_fields to text, so domain or name (or any
short term) matched every record. Search the values with jsonb_each_text.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Removed the GitHub star-count fetch from the login page (plain link stays),
replaced Google favicon requests with local icons or initials in the workbook,
legacy leads, lead detail and quick look, and made the lead-detail map
(Nominatim geocoding and OpenStreetMap tiles) load only after a click. The a11y
suite now fails any route, and /login, that requests another origin.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Add internal/sqllike (Escape, Contains) and use it for the record search and
the workbook row query; the lead list and read queries (sqlc) get the same
escaping in SQL, as emaildata already had. A lone % used to match every row.
The two recorded lead vectors that relied on wildcard semantics (specialization
IT_Staffing and %) now expect literal matches. All other ILIKE/LIKE uses are
fixed patterns. Every query built from request input is parameterised; the few
concatenated identifiers (leads update columns, record table names) come from
allow-lists.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…providers and spend

The analytics overview read legacy leads only, so a workspace with companies,
people and workbook runs saw zeros. The response now also carries records,
activity, providers, spend and legacy (added after the existing fields). The
page defaults to that view; the legacy-lead scope is a secondary filter shown
only when legacy rows exist.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
@velixio
velixio requested a review from debpalash as a code owner November 19, 2026 01:49
@github-actions

Copy link
Copy Markdown

All contributors on this pull request have signed the OpenGTM CLA. Thank you!

Agreement: OpenGTM CLA 1.0

@github-actions github-actions Bot added the cla-signed All contributors signed the CLA label Nov 19, 2026
@velixio
velixio merged commit 447a1eb into main Nov 19, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed All contributors signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant