Skip to content

Conversation

@lindesvard
Copy link
Contributor

@lindesvard lindesvard commented Jan 14, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Sankey chart type for visualizing event flows and transitions
    • Introduced dashboard and report sharing with optional password protection
    • Added embeddable counter and realtime visitor widgets
    • Enhanced dashboard layout editor with responsive grid support
  • Improvements

    • Expanded report configuration with unified options management
    • Added report duplication and management capabilities
    • Improved time-range override handling across reports

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
openpanel-public Error Error Jan 14, 2026 8:21am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a comprehensive refactoring from chart-centric to report-centric architecture, adds support for sharing dashboards and reports, implements a new Sankey chart type, introduces widget embedding capabilities (realtime and counter), and reorganizes report fields into an options-based structure while maintaining backward compatibility through schema updates.

Changes

Cohort / File(s) Summary
Validation & Schema
packages/validation/src/index.ts, packages/validation/src/types.validation.ts
Introduces zReportInput, zReport, zReportOptions (discriminated union: funnel, retention, sankey), zWidgetOptions, zShareDashboard, zShareReport; renames/replaces IChartInputIReportInput; removes zChartEvents; simplifies zChartSeries to straightforward array schema; adds widget and sharing validation schemas.
Database Migrations & Schema
packages/db/prisma/migrations/*, packages/db/prisma/schema.prisma
Adds new share_dashboards, share_reports, share_widgets tables; extends ChartType enum with 'sankey'; adds options JSONB field to reports; introduces sharing relationships in Organization, Project, Dashboard, Report models; expands EventMeta model.
Database Services
packages/db/src/services/sankey.service.ts, packages/db/src/services/share.service.ts, packages/db/src/services/reports.service.ts, packages/db/src/services/chart.service.ts, packages/db/src/services/conversion.service.ts, packages/db/src/services/funnel.service.ts
Adds new SankeyService with complex query building for three modes (before/after/between); extends ShareService with dashboard/report fetch and access validation helpers; migrates chart services to use IReportInput and options-based field handling; removes legacy funnelGroup/funnelWindow parameters.
Query Engine
packages/db/src/engine/index.ts, packages/db/src/engine/normalize.ts, packages/db/src/engine/types.ts, packages/db/src/engine/fetch.ts, packages/db/src/clickhouse/query-builder.ts
Updates function signatures from IChartInput to IReportInput; removes legacy fields from query construction; adds rawHaving() method to query builder; introduces IReportInputWithDates type.
Code Migrations
packages/db/code-migrations/9-migrate-options.ts, packages/db/index.ts
Adds migration to convert legacy criteria/funnelGroup/funnelWindow fields into options structure for funnel/retention charts; exports sankey.service.
TRPC Routers
packages/trpc/src/routers/chart.ts, packages/trpc/src/routers/report.ts, packages/trpc/src/routers/auth.ts, packages/trpc/src/routers/share.ts, packages/trpc/src/routers/widget.ts, packages/trpc/src/root.ts
Replaces zChartInput with zReportInput and adds shareId/reportId support across chart procedures for share-based access; extends auth.signInShare to support multiple share types (overview/dashboard/report); adds new share router with dashboard/report sharing CRUD and access validation; introduces new widget router with counter and realtime data endpoints; wires new routers into appRouter.
Frontend Components - Refactoring
apps/start/src/components/report-chart/context.tsx, apps/start/src/components/report-chart/common/previous-diff-indicator.tsx, apps/start/src/components/report-chart/metric/metric-card.tsx, apps/start/src/components/report-chart/shortcut.tsx, apps/start/src/components/overview/overview-top-events.tsx, apps/start/src/components/overview/overview-top-geo.tsx, apps/start/src/components/profiles/profile-charts.tsx
Migrates type imports from IChartInput/IChartProps to IReportInput/IReport; removes deprecated fields (lineType, name from chart config); updates ReportChart usage; removes hideID from options; removes previousIndicatorInverted logic.
Frontend Components - Chart Rendering
apps/start/src/components/report-chart/area/index.tsx, apps/start/src/components/report-chart/bar/index.tsx, apps/start/src/components/report-chart/conversion/index.tsx, apps/start/src/components/report-chart/funnel/index.tsx, apps/start/src/components/report-chart/histogram/index.tsx, apps/start/src/components/report-chart/line/index.tsx, apps/start/src/components/report-chart/map/index.tsx, apps/start/src/components/report-chart/metric/index.tsx, apps/start/src/components/report-chart/pie/index.tsx, apps/start/src/components/report-chart/retention/index.tsx
Adds useOverviewOptions hook usage to inject global date/range/interval overrides into TRPC queries; extends context destructuring to include shareId and reportId; merges overview options with report data in query construction.
Frontend Components - Sankey Chart
apps/start/src/components/report-chart/sankey/chart.tsx, apps/start/src/components/report-chart/sankey/index.tsx, apps/start/src/components/report/ReportChartType.tsx
Adds new Sankey chart component with ResponsiveSankey from @nivo, custom portal-based tooltip system, and ReportSankeyChart wrapper; registers sankey in chart type dropdown.
Frontend Components - Report Editor & Series
apps/start/src/components/report/reportSlice.ts, apps/start/src/components/report/sidebar/ReportSeries.tsx, apps/start/src/components/report/sidebar/ReportSeriesItem.tsx, apps/start/src/components/report/sidebar/report-fixed-events.tsx, apps/start/src/components/report/sidebar/ReportSettings.tsx, apps/start/src/components/report/sidebar/ReportSidebar.tsx
Refactors Redux state from IChartProps to IReport with new options field; adds Sankey-specific options handling (mode, steps, exclude, include); introduces ReportSeriesItem component and ReportFixedEvents for fixed event slots; migrates from inline rendering to composable series components; adds Sankey-aware UI toggles.
Frontend Components - Sharing & Modals
apps/start/src/components/auth/share-enter-password.tsx, apps/start/src/modals/share-dashboard-modal.tsx, apps/start/src/modals/share-report-modal.tsx, apps/start/src/modals/share-overview-modal.tsx, apps/start/src/modals/view-chart-users.tsx, apps/start/src/modals/overview-chart-details.tsx, apps/start/src/modals/save-report.tsx, apps/start/src/modals/index.tsx
Adds shareType prop to ShareEnterPassword; introduces new ShareDashboardModal and ShareReportModal components for managing dashboard/report sharing with password protection and copy-link features; extends ShareOverviewModal with share status UI and "Make private" action; updates modal prop types from IChartProps to IReport/IReportInput.
Frontend Components - Dashboard & Report Items
apps/start/src/components/report/report-item.tsx, apps/start/src/components/grafana-grid.tsx
Introduces ReportItem, ReportItemReadOnly, ReportItemSkeleton components for dashboard report listing; adds GrafanaGrid wrapper and useReportLayouts hook for responsive grid layout generation across multiple breakpoints with optional drag/resize.
Frontend Routes
apps/start/src/routes/share.dashboard.$shareId.tsx, apps/start/src/routes/share.report.$shareId.tsx, apps/start/src/routes/widget/realtime.tsx, apps/start/src/routes/widget/counter.tsx, apps/start/src/routes/widget/test.tsx, apps/start/src/routes/_app.$organizationId.$projectId.dashboards_.$dashboardId.tsx, apps/start/src/routes/_app.$organizationId.$projectId.settings._tabs.widgets.tsx, apps/start/src/routes/routeTree.gen.ts
Adds new public share routes (/share/dashboard/$shareId, /share/report/$shareId) with password protection and layout rendering; adds widget routes (/widget/realtime, /widget/counter, /widget/test) with WebSocket integration for real-time updates; refactors dashboard route to use GrafanaGrid and new report components; introduces widgets settings page with enable/disable and configuration UI; updates route tree with new route declarations.
Infrastructure & Configuration
apps/api/src/controllers/export.controller.ts, apps/api/src/controllers/webhook.controller.ts, apps/api/src/utils/ai-tools.ts, apps/start/package.json, apps/start/src/components/animated-number.tsx, apps/start/src/components/login-navbar.tsx, apps/start/src/components/organization/prompt-card.tsx, apps/start/src/components/report-chart/report-editor.tsx, apps/start/src/components/ui/combobox-events.tsx, apps/start/src/components/ui/label.tsx, apps/start/src/integrations/tanstack-query/root-provider.tsx, apps/start/src/routes/__root.tsx, apps/start/src/routes/_app.$organizationId.$projectId.dashboards.tsx, apps/start/src/routes/_app.$organizationId.$projectId.pages.tsx, apps/start/src/routes/_app.$organizationId.$projectId.reports_.$reportId.tsx, apps/start/src/routes/_app.$organizationId.$projectId.settings._tabs.tsx, apps/justfuckinguseopenpanel/*, package.json, packages/constants/index.ts, packages/db/src/types.ts, vitest.workspace.ts
Replaces validation schema imports to use zReport/zReportInput; updates webhook subscription status filter to include multiple statuses; adds dynamic Report AI tools usage; simplifies animated number component; updates link references; adds Tailwind styling; removes unused imports; adds logging to TRPC fetch; adds Share button to report editor; updates label styling; refreshes dependencies (@cloudflare/vite-plugin, wrangler); adds widget URL validation type; adds new justfuckinguseopenpanel marketing site with Wrangler config; adds sankey to chartTypes constants; excludes apps/start from vitest workspace.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Feature/billing #233: Adds widget routes and real-time widget handlers alongside this PR's widget embedding and sharing functionality at the code level.
  • fix: read-after-write issues #215: Modifies TRPC access patterns and project/organization access checks which align with this PR's new share-aware access control flow.

Poem

🐰 A rabbit's ode to refactoring dreams:

Charts become reports with options so fine,
Dashboards and reports now share and align,
Sankey flows branching like carrots divine,
Widgets tick, gleam, real-time designs,
Schema's renewed—a better by design! 🥕✨

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39251c8 and f880b9a.

⛔ Files ignored due to path filters (3)
  • apps/justfuckinguseopenpanel/favicon.ico is excluded by !**/*.ico
  • apps/justfuckinguseopenpanel/ogimage.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (102)
  • apps/api/src/controllers/export.controller.ts
  • apps/api/src/controllers/webhook.controller.ts
  • apps/api/src/utils/ai-tools.ts
  • apps/justfuckinguseopenpanel/index.html
  • apps/justfuckinguseopenpanel/screenshots/dashboard-dark.webp
  • apps/justfuckinguseopenpanel/screenshots/overview-dark.webp
  • apps/justfuckinguseopenpanel/screenshots/profile-dark.webp
  • apps/justfuckinguseopenpanel/screenshots/realtime-dark.webp
  • apps/justfuckinguseopenpanel/screenshots/report-dark.webp
  • apps/justfuckinguseopenpanel/wrangler.jsonc
  • apps/start/package.json
  • apps/start/src/components/animated-number.tsx
  • apps/start/src/components/auth/share-enter-password.tsx
  • apps/start/src/components/chat/chat-message.tsx
  • apps/start/src/components/chat/chat-report.tsx
  • apps/start/src/components/grafana-grid.tsx
  • apps/start/src/components/login-navbar.tsx
  • apps/start/src/components/organization/prompt-card.tsx
  • apps/start/src/components/overview/overview-top-events.tsx
  • apps/start/src/components/overview/overview-top-geo.tsx
  • apps/start/src/components/profiles/profile-charts.tsx
  • apps/start/src/components/report-chart/area/index.tsx
  • apps/start/src/components/report-chart/bar/index.tsx
  • apps/start/src/components/report-chart/common/previous-diff-indicator.tsx
  • apps/start/src/components/report-chart/context.tsx
  • apps/start/src/components/report-chart/conversion/index.tsx
  • apps/start/src/components/report-chart/funnel/chart.tsx
  • apps/start/src/components/report-chart/funnel/index.tsx
  • apps/start/src/components/report-chart/histogram/index.tsx
  • apps/start/src/components/report-chart/index.tsx
  • apps/start/src/components/report-chart/line/index.tsx
  • apps/start/src/components/report-chart/map/index.tsx
  • apps/start/src/components/report-chart/metric/index.tsx
  • apps/start/src/components/report-chart/metric/metric-card.tsx
  • apps/start/src/components/report-chart/pie/index.tsx
  • apps/start/src/components/report-chart/report-editor.tsx
  • apps/start/src/components/report-chart/retention/index.tsx
  • apps/start/src/components/report-chart/sankey/chart.tsx
  • apps/start/src/components/report-chart/sankey/index.tsx
  • apps/start/src/components/report-chart/shortcut.tsx
  • apps/start/src/components/report/ReportChartType.tsx
  • apps/start/src/components/report/report-item.tsx
  • apps/start/src/components/report/reportSlice.ts
  • apps/start/src/components/report/sidebar/ReportSeries.tsx
  • apps/start/src/components/report/sidebar/ReportSeriesItem.tsx
  • apps/start/src/components/report/sidebar/ReportSettings.tsx
  • apps/start/src/components/report/sidebar/ReportSidebar.tsx
  • apps/start/src/components/report/sidebar/report-fixed-events.tsx
  • apps/start/src/components/ui/combobox-events.tsx
  • apps/start/src/components/ui/label.tsx
  • apps/start/src/integrations/tanstack-query/root-provider.tsx
  • apps/start/src/modals/index.tsx
  • apps/start/src/modals/overview-chart-details.tsx
  • apps/start/src/modals/save-report.tsx
  • apps/start/src/modals/share-dashboard-modal.tsx
  • apps/start/src/modals/share-overview-modal.tsx
  • apps/start/src/modals/share-report-modal.tsx
  • apps/start/src/modals/view-chart-users.tsx
  • apps/start/src/routeTree.gen.ts
  • apps/start/src/routes/__root.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.dashboards.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.dashboards_.$dashboardId.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.pages.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.reports_.$reportId.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.settings._tabs.tsx
  • apps/start/src/routes/_app.$organizationId.$projectId.settings._tabs.widgets.tsx
  • apps/start/src/routes/share.dashboard.$shareId.tsx
  • apps/start/src/routes/share.overview.$shareId.tsx
  • apps/start/src/routes/share.report.$shareId.tsx
  • apps/start/src/routes/widget/counter.tsx
  • apps/start/src/routes/widget/realtime.tsx
  • apps/start/src/routes/widget/test.tsx
  • package.json
  • packages/constants/index.ts
  • packages/db/code-migrations/9-migrate-options.ts
  • packages/db/index.ts
  • packages/db/prisma/migrations/20251219125331_report_options/migration.sql
  • packages/db/prisma/migrations/20260109144217_add_share_dashboard_and_report/migration.sql
  • packages/db/prisma/migrations/20260113151311_add_share_widget/migration.sql
  • packages/db/prisma/schema.prisma
  • packages/db/src/clickhouse/query-builder.ts
  • packages/db/src/engine/fetch.ts
  • packages/db/src/engine/index.ts
  • packages/db/src/engine/normalize.ts
  • packages/db/src/engine/types.ts
  • packages/db/src/services/chart.service.ts
  • packages/db/src/services/conversion.service.ts
  • packages/db/src/services/funnel.service.ts
  • packages/db/src/services/reports.service.ts
  • packages/db/src/services/sankey.service.ts
  • packages/db/src/services/share.service.ts
  • packages/db/src/types.ts
  • packages/trpc/src/root.ts
  • packages/trpc/src/routers/auth.ts
  • packages/trpc/src/routers/chart.ts
  • packages/trpc/src/routers/report.ts
  • packages/trpc/src/routers/share.ts
  • packages/trpc/src/routers/widget.ts
  • packages/validation/src/index.ts
  • packages/validation/src/test.ts
  • packages/validation/src/types.validation.ts
  • vitest.workspace.ts

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

@lindesvard lindesvard merged commit ed1c57d into main Jan 14, 2026
3 of 6 checks passed
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.

2 participants