Skip to content

feat(admin): add frontend onboarding analytics - #2977

Merged
WcaleNieWolny merged 26 commits into
mainfrom
wolny/frontend-onboarding-dashboard
Aug 11, 2026
Merged

feat(admin): add frontend onboarding analytics#2977
WcaleNieWolny merged 26 commits into
mainfrom
wolny/frontend-onboarding-dashboard

Conversation

@WcaleNieWolny

@WcaleNieWolny WcaleNieWolny commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a read-only Frontend onboarding page to the platform-admin dashboard.
  • Show four KPI cards, daily attempt volume, and a stage-to-stage funnel for the fixed pre_org / onboarding_version = 1 flow.
  • Reuse the PostHog transport and Builder analytics infrastructure merged in feat(admin): add Plans analytics dashboard #2976; this PR adds no competing transport implementation.

Motivation

The existing admin views do not show where new users leave the first app-creation wizard. A dedicated funnel makes the early Intent → Details → Organization → Setup path measurable without mixing it with existing-organization or demo flows.

Business Impact

This gives the team a day-by-day view of onboarding volume, completion, time to setup, and the largest transition drop-off. It should make confusing steps easier to identify and prioritize, helping improve first-app activation.

Test Plan

Analytics contract:

  • Group one attempt by onboarding_attempt_id, cohort-started by its first Intent view.
  • Accept progression events for 24 hours after Intent.
  • Treat viewing setup as early-onboarding completion; CLI execution is intentionally outside this funnel.
  • Bound the selected range to 365 days and fail closed above 50,000 analyzed attempts.
  • Reuse the existing admin, PostHog, and chart infrastructure.

Verification:

  • Focused onboarding/admin tests pass.
  • Full unit suite passes: 218 files, 1,707 tests.
  • Frontend and backend lint pass.
  • Frontend and backend typechecks pass.
  • Production build passes.

Summary by CodeRabbit

  • New Features
    • Added a read-only admin dashboard for frontend onboarding analytics.
    • Added KPI cards, daily attempt trends, funnel progression, drop-off insights, completion rates, and median completion time.
    • Added date-range comparisons, loading and error states, localized labels, and a fixed version-1 view.
    • Added the dashboard to admin navigation.
  • Tests
    • Added coverage for analytics calculations, validation, data loading, error handling, and dashboard behavior.
  • Documentation
    • Added implementation and design specifications for the dashboard.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4071bbcd-8aee-43f0-b70a-1d8226b1d43d

📥 Commits

Reviewing files that changed from the base of the PR and between 3ac7069 and 7ae8f03.

📒 Files selected for processing (3)
  • docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md
  • src/services/adminFrontendOnboarding.ts
  • tests/admin-frontend-onboarding-dashboard.unit.test.ts
📝 Walkthrough

Walkthrough

Adds a read-only platform-admin frontend onboarding dashboard for version 1 pre_org attempts. It adds PostHog aggregation, backend dispatch, frontend adapters, navigation, translations, Vue rendering, and comprehensive tests.

Changes

Frontend onboarding analytics

Layer / File(s) Summary
Analytics model and cohort rules
docs/superpowers/specs/..., supabase/functions/_backend/utils/frontend_onboarding_analytics_model.ts, tests/frontend-onboarding-analytics-model.unit.test.ts
Defines 24-hour onboarding progression, funnel stages, KPIs, UTC daily counts, previous-period comparisons, empty-period behavior, and range validation.
PostHog query and backend orchestration
docs/superpowers/plans/..., supabase/functions/_backend/utils/frontend_onboarding_analytics.ts, tests/frontend-onboarding-analytics.unit.test.ts
Builds bounded pre_org HogQL queries, validates dates and attempt metadata, maps valid rows, and returns aggregated analytics with PostHog status fields.
Admin statistics registration
src/stores/adminDashboard.ts, supabase/functions/_backend/private/admin_stats.ts, tests/admin-stats.unit.test.ts
Adds frontend_onboarding_analytics to metric validation, typing, and dispatch.
Dashboard loading and presentation
src/services/adminFrontendOnboarding.ts, src/pages/admin/dashboard/frontend-onboarding.vue, src/constants/adminTabs.ts, messages/en.json, messages/en.context.json, tests/admin-frontend-onboarding-dashboard.unit.test.ts
Adds request handling, response adapters, localized KPI and funnel rendering, daily charts, admin navigation, loading indicators, and stale-response protection.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant FrontendOnboardingPage
  participant AdminDashboardStore
  participant admin_stats
  participant PostHog
  Admin->>FrontendOnboardingPage: select date range
  FrontendOnboardingPage->>AdminDashboardStore: request analytics
  AdminDashboardStore->>admin_stats: dispatch metric category
  admin_stats->>PostHog: execute HogQL query
  PostHog-->>admin_stats: grouped onboarding rows
  admin_stats-->>AdminDashboardStore: analytics response
  AdminDashboardStore-->>FrontendOnboardingPage: display KPI and funnel data
Loading

Possibly related PRs

Suggested labels: codex

Suggested reviewers: riderx

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: adding frontend onboarding analytics to the admin dashboard.
Description check ✅ Passed The description includes a clear summary, motivation, business impact, detailed test plan, and verification results.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@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.

Stale comment

Risk: medium. Left a non-blocking comment — this admin analytics change (frontend dashboard + private PostHog aggregation) is above the low-risk auto-approve threshold, and Cursor Bugbot was not present to provide a clean signal. Human review is needed; assigning a reviewer.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor
cursor Bot requested a review from riderx August 10, 2026 09:41
@codspeed-hq

codspeed-hq Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing wolny/frontend-onboarding-dashboard (7ae8f03) with main (25ce4b7)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 17 files

Confidence score: 4/5

  • In src/pages/admin/dashboard/frontend-onboarding.vue, the AdminFunnelChart and AdminStatsCard loading states use unprefixed DaisyUI spinner classes, so date-range refreshes can appear blank and make users think data failed to load—switch those spans to d-loading d-loading-spinner d-loading-lg (or the configured d- variants) to restore visible loading feedback.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/pages/admin/dashboard/frontend-onboarding.vue">

<violation number="1" location="src/pages/admin/dashboard/frontend-onboarding.vue:135">
P2: KPI cards show an empty loading area during date-range refreshes because `AdminStatsCard` uses unprefixed DaisyUI spinner classes. Update that component’s spinner classes to `d-loading d-loading-spinner d-loading-lg` so this page has a visible loading state.</violation>

<violation number="2" location="src/pages/admin/dashboard/frontend-onboarding.vue:176">
P2: The funnel becomes blank rather than visibly loading after a date-range change because `AdminFunnelChart` uses unprefixed DaisyUI spinner classes. Update its loading span to use the configured `d-loading` class names.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread supabase/functions/_backend/utils/frontend_onboarding_analytics.ts
Comment thread src/pages/admin/dashboard/frontend-onboarding.vue
Comment thread src/pages/admin/dashboard/frontend-onboarding.vue
Comment thread supabase/functions/_backend/utils/frontend_onboarding_analytics.ts
Comment thread src/services/adminFrontendOnboarding.ts Outdated
Comment thread messages/en.json Outdated
Comment thread docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md Outdated
Comment thread docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md Outdated
Comment thread supabase/functions/_backend/utils/frontend_onboarding_analytics.ts Outdated
…ding-dashboard

# Conflicts:
#	src/constants/adminTabs.ts
#	src/stores/adminDashboard.ts
#	supabase/functions/_backend/private/admin_stats.ts
#	supabase/functions/_backend/utils/builder_analytics.ts
#	supabase/functions/_backend/utils/posthog_read.ts
#	tests/posthog-read.unit.test.ts

@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.

Stale comment

Risk: medium. Left a non-blocking comment — this admin analytics change (dashboard UI + private PostHog aggregation) is above the low-risk auto-approve threshold, and Cursor Bugbot was not present. Human review is needed; riderx is already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md`:
- Around line 1413-1422: Update the validation instructions in
docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md at
lines 1413-1422 to run bun run lint:fix before bun run lint and bun run
typecheck:frontend, and update lines 1454-1462 to run bun run lint:fix before
the repository validation commands; ensure both validation sequences and the
frontend commit workflow always apply the auto-fix first.
- Around line 1511-1518: Update the PR creation instructions in the onboarding
admin dashboard plan to require AI-generated sections titled Summary,
Motivation, Business Impact, and Test Plan before creating the pull request.
Include the existing PR description requirements in the Test Plan or appropriate
sections, and ensure Task 7 explicitly enforces these sections.

In `@tests/admin-stats.unit.test.ts`:
- Around line 63-70: Update the test case for the frontend onboarding analytics
metric to use the concurrent test variant by changing its `it` declaration to
`it.concurrent`, while preserving the existing schema parsing and assertion.

In `@tests/frontend-onboarding-analytics-model.unit.test.ts`:
- Around line 23-193: Convert the independent tests in
tests/frontend-onboarding-analytics-model.unit.test.ts (lines 23-193) and
tests/admin-frontend-onboarding-dashboard.unit.test.ts (lines 127-343) from it()
to it.concurrent(), using it.concurrent.each() for parameterized cases. Leave
the four already-concurrent adapter tests unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75994039-1ead-406d-a162-b58be37fb38f

📥 Commits

Reviewing files that changed from the base of the PR and between 896347d and f2914de.

📒 Files selected for processing (15)
  • docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md
  • docs/superpowers/specs/2026-08-10-frontend-onboarding-admin-dashboard-design.md
  • messages/en.context.json
  • messages/en.json
  • src/constants/adminTabs.ts
  • src/pages/admin/dashboard/frontend-onboarding.vue
  • src/services/adminFrontendOnboarding.ts
  • src/stores/adminDashboard.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/utils/frontend_onboarding_analytics.ts
  • supabase/functions/_backend/utils/frontend_onboarding_analytics_model.ts
  • tests/admin-frontend-onboarding-dashboard.unit.test.ts
  • tests/admin-stats.unit.test.ts
  • tests/frontend-onboarding-analytics-model.unit.test.ts
  • tests/frontend-onboarding-analytics.unit.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md Outdated
Comment thread docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md Outdated
Comment thread tests/admin-stats.unit.test.ts Outdated
Comment thread tests/frontend-onboarding-analytics-model.unit.test.ts Outdated

@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.

Stale comment

Risk: medium. Left a non-blocking comment — admin onboarding analytics (UI + private PostHog aggregation) is above the low-risk auto-approve threshold, and Cursor Bugbot was not present. Human review is needed; riderx is already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@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.

Stale comment

Risk: medium. Left a non-blocking comment — admin onboarding analytics (UI + private PostHog aggregation) is above the low-risk auto-approve threshold, and Cursor Bugbot was not present. Human review is needed; riderx is already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@coderabbitai coderabbitai Bot added the codex label Aug 11, 2026

@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.

Risk: medium. Left a non-blocking comment — admin onboarding analytics (UI + private PostHog aggregation) is above the low-risk auto-approve threshold, and Cursor Bugbot was not present. Human review is needed; riderx is already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 12 files (changes from recent commits).

Confidence score: 4/5

  • In docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md, the stage-to-stage conversion summary logic appears to report 100% when a prior stage count is zero, which can misstate funnel health and mislead onboarding decisions. Update the conversion rule to treat zero-predecessor transitions as 0% or N/A so later-stage percentages can’t appear artificially perfect.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md">

<violation number="1" location="docs/superpowers/plans/2026-08-10-frontend-onboarding-admin-dashboard.md:1414">
P2: The stage-to-stage conversion summaries show 100% for any later stage whose immediate predecessor reached zero, which misrepresents the funnel: with reached [10,8,0,0] the Organization stage shows 0% but Setup shows 100% even though nobody reached it. Guard the conversion so a zero-reached previous stage reports 0% (or null) instead of 100% — this case (a stage collapsing entirely while the cohort has attempts) is plausibly common in onboarding dropoff and is not covered by the existing zero-cohort test.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant