feat(admin): channel surfing adoption dashboard - #3005
Conversation
Surface setChannel stats (already emitted by channel_self) in a platform-admin dashboard with events, devices, apps, trends, and top apps. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 30 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 (3)
📝 WalkthroughWalkthroughAdds channel-surfing event tracking, backend aggregation through Analytics Engine or PostgreSQL, admin statistics API support, and a localized dashboard with charts and tables. ChangesChannel surfing analytics
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Admin as Admin dashboard
participant API as admin_stats
participant Stats as getAdminChannelSurfing
participant Analytics as Analytics Engine
participant DB as PostgreSQL
Admin->>API: Request channel_surfing data
API->>Stats: Pass date range and app_id
Stats->>Analytics: Query aggregated statistics in workerd
Stats->>DB: Query public.stats otherwise
Stats-->>API: Return channel-surfing statistics
API-->>Admin: Render metrics and charts
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 |
|
Temporarily closing so push CI can run (push suite skips when an open PR covers the branch). |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing briefly so push CI can run the full suite (open PR causes push suite skip, and pull_request Run tests was not firing for this branch). |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Stale comment
Risk: medium. Left a non-blocking comment and did not approve — this exceeds the configured low-risk threshold (new admin adoption metrics plus a plugin
channel_selflogging change). Assigned a human reviewer; Cursor Bugbot was not present on this PR.Sent by Cursor Approval Agent: Pull Request Approver External
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Stale comment
Risk: medium. Left a non-blocking comment and did not approve — this exceeds the configured low-risk threshold (new admin adoption metrics plus a plugin
channel_selflogging change). Human review is already requested; Cursor Bugbot was not present on this PR.Sent by Cursor Approval Agent: Pull Request Approver External
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Guard against stale fetches, fix DaisyUI spinner prefix on admin cards, clarify i18n roles, and cover the Cloudflare analytics path in unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing briefly to run full push CI on review-fix commit (open PR skips push suite). |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Risk: medium. Left a non-blocking comment and did not approve — this exceeds the configured low-risk threshold (new admin adoption metrics plus a plugin channel_self logging change). Human review is already requested; Cursor Bugbot was not present on this PR.
Sent by Cursor Approval Agent: Pull Request Approver External
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing briefly for full CI on loader fix. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
❌ The last analysis has failed. |
…rfing-dashboard Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/stores/adminDashboard.ts # supabase/functions/_backend/private/admin_stats.ts # tests/admin-stats.unit.test.ts
Visual diff passedVisual changesGenerated at 2026-08-12T10:25:48.550Z. Threshold: 0.1% pixel difference.
Commit: Open |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@supabase/functions/_backend/plugin_runtime/plugins/channel_self.ts`:
- Line 549: In the delete flow around sendStatsAndDevice, catch telemetry
failures after the override has been deleted and log them without propagating
the rejection. Preserve the existing BRES response, fields, and status code so a
successful deletion remains successful even when telemetry persistence fails.
In `@supabase/functions/_backend/utils/channel_surfing.ts`:
- Around line 193-195: Update the catch path in the channel-surfing helper to
propagate a typed error or return an explicit unavailable state instead of
emptyAdminChannelSurfingStats(), while preserving error logging; update
tests/channel-surfing.unit.test.ts lines 115-131 to assert the new unavailable
or error contract.
🪄 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: 8102e87b-4384-469b-9811-a686e942fb7f
📒 Files selected for processing (12)
artifacts/channel-surfing-dashboard.webpmessages/en.context.jsonmessages/en.jsonsrc/constants/adminTabs.tssrc/pages/admin/dashboard/channel-surfing.vuesrc/route-map.d.tssrc/stores/adminDashboard.tssupabase/functions/_backend/plugin_runtime/plugins/channel_self.tssupabase/functions/_backend/private/admin_stats.tssupabase/functions/_backend/utils/channel_surfing.tstests/admin-stats.unit.test.tstests/channel-surfing.unit.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
Telemetry must not flip a finished override delete into an error. Analytics outages must not look like zero channel-surfing adoption. Co-authored-by: Cursor <cursoragent@cursor.com>
|





Summary (AI generated)
setChannelis already logged via/channel_self(sendStatsAndDevicewith actionsetChannel)channel_surfing(Cloudflareapp_login prod, Postgresstatsfallback locally)setChannelon successful override delete for older plugins (parity with set path)Motivation (AI generated)
Need platform visibility into channel self-assignment (“channel surfing”) adoption: how many devices and apps use it, and how that evolves over time.
Business Impact (AI generated)
Helps Capgo measure feature adoption of device channel self-assignment and prioritize product/docs investment where usage is growing.
Visual changes (AI generated)
Test Plan (AI generated)
bunx vitest run tests/channel-surfing.unit.test.ts tests/admin-stats.unit.test.ts25f901e13/admin/dashboard/channel-surfingGenerated with AI
Summary by CodeRabbit