Skip to content

[IMPL] Frontend — /analytics KPI strip + by-channel table #1990

Description

@piotrswierzy

Design source

Product Design parent: Part of #1976 — see spec at docs/specs/product-spec-1976-analytics.md (§ 5 Design 1, § 6, stories S1/S2)

Scope

The money half of the page, top section.

  1. KPI strip — Revenue, Orders, AOV (with median shown beside the mean), Units. Uses the existing .status-strip + KpiCard pattern (which already supports a sparkline slot, tone and an optional link target), matching /'s idiom.
  2. By-channel table — one row per connected channel: revenue, share, orders, AOV, units, trend sparkline. DataTable with sortable typed columns, hideBelow for narrow widths and card view on mobile.

Acceptance criteria

  • KPI strip shows revenue, orders, AOV with median, and units for the selected range
  • By-channel table lists every connected channel with its figures and share
  • Every figure carries its currency; where a range spans multiple currencies the page does not render a single blended number
  • Where gross and net reporting channels cannot be compared on the same basis, the table says so rather than implying comparability
  • A channel with less history than the selected range is visibly marked (reads the coverage window from the trust data)
  • Cancelled value is visible, so exclusion from revenue is evident rather than silent
  • All numerics use tabular-nums; mono for IDs/timestamps per the style guide
  • Loading/error states per section with retry; a channel-table failure does not blank the KPI strip
  • Responsive: KPI strip reflows (1×4 → 2×2 → vertical); table switches to card view; no horizontal page scroll
  • Tests added
  • No new ESLint warnings or type errors introduced

Effort estimate

  • M — 3–7 days

Dependencies

Out of scope for THIS issue

  • A revenue time-series chart — v1 carries sparkline-level trend only. A real chart is v2 and forces the deferred charting-library decision
  • Period-over-period comparison
  • Commerce-mix rows (COD / Paczkomat / Smart!) — catalogued as group I, deferred to v2

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions