Skip to content

Events summary KPIs and grouped event-name table (#185)#245

Merged
unjica merged 6 commits into
developfrom
feature/events-summary-grouped-185
Jul 7, 2026
Merged

Events summary KPIs and grouped event-name table (#185)#245
unjica merged 6 commits into
developfrom
feature/events-summary-grouped-185

Conversation

@unjica

@unjica unjica commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds GET /api/events/summary with filtered KPIs (total events, users, unique names, sessions) and prior-period compare.
  • Groups /api/events by event name by default (view=grouped); raw occurrence log via view=raw.
  • Dashboard: summary metrics row + grouped EventsTable with in-range counts, users, and share %.

Bugbot fixes

  • Share total uses flat COUNT(*) instead of nested aggregate over grouped SUM.
  • In-range counts honor enriched eventCountRange when only an upper bound is set.
  • View drill-down respects platform, release, and properties filters.
  • Legacy sort params (created_at, etc.) map to grouped sorts.

Test plan

  • pnpm lint && pnpm test && pnpm build
  • /dashboard/events — KPIs, grouped table, filters, sort, pagination
  • view=raw still shows occurrence log

Closes #185

Made with Cursor

Introduce GET /api/events/summary, grouped list view by default, and dashboard summary metrics with share-percent totals aligned to the KPI window.

Co-authored-by: Cursor <cursoragent@cursor.com>
@unjica unjica added this to the v1.5.0 — Analytics dashboard milestone Jul 7, 2026
Comment thread apps/api/src/lib/events-list-query.ts Outdated
Use resolveEventCountRangeBounds in attachLatestEventIds so all-time lists with eventCountRange link to occurrences inside the KPI window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/events-page-summary.ts
Enrich eventCountRange from the summary window so grouped counts, share %, and drill-down match KPI upper bounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/events-list-query.ts
Comment thread apps/api/src/lib/events-page-summary.ts
Filter grouped rows to names with in-range activity when a metrics window applies, and add ILIKE ESCAPE to buildEventWhereSql so table filters match summary KPIs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1e8c112. Configure here.

Comment thread apps/api/src/lib/events-list-query.ts Outdated
Apply in-range aggregate filters to timestamps, row metadata, and user/session counts so sort and Last seen match count_in_range and summary KPIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@unjica unjica merged commit a231b0d into develop Jul 7, 2026
3 checks passed
@unjica unjica deleted the feature/events-summary-grouped-185 branch July 7, 2026 18:57
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