Skip to content

feat(ui): Explorer interactivity — detail views, richer tables, Sales charts, cross-filtering (PRP-20) #187

@w7-mgfcode

Description

@w7-mgfcode

Implements PRP-20PRPs/PRP-20-explorer-interactivity.md.

Turns the three primary Explorer pages (Sales, Stores, Products) from flat read-only views into an interactive analysis surface.

Scope

  • Click-through detail views — two deep-linkable routes (/explorer/stores/:storeId, /explorer/products/:productId): entity profile, date-scoped KPIs, revenue-over-time chart, top-contributors drilldown.
  • Richer tables — server-side column sorting, CSV export, column-visibility toggles on Stores / Products / Runs.
  • Charts on Sales — revenue-by-dimension bar chart + revenue-over-time line chart alongside the ranked list.
  • Cross-filtering — filter / date / dimension state persisted in the URL; "View in Sales" link carries store_id / product_id.

Backend (additive — no migration, no new slice, no app/main.py change, no .env var)

  • GET /analytics/timeseries — daily/weekly/monthly/quarterly aggregated sales, filterable by store_id / product_id / category.
  • GET /dimensions/stores and /dimensions/products gain optional allow-listed sort_by / sort_order query params.
  • Also closes the analytics slice test gap (no test files today).

Maintainer-confirmed decisions (2026-05-18)

  1. All four interactivity directions ship (detail views, richer tables, Sales charts, cross-filtering).
  2. Time-series data via a dedicated GET /analytics/timeseries endpoint, not reused /analytics/drilldowns.
  3. Entity detail views are dedicated React Router route pages (deep-linkable), not Sheet/Dialog.

Task checklist

  • Task 1 — Open this tracking issue
  • Task 2 — Backend: GET /analytics/timeseries endpoint (schemas + service + routes)
  • Task 3 — Backend: sort_by / sort_order on /dimensions store + product listings
  • Task 4 — Backend tests (analytics + dimensions DB fixtures, closes the test gap)
  • Task 5 — Frontend: types + hooks (use-timeseries, use-lifecycle-curve, sort params)
  • Task 6 — Frontend: shared interactive components (view-options, column-header, revenue-bar-chart, csv-export)
  • Task 7 — Frontend: routing (2 lazy detail routes)
  • Task 8 — Frontend: store + product detail pages
  • Task 9 — Frontend: richer Stores + Products tables
  • Task 10 — Frontend: Runs table (export + view-options)
  • Task 11 — Frontend: Sales page charts + cross-filtering
  • Task 12 — Frontend test (csv-export.test.ts)
  • Task 13 — Docs: README + API_CONTRACTS + REPO_MAP_INDEX
  • Task 14 — Dogfood the running UI (webapp-testing / agent-browser, screenshots)
  • Task 15 — Commit + PR into dev

No Alembic migration. No new slice. No app/main.py change. No new .env var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeatNew featurescope:analyticsTouches the analytics area (commit-format scope)scope:dimensionsTouches the dimensions area (commit-format scope)scope:docsTouches the docs area (commit-format scope)scope:uiTouches the ui area (commit-format scope)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions