Skip to content

feat(web): React activity views — sessions + projects (AUR-269)#27

Merged
mishanefedov merged 1 commit into
mainfrom
aur-269-activity-views
May 4, 2026
Merged

feat(web): React activity views — sessions + projects (AUR-269)#27
mishanefedov merged 1 commit into
mainfrom
aur-269-activity-views

Conversation

@mishanefedov
Copy link
Copy Markdown
Owner

Linear: AUR-269

Summary

Visualizes the per-event activity classifier (AUR-264) data through two new lazy routes.

`/sessions/:id/activity`

  • Stacked bar of events × category in 1-min UTC buckets across the session's lifetime.
  • Per-category summary table (events, cost, % of events, % of cost).
  • Bucketed client-side from the session's events (which already carry `details.category`) so this didn't need a new time-series API.
  • Empty state for sessions with zero classified events.

`/projects/:name/activity`

  • Pie of events by category + pie of cost by category side-by-side.
  • Per-category breakdown table including the new sessions touched column.
  • Empty state for unclassified projects.

API extension

`activityByProject` now adds `COUNT(DISTINCT session_id) AS sessions_touched`. `ActivityBucket` interface gets an optional `sessionsTouched` field. The web client's `EventDetails` type also exposes the existing `details.category` field.

Wiring

  • Both pages are lazy-loaded (`Suspense` fallback), matching `SessionTokens`, `Trends`, `SessionGraph`.
  • Nav links from `Session.tsx` and `ProjectDetail.tsx`.

Acceptance criteria

  • New route `/sessions/:id/activity` rendering recharts stacked-bar over time + per-category cost summary.
  • New route `/projects/:name/activity` with pie + table including `events / cost / sessions touched`.
  • Both views handle the empty-data case gracefully.
  • Lazy-loaded in `main.tsx`.

Test plan

  • `npm run typecheck` — clean (server)
  • `web && npx tsc --noEmit` — clean for new files (one pre-existing unused-var error in `Logs.tsx` left alone)
  • `npm test` — 369/369 pass (+1 new for `sessionsTouched`)
  • `npm run build` — server (tsup) + web (vite) both build

Visualizes the per-event activity classifier (AUR-264) data:

- /sessions/:id/activity — stacked bar of events × category in 1-min
  buckets across the session's lifetime, plus a per-category cost +
  count + percentage table. Bucketed client-side from the session's
  events so we don't need a new time-series API.
- /projects/:name/activity — pie of events-by-category + pie of
  cost-by-category + per-category breakdown table including the new
  sessionsTouched column. Empty-state for unclassified projects.

Both routes are lazy-loaded behind the existing Suspense fallback,
matching SessionTokens/Trends/SessionGraph. Nav links surface from
Session.tsx and ProjectDetail.tsx.

Extends activityByProject SQL with COUNT(DISTINCT session_id) and
adds sessionsTouched to ActivityBucket. EventDetails type in the web
client now exposes details.category. +1 vitest case for the new column.
Full suite 369/369 (was 368).
@mishanefedov mishanefedov merged commit 302f9dd into main May 4, 2026
3 checks passed
@mishanefedov mishanefedov deleted the aur-269-activity-views branch May 4, 2026 09:17
mishanefedov added a commit that referenced this pull request May 25, 2026
Visualizes the per-event activity classifier (AUR-264) data:

- /sessions/:id/activity — stacked bar of events × category in 1-min
  buckets across the session's lifetime, plus a per-category cost +
  count + percentage table. Bucketed client-side from the session's
  events so we don't need a new time-series API.
- /projects/:name/activity — pie of events-by-category + pie of
  cost-by-category + per-category breakdown table including the new
  sessionsTouched column. Empty-state for unclassified projects.

Both routes are lazy-loaded behind the existing Suspense fallback,
matching SessionTokens/Trends/SessionGraph. Nav links surface from
Session.tsx and ProjectDetail.tsx.

Extends activityByProject SQL with COUNT(DISTINCT session_id) and
adds sessionsTouched to ActivityBucket. EventDetails type in the web
client now exposes details.category. +1 vitest case for the new column.
Full suite 369/369 (was 368).
mishanefedov added a commit that referenced this pull request May 25, 2026
Visualizes the per-event activity classifier (AUR-264) data:

- /sessions/:id/activity — stacked bar of events × category in 1-min
  buckets across the session's lifetime, plus a per-category cost +
  count + percentage table. Bucketed client-side from the session's
  events so we don't need a new time-series API.
- /projects/:name/activity — pie of events-by-category + pie of
  cost-by-category + per-category breakdown table including the new
  sessionsTouched column. Empty-state for unclassified projects.

Both routes are lazy-loaded behind the existing Suspense fallback,
matching SessionTokens/Trends/SessionGraph. Nav links surface from
Session.tsx and ProjectDetail.tsx.

Extends activityByProject SQL with COUNT(DISTINCT session_id) and
adds sessionsTouched to ActivityBucket. EventDetails type in the web
client now exposes details.category. +1 vitest case for the new column.
Full suite 369/369 (was 368).
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