Skip to content

feat(dashboards): Add optional onboarding widgets for prebuilt dashboards#110244

Merged
gggritso merged 7 commits intomasterfrom
georgegritsouk/dain-1207-add-optional-onboarding-widgets-for-prebuilt-dashboard
Mar 11, 2026
Merged

feat(dashboards): Add optional onboarding widgets for prebuilt dashboards#110244
gggritso merged 7 commits intomasterfrom
georgegritsouk/dain-1207-add-optional-onboarding-widgets-for-prebuilt-dashboard

Conversation

@gggritso
Copy link
Member

@gggritso gggritso commented Mar 9, 2026

Extends the prebuilt dashboard configuration to optionally declare an onboarding condition so the renderer can show onboarding when no selected projects have relevant telemetry data.

Prebuilt dashboards always render widget grids, even when no selected projects have relevant telemetry. The Insights module pages handle this by checking project flags and showing onboarding panels, but PrebuiltDashboardRenderer had no onboarding awareness. This adds an onboarding field to PrebuiltDashboard configs with three variants:

  • module — delegates to the existing ModulesOnboarding flow (LegacyOnboarding + ModulesOnboardingPanel)
  • custom — renders dedicated onboarding components for AI Agents and MCP dashboards
  • overview — shows a generic onboarding panel for multi-module overview dashboards (backend, frontend, Next.js, Laravel) when none of the required project flags are set

e.g.,

Screenshot 2026-03-09 at 3 47 12 PM Screenshot 2026-03-09 at 3 47 40 PM Screenshot 2026-03-09 at 3 48 01 PM

All 28 prebuilt dashboards now have onboarding configurations.

Refs DAIN-1207

gggritso and others added 3 commits March 9, 2026 13:37
…ards

Extend prebuilt dashboard configs with an OnboardingConfig that shows
onboarding panels when selected projects lack relevant telemetry data.
Supports three variants: module-based (generic Insights onboarding),
custom (lazy-loaded AI Agent/MCP onboarding), and overview (multi-flag
check for dashboards like Backend Overview).

All 28 prebuilt dashboard configs now declare their onboarding type,
and the PrebuiltDashboardRenderer conditionally renders the appropriate
onboarding panel instead of dashboard widgets.

Refs DAIN-1207
Co-Authored-By: Claude <noreply@anthropic.com>
Inline the ModulesOnboarding gate logic directly into
PrebuiltDashboardOnboardingGate instead of wrapping children.
Extract props interface, rename projectFlags to requiredProjectFlags,
update overview descriptions to mention tracing, and improve the
overview onboarding panel layout with max-width constraint.

Refs DAIN-1207
Co-Authored-By: Claude <noreply@anthropic.com>
Rename OverviewOnboardingPanel to GenericOnboarding, remove useEffect
for reloading projects, and improve readability of the onboarding gate
with clearer variable names and comments.

Refs DAIN-1207
Co-Authored-By: Claude <noreply@anthropic.com>
@linear-code
Copy link

linear-code bot commented Mar 9, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 9, 2026
…-1207-add-optional-onboarding-widgets-for-prebuilt-dashboard

; Conflicts:
;	static/app/views/dashboards/detail.tsx
;	static/app/views/dashboards/utils/prebuiltConfigs/mobileVitals/mobileVitals.ts
The merge conflict resolution incorrectly kept a useTimeseriesVisualization
prop that was removed from master, causing TypeScript and Jest failures.

Co-Authored-By: Claude <noreply@anthropic.com>
@gggritso
Copy link
Member Author

gggritso commented Mar 9, 2026

@sentry review

@gggritso
Copy link
Member Author

gggritso commented Mar 9, 2026

@cursor review

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Session health dashboards permanently stuck showing onboarding
    • I updated the module onboarding gate to honor requiredProjectFlags for module dashboards, so session health dashboards render widgets when selected projects have hasSessions data.

Create PR

Or push these changes by commenting:

@cursor push c748ebd052
Preview (c748ebd052)
diff --git a/static/app/views/dashboards/components/prebuiltDashboardOnboardingGate.tsx b/static/app/views/dashboards/components/prebuiltDashboardOnboardingGate.tsx
--- a/static/app/views/dashboards/components/prebuiltDashboardOnboardingGate.tsx
+++ b/static/app/views/dashboards/components/prebuiltDashboardOnboardingGate.tsx
@@ -44,9 +44,22 @@
     return children;
   }
 
+  const selectedProjects = getSelectedProjectList(
+    pageFilters.selection.projects,
+    projects
+  );
+  const hasRequiredProjectFlagData =
+    onboarding.requiredProjectFlags?.some(flag =>
+      selectedProjects.some(p => p[flag] === true)
+    ) ?? false;
+
   // If the dashboard uses module-specific onboarding, check whether
   // module-specific data is available
   if (onboarding.type === 'module') {
+    if (hasRequiredProjectFlagData) {
+      return children;
+    }
+
     if (!hasAnySpanData) {
       return (
         <ModuleLayout.Full>
@@ -66,16 +79,7 @@
     return children;
   }
 
-  const selectedProjects = getSelectedProjectList(
-    pageFilters.selection.projects,
-    projects
-  );
-
-  const hasData = onboarding.requiredProjectFlags.some(flag =>
-    selectedProjects.some(p => p[flag] === true)
-  );
-
-  if (hasData) {
+  if (hasRequiredProjectFlagData) {
     return children;
   }
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Session health dashboards were using type: 'module' with
ModuleName.SESSIONS, but useHasFirstSpan excludes SESSIONS and always
returns false — permanently showing the onboarding panel. Switch to
type: 'overview' which correctly checks requiredProjectFlags instead.

Co-Authored-By: Claude <noreply@anthropic.com>
@gggritso gggritso marked this pull request as ready for review March 10, 2026 16:11
@gggritso gggritso requested a review from a team as a code owner March 10, 2026 16:11
Copy link
Contributor

@DominikB2014 DominikB2014 left a comment

Choose a reason for hiding this comment

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

lgtm overall, although i think we can refactor this to be a bit simpler imo (but lmk what you think!). Regardless, a refactor isn't blocking

Comment on lines +71 to +89
| {
moduleName: ModulesWithOnboarding;
// Single-module onboarding: shows ModulesOnboardingPanel
type: 'module';
requiredProjectFlags?: ProjectTelemetryFlag[];
}
| {
componentId: 'agent-monitoring' | 'mcp';
requiredProjectFlags: ProjectTelemetryFlag[];
// Custom onboarding component (AI Agents, MCP)
type: 'custom';
}
| {
description: string;
requiredProjectFlags: ProjectTelemetryFlag[];
// Overview dashboard onboarding: shows a generic onboarding panel
// when NONE of the listed project flags are set
type: 'overview';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I do wonder if having three types is necessary here? custom and overview are very similar, overview seems like it could just be a custom with componentId: 'overview'?

In fact i'm wondering if we need types at all here, although it would require some rejigging, it feels simpler imo if each prebuilt config just mapped to the id of their onboarding component. If we didn't care about duplication, we could even just make this a function that returns a onboarding component.

Copy link
Member Author

Choose a reason for hiding this comment

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

They do have slightly different behaviour because depending on the type of onboarding, it has to run different checks. Plus, the different onboarding components accept different kinds of props 😬

@gggritso gggritso merged commit 8d79500 into master Mar 11, 2026
59 checks passed
@gggritso gggritso deleted the georgegritsouk/dain-1207-add-optional-onboarding-widgets-for-prebuilt-dashboard branch March 11, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants