feat(admin): chart registration sources - #2963
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds daily registration-source analytics to the admin onboarding response and users dashboard. The change classifies accounts into three sources, zero-fills dates, adds a reusable stacked-bar chart, translations, integration fixtures, and frontend/backend tests. ChangesRegistration source trend
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AdminDashboard
participant getAdminOnboardingFunnel
participant auth_users
participant public_users
participant AdminStackedBarChart
AdminDashboard->>getAdminOnboardingFunnel: request onboarding metrics
getAdminOnboardingFunnel->>auth_users: read account creation dates
getAdminOnboardingFunnel->>public_users: match profiles and invite status
getAdminOnboardingFunnel-->>AdminDashboard: return registration_source_trend
AdminDashboard->>AdminStackedBarChart: provide three chart series
AdminStackedBarChart-->>AdminDashboard: render stacked daily chart
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
There was a problem hiding this comment.
Stale comment
Risk: medium. Left a non-blocking comment rather than approving: Cursor Bugbot was not present, and this admin registration-source trend (auth.users SQL + dashboard UI) is above the low-risk auto-approve threshold. Assigned a reviewer for human review.
Sent by Cursor Approval Agent: Pull Request Approver External
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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-09-admin-registration-source-trend.md`:
- Line 13: Update the task headings in the document from level-three headings
(`###`) to level-two headings (`##`), including the headings at all referenced
locations, so they follow the level-one title without skipping a hierarchy
level.
- Around line 168-173: Update the commit steps for backend and frontend changes
to run the required lint command immediately before each commit: use bun
lint:backend for the backend commit and bun lint:fix for each frontend commit.
Apply this to the referenced steps as well, without relying on the later
validation step.
In `@src/components/admin/AdminStackedBarChart.vue`:
- Around line 2-16: Update the local imports in the AdminStackedBarChart
component to use the frontend ~ alias, replacing both relative references to
adminStackedBarChart with ~/components/admin/adminStackedBarChart while
preserving the imported symbols.
In `@supabase/functions/_backend/utils/pg.ts`:
- Around line 3444-3450: Update the registration bucket filters in the query
around normal_registrations and invite_registrations so profiles with a null
created_via_invite value are counted as non-invite profiles. Use
u.created_via_invite IS DISTINCT FROM TRUE for normal_registrations while
keeping invite_registrations limited to TRUE, ensuring every matching profile is
included in a bucket.
In `@tests/admin-stats.test.ts`:
- Around line 1203-1228: Extend the test around getOnboardingFunnelDirect to
issue a request ending at 2026-02-02T00:00:00.000Z, then assert the user created
exactly at that timestamp is absent from the returned registration_source_trend.
Preserve the existing full-range assertions while explicitly verifying the end
boundary is exclusive.
🪄 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: 8a1450af-ea6a-4444-bf5c-82be8ab02774
📒 Files selected for processing (10)
docs/superpowers/plans/2026-08-09-admin-registration-source-trend.mddocs/superpowers/specs/2026-08-09-admin-registration-source-trend-design.mdmessages/en.jsonsrc/components/admin/AdminStackedBarChart.vuesrc/components/admin/adminStackedBarChart.tssrc/pages/admin/dashboard/users.vuesupabase/functions/_backend/utils/pg.tstests/admin-registration-source-dashboard.unit.test.tstests/admin-stacked-bar-chart.unit.test.tstests/admin-stats.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Risk: medium. Left a non-blocking comment rather than approving: Cursor Bugbot was not present after the first poll, and this admin registration-source trend (auth.users SQL + dashboard UI) is above the low-risk auto-approve threshold. Human review is needed; a reviewer is already assigned.
Sent by Cursor Approval Agent: Pull Request Approver External
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/superpowers/plans/2026-08-09-admin-registration-source-trend.md (1)
95-103: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winReset the database before the integration test commands.
These commands run
tests/admin-stats.test.ts, which inserts rows intoauth.usersandpublic.users. Without a reset, stale rows from an earlier run can change the expected daily counts and make the regression test order-dependent. Addbun run supabase:db:resetimmediately before each database-backed test run, or make the test command perform that reset.As per coding guidelines, database-backed test runs must reset the database before execution.
Proposed command change
- bunx vitest run tests/admin-stats.test.ts -t "returns subscribed as the last onboarding funnel step without exceeding the bundle cohort|returns every auth registration in exactly one daily profile bucket" + bun run supabase:db:reset + bunx vitest run tests/admin-stats.test.ts -t "returns subscribed as the last onboarding funnel step without exceeding the bundle cohort|returns every auth registration in exactly one daily profile bucket"Also applies to: 450-458
🤖 Prompt for 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. In `@docs/superpowers/plans/2026-08-09-admin-registration-source-trend.md` around lines 95 - 103, Update each documented database-backed test command in this plan to run bun run supabase:db:reset immediately beforehand, including the focused integration test command in Step 2 and the corresponding command at the other referenced section. Preserve the existing Vitest arguments and expected results.Source: Coding guidelines
🤖 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.
Outside diff comments:
In `@docs/superpowers/plans/2026-08-09-admin-registration-source-trend.md`:
- Around line 95-103: Update each documented database-backed test command in
this plan to run bun run supabase:db:reset immediately beforehand, including the
focused integration test command in Step 2 and the corresponding command at the
other referenced section. Preserve the existing Vitest arguments and expected
results.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9eeebb08-50aa-4f3d-82f2-388dddec8bf2
📒 Files selected for processing (3)
docs/superpowers/plans/2026-08-09-admin-registration-source-trend.mdsrc/components/admin/AdminStackedBarChart.vuetests/admin-stats.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
|





Summary
Test plan
Summary by CodeRabbit
New Features
Tests