Skip to content

Conversation

@riderx
Copy link
Member

@riderx riderx commented Feb 11, 2026

Summary (AI generated)

  • Track daily demo app creations in global_stats via new demo_apps_created column
  • Add backend aggregation in logsnag_insights and expose it through global_stats_trend
  • Add a Demo Apps Created series to the admin Users Onboarding Trend chart

Motivation (AI generated)

  • Measure adoption of the new onboarding demo-app flow day by day in existing admin metrics

Business Impact (AI generated)

  • Gives visibility into onboarding effectiveness for non-technical users and supports funnel optimization decisions

Test plan (AI generated)

  • Run bun lint
  • Run bun lint:backend

Screenshots (AI generated)

  • Not included (metric plumbing + existing chart series addition)

Checklist (AI generated)

  • My code follows the code style of this project and passes
    bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation
    accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce
    my tests

Generated with AI

Copilot AI review requested due to automatic review settings February 11, 2026 04:01
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch riderx/demo-app-daily-stats

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8427aa92af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +523 to +524
.gte('created_at', todayStartIso)
.lt('created_at', tomorrowStartIso)

Choose a reason for hiding this comment

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

P1 Badge Count demo apps over the full reporting window

This query only counts demo apps between UTC midnight and the next midnight, but logsnag_insights is enqueued by process_admin_stats once per day (see the admin_stats cron task scheduled at 01:01 UTC in supabase/migrations/20251228215402_add_orphan_images_cleanup.sql), so each stored value captures roughly the first hour of the day instead of a full day; that makes the new onboarding trend series systematically undercount and mislead experiment analysis.

Useful? React with 👍 / 👎.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new admin-facing onboarding metric by persisting a daily count of demo app creations into global_stats, exposing it via the admin global-stats trend API, and plotting it on the admin “Onboarding Trend” chart.

Changes:

  • Add demo_apps_created column to public.global_stats (with default 0) and update generated Supabase DB types.
  • Aggregate demo app creations in logsnag_insights and include the value in global_stats_trend results.
  • Display a new “Demo Apps Created” series on the admin Users dashboard onboarding trend chart.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
supabase/migrations/20260211034517_add_demo_apps_created_to_global_stats.sql Adds demo_apps_created column + column comment.
supabase/functions/_backend/utils/supabase.types.ts Updates backend generated DB typings for global_stats.
supabase/functions/_backend/utils/pg.ts Extends AdminGlobalStatsTrend and query mapping to include demo_apps_created.
supabase/functions/_backend/triggers/logsnag_insights.ts Computes and upserts demo_apps_created into global_stats.
src/types/supabase.types.ts Updates frontend generated DB typings for global_stats.
src/pages/admin/dashboard/users.vue Adds “Demo Apps Created” series to onboarding trend chart.

ALTER TABLE public.global_stats
ADD COLUMN demo_apps_created integer NOT NULL DEFAULT 0;

COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created in the last 24 hours';
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The column comment says this metric is for "the last 24 hours", but the implementation in logsnag_insights counts demo apps within the current UTC day window (00:00–24:00 UTC). Either update the comment to reflect the UTC-day semantics, or change the aggregation to use a rolling last-24h window for consistency with the column description.

Suggested change
COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created in the last 24 hours';
COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created during the current UTC day (00:00–24:00 UTC)';

Copilot uses AI. Check for mistakes.
Comment on lines +521 to +525
.from('apps')
.select('id', { count: 'exact', head: true })
.gte('created_at', todayStartIso)
.lt('created_at', tomorrowStartIso)
.like('app_id', `${DEMO_APP_PREFIX}%`)
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This query counts demo apps using a UTC calendar-day window (created_at >= todayStartIso and < tomorrowStartIso). The migration/comment/PR text describe "last 24 hours" and other metrics here use the rolling last24h window, so the semantics are inconsistent (and can be a partial-day count depending on when the cron runs). Either switch to gte('created_at', last24h) or rename/document this as "created today (UTC)" end-to-end.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

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