Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

refactor(dashboards): move the rest of the dashboards frontend into the product (#128915)

Thomas Obermüller154ee9087c1c
diff --git a/.agents/skills/manage-dashboard-widgets/references/layout-and-ux.md b/.agents/skills/manage-dashboard-widgets/references/layout-and-ux.md
index ea052234718d..02c92e1ed836 100644
--- a/.agents/skills/manage-dashboard-widgets/references/layout-and-ux.md
+++ b/.agents/skills/manage-dashboard-widgets/references/layout-and-ux.md
@@ -22,7 +22,7 @@ react-grid-layout minW / minH on each item ← enforced while resizing in edit
- Grid is **12 columns** wide (`w` / `minW` are column counts).
- Height is in **row units** (`h` / `minH`), not columns — users may say “3 rows tall” or “3 grid rows”.
-- **Row height:** `BASE_ROW_HEIGHT = 80` px in `frontend/src/scenes/dashboard/DashboardItems.tsx`. Example: `minH: 3` → 240 px minimum tile height (plus margins).
+- **Row height:** `BASE_ROW_HEIGHT = 80` px in `products/dashboards/frontend/DashboardItems.tsx`. Example: `minH: 3` → 240 px minimum tile height (plus margins).
### Single source of truth
@@ -40,7 +40,7 @@ defaultLayout: { w: 6, h: 5, minW: 3, minH: 3 },
### How mins reach the grid
-1. `calculateLayouts(tiles)` in `frontend/src/scenes/dashboard/tileLayouts.ts` runs on every dashboard load / tile change.
+1. `calculateLayouts(tiles)` in `products/dashboards/frontend/tileLayouts.ts` runs on every dashboard load / tile change.
2. For widget tiles it calls `getWidgetCatalogLayout(widget_type)` → `DASHBOARD_WIDGET_CATALOG[key].defaultLayout`.
3. `getTileMinDimensions()` sets RGL `minW` / `minH` on each layout item.
@@ -70,8 +70,8 @@ If a new widget type omits `minH`, users can only shrink to **4 rows**, not 3. A
### Change checklist
1. Edit `defaultLayout.minH` / `minW` in `widget_types/catalog.ts` for the `widget_type`.
-2. Extend `frontend/src/scenes/dashboard/tileLayouts.test.ts` — parameterized case with `expectedMinH` / `expectedMinW` for that `widget_type` (see `error_tracking_list` / `session_replay_list` examples).
-3. Run `hogli test frontend/src/scenes/dashboard/tileLayouts.test.ts`.
+2. Extend `products/dashboards/frontend/tileLayouts.test.ts` — parameterized case with `expectedMinH` / `expectedMinW` for that `widget_type` (see `error_tracking_list` / `session_replay_list` examples).
+3. Run `hogli test products/dashboards/frontend/tileLayouts.test.ts`.
4. Manually resize the tile in dashboard **edit mode** to confirm the floor.
5. Optional: add a `MinimumSize` story — frame height `minH * 80` px, limit demo data so content fits.
diff --git a/.agents/skills/manage-dashboard-widgets/references/skill-maintenance.md b/.agents/skills/manage-dashboard-widgets/references/skill-maintenance.md
index cd9bdf759711..c70b2cb86763 100644
--- a/.agents/skills/manage-dashboard-widgets/references/skill-maintenance.md
+++ b/.agents/skills/manage-dashboard-widgets/references/skill-maintenance.md
@@ -52,12 +52,12 @@ Load `/manage-dashboard-widgets` and complete the maintenance checklist below wh
| `products/dashboards/frontend/components/WidgetCard/**` | Shared tile chrome, placeholders, overview fixtures |
| `products/dashboards/frontend/components/DashboardWidgetItem/**` | Tile glue, public placement, `TileFilters` mount |
| `products/dashboards/frontend/widgets/constants.ts` | List footer, fetch errors, tile refresh debounce ms |
-| `frontend/src/scenes/dashboard/widgetTileRefreshScheduler.ts` | Debounced `run_widgets` after tile filter PATCH |
+| `products/dashboards/frontend/widgetTileRefreshScheduler.ts` | Debounced `run_widgets` after tile filter PATCH |
| `frontend/src/scenes/dashboard/dashboardLogic.tsx` | `scheduleRefreshDashboardWidgets` vs immediate refresh |
| `products/dashboards/frontend/widgets/*WidgetTileFilters.tsx` | On-tile filters (date, status, property pickers) |
-| `frontend/src/scenes/dashboard/DashboardItems.tsx` | `showEditingControls`, `isDashboardEditMode`, tile filter mount |
+| `products/dashboards/frontend/DashboardItems.tsx` | `showEditingControls`, `isDashboardEditMode`, tile filter mount |
| `products/dashboards/mcp/tools.yaml` | Widget MCP tools |
-| `frontend/src/scenes/dashboard/tileLayouts.ts` | Layout algorithm (only if behavior/docs change) |
+| `products/dashboards/frontend/tileLayouts.ts` | Layout algorithm (only if behavior/docs change) |
| `posthog/api/test/test_sharing.py` | Shared dashboard widget payload expectations |
| `tach.toml` (`products.dashboards` `depends_on`) | New product import boundary |
diff --git a/.agents/skills/managing-dashboards/SKILL.md b/.agents/skills/managing-dashboards/SKILL.md
index b06f9cef5bfa..a81857167ed9 100644
--- a/.agents/skills/managing-dashboards/SKILL.md
+++ b/.agents/skills/managing-dashboards/SKILL.md
@@ -123,18 +123,18 @@ Run the focused tests for each edited layer. Then run the relevant checks from [
## 6. Code map
-| Concern | Start here |
-| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
-| Dashboard API, serializers, tile operations, insight and widget runners | `products/dashboards/backend/api/dashboard.py` |
-| Dashboard model and tile model | `products/dashboards/backend/models/dashboard.py`, `models/dashboard_tile.py` |
-| Sharing routes | `products/dashboards/backend/routes.py` |
-| Templates | `products/dashboards/backend/api/dashboard_templates.py`, `models/dashboard_templates.py` |
-| Main scene, state, refresh, and layout persistence | `frontend/src/scenes/dashboard/Dashboard.tsx`, `dashboardLogic.tsx`, `DashboardItems.tsx` |
-| Layout geometry and tile size constraints | `frontend/src/scenes/dashboard/tileLayouts.ts`, `dashboardUtils.ts` |
-| Shared and export rendering | `frontend/src/exporter/scenes/ExporterDashboardScene.tsx`, `frontend/src/exporter/Exporter.tsx` |
-| Refresh defaults and shared safety clamp | `posthog/hogql_queries/refresh_policy.py` |
-| Resource transfer | `posthog/models/resource_transfer/visitors/dashboard.py`, `dashboard_tile.py`, `dashboard_widget.py` |
-| MCP tool definitions | `products/dashboards/mcp/tools.yaml` |
+| Concern | Start here |
+| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
+| Dashboard API, serializers, tile operations, insight and widget runners | `products/dashboards/backend/api/dashboard.py` |
+| Dashboard model and tile model | `products/dashboards/backend/models/dashboard.py`, `models/dashboard_tile.py` |
+| Sharing routes | `products/dashboards/backend/routes.py` |
+| Templates | `products/dashboards/backend/api/dashboard_templates.py`, `models/dashboard_templates.py` |
+| Main scene, state, refresh, and layout persistence | `frontend/src/scenes/dashboard/Dashboard.tsx`, `dashboardLogic.tsx`, `products/dashboards/frontend/DashboardItems.tsx` |
+| Layout geometry and tile size constraints | `products/dashboards/frontend/tileLayouts.ts`, `frontend/src/scenes/dashboard/dashboardUtils.ts` |
+| Shared and export rendering | `frontend/src/exporter/scenes/ExporterDashboardScene.tsx`, `frontend/src/exporter/Exporter.tsx` |
+| Refresh defaults and shared safety clamp | `posthog/hogql_queries/refresh_policy.py` |
+| Resource transfer | `posthog/models/resource_transfer/visitors/dashboard.py`, `dashboard_tile.py`, `dashboard_widget.py` |
+| MCP tool definitions | `products/dashboards/mcp/tools.yaml` |
## Companion skills
diff --git a/.agents/skills/managing-dashboards/references/filter-editing-and-temporary-views.md b/.agents/skills/managing-dashboards/references/filter-editing-and-temporary-views.md
index 75260d2525be..c8b82d0df1c2 100644
--- a/.agents/skills/managing-dashboards/references/filter-editing-and-temporary-views.md
+++ b/.agents/skills/managing-dashboards/references/filter-editing-and-temporary-views.md
@@ -203,10 +203,10 @@ Use one local dashboard with at least two working insight tiles and three SQL va
## Source files
-- `frontend/src/scenes/dashboard/DashboardFilters.tsx`
+- `products/dashboards/frontend/DashboardFilters.tsx`
- `frontend/src/scenes/dashboard/DashboardUnsavedChangesIndicator.tsx`
- `frontend/src/scenes/dashboard/dashboardChanges.ts`
- `frontend/src/scenes/dashboard/dashboardLogic.tsx`
-- `frontend/src/scenes/dashboard/DashboardItems.tsx`
-- `frontend/src/scenes/dashboard/DashboardSceneMenuBar.tsx`
-- `frontend/src/scenes/dashboard/DashboardScenePanel.tsx`
+- `products/dashboards/frontend/DashboardItems.tsx`
+- `products/dashboards/frontend/DashboardSceneMenuBar.tsx`
+- `products/dashboards/frontend/DashboardScenePanel.tsx`
diff --git a/.agents/skills/managing-dashboards/references/filters-variables-and-overrides.md b/.agents/skills/managing-dashboards/references/filters-variables-and-overrides.md
index 75bb9d29f6d1..54739b503f08 100644
--- a/.agents/skills/managing-dashboards/references/filters-variables-and-overrides.md
+++ b/.agents/skills/managing-dashboards/references/filters-variables-and-overrides.md
@@ -66,6 +66,6 @@ Show initial URL overrides through the same unsaved treatment as user edits. Do
- `products/dashboards/backend/api/dashboard.py`
- `posthog/hogql_queries/apply_dashboard_filters.py`
-- `frontend/src/scenes/dashboard/DashboardFilters.tsx`
-- `frontend/src/scenes/dashboard/TileFiltersOverride.tsx`
+- `products/dashboards/frontend/DashboardFilters.tsx`
+- `products/dashboards/frontend/TileFiltersOverride.tsx`
- `frontend/src/scenes/dashboard/dashboardLogic.tsx`
diff --git a/.agents/skills/managing-dashboards/references/layout-responsive-and-templates.md b/.agents/skills/managing-dashboards/references/layout-responsive-and-templates.md
index bdc67f1c062c..3b246919ce6f 100644
--- a/.agents/skills/managing-dashboards/references/layout-responsive-and-templates.md
+++ b/.agents/skills/managing-dashboards/references/layout-responsive-and-templates.md
@@ -56,7 +56,7 @@ Before changing templates, define:
## Verification
```bash
-hogli test frontend/src/scenes/dashboard/tileLayouts.test.ts
+hogli test products/dashboards/frontend/tileLayouts.test.ts
hogli test frontend/src/scenes/dashboard/insertTileGeometry.test.ts
hogli test frontend/src/scenes/dashboard/editLayoutGesture.test.ts
hogli test products/dashboards/backend/api/test/test_dashboard_templates.py
diff --git a/.agents/skills/managing-dashboards/references/querying-caching-and-scale.md b/.agents/skills/managing-dashboards/references/querying-caching-and-scale.md
index b541c0317860..73c09739172e 100644
--- a/.agents/skills/managing-dashboards/references/querying-caching-and-scale.md
+++ b/.agents/skills/managing-dashboards/references/querying-caching-and-scale.md
@@ -60,7 +60,7 @@ Run the smallest relevant set first.
hogli test products/dashboards/backend/api/test/test_run_insights.py
hogli test products/dashboards/backend/api/test/test_run_widgets.py
hogli test frontend/src/scenes/dashboard/dashboardLogic.test.ts
-hogli test frontend/src/scenes/dashboard/DashboardItems.test.tsx
+hogli test products/dashboards/frontend/DashboardItems.test.tsx
```
Also run focused tests for the changed API, sharing, template, or layout behavior.
diff --git a/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md b/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
index 412636c4d55c..5c88f338c88e 100644
--- a/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
+++ b/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
@@ -31,7 +31,7 @@ Also check product-created unlisted dashboards. `Dashboard.CreationMode.UNLISTED
| Templates endpoint | `products/dashboards/backend/api/dashboard_templates.py` |
| Product routes | `products/dashboards/backend/routes.py` |
| Scene state | `frontend/src/scenes/dashboard/dashboardLogic.tsx` |
-| Main layout | `frontend/src/scenes/dashboard/DashboardItems.tsx`, `tileLayouts.ts` |
+| Main layout | `products/dashboards/frontend/DashboardItems.tsx`, `tileLayouts.ts` |
| Shared/export host | `frontend/src/exporter/scenes/ExporterDashboardScene.tsx`, `frontend/src/exporter/Exporter.tsx` |
## API contract changes
diff --git a/.agents/skills/scene-menu-bar/SKILL.md b/.agents/skills/scene-menu-bar/SKILL.md
index 7fafd7d8585c..eaf2c59bced7 100644
--- a/.agents/skills/scene-menu-bar/SKILL.md
+++ b/.agents/skills/scene-menu-bar/SKILL.md
@@ -154,7 +154,7 @@ attribute is set on the wrapper for debugging.
- Feature Flag — `frontend/src/scenes/feature-flags/FeatureFlag.tsx`
- Insight — `products/product_analytics/frontend/insights/insightScene/sidePanel/InsightSceneMenuBar.tsx`
-- Dashboard — `frontend/src/scenes/dashboard/DashboardSceneMenuBar.tsx`
+- Dashboard — `products/dashboards/frontend/DashboardSceneMenuBar.tsx`
When migrating a new scene, follow the `<Scene>SceneMenuBar.tsx` pattern (component
that reads `featureFlagLogic`, early-returns null if the flag is off, otherwise renders
diff --git a/frontend/bin/css-coupling-baseline.txt b/frontend/bin/css-coupling-baseline.txt
index 7e991d661884..4bce40bcddb3 100644
--- a/frontend/bin/css-coupling-baseline.txt
+++ b/frontend/bin/css-coupling-baseline.txt
@@ -22,7 +22,6 @@ frontend/src/lib/components/TileDecorations/TileDecorations.tsx -> .LemonIcon
frontend/src/lib/lemon-ui/Spinner/Spinner.tsx -> .LemonIcon
frontend/src/lib/monaco/CodeEditorResizable.tsx -> .CodeEditorResizeable
frontend/src/queries/nodes/InsightViz/InsightVizDisplay.tsx -> .InsightVizDisplay
-frontend/src/scenes/dashboard/items/DashboardErrorTileItem.tsx -> .InsightCard
frontend/src/scenes/data-warehouse/editor/SQLEditor.tsx -> .EditorScene
frontend/src/scenes/feature-flags/FeatureFlagVariantsForm.tsx -> .VariantFormList
frontend/src/scenes/feature-flags/PercentageInput.tsx -> .LemonInput
@@ -53,6 +52,7 @@ frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewFeed.tsx
frontend/src/scenes/surveys/SurveyDragHandle.tsx -> .SurveyQuestionDragHandle
products/business_intelligence/frontend/BIPivotTable.tsx -> .DataVisualizationTable
products/dashboards/frontend/components/ImageTile/DashboardImageTile.tsx -> .DashboardTileCard
+products/dashboards/frontend/items/DashboardErrorTileItem.tsx -> .InsightCard
products/product_analytics/frontend/insights/funnels/Funnel.tsx -> .FunnelInsight
products/product_analytics/frontend/insights/insightScene/InsightSkeleton.tsx -> .InsightVizDisplay
products/product_analytics/frontend/insights/insightScene/SqlInsightFilters.tsx -> .InsightVizDisplay
diff --git a/frontend/src/layout/scenes/AGENTS.md b/frontend/src/layout/scenes/AGENTS.md
index ec3efc315b69..3915af7f3bbf 100644
--- a/frontend/src/layout/scenes/AGENTS.md
+++ b/frontend/src/layout/scenes/AGENTS.md
@@ -65,7 +65,7 @@ Scenes get a co-located `<Resource>SceneMenuBar` component (`CohortSceneMenuBar`
```
Reference implementations: `scenes/cohorts/CohortSceneMenuBar.tsx`,
-`scenes/dashboard/DashboardSceneMenuBar.tsx`, `scenes/notebooks/NotebookSceneMenuBar.tsx`.
+`products/dashboards/frontend/DashboardSceneMenuBar.tsx`, `scenes/notebooks/NotebookSceneMenuBar.tsx`.
## Before you write menu code, read the skill
diff --git a/frontend/src/lib/components/ActivityLog/ActivityLogRow.stories.tsx b/frontend/src/lib/components/ActivityLog/ActivityLogRow.stories.tsx
index 8ec51c46c6a7..eca23dcd7d45 100644
--- a/frontend/src/lib/components/ActivityLog/ActivityLogRow.stories.tsx
+++ b/frontend/src/lib/components/ActivityLog/ActivityLogRow.stories.tsx
@@ -1,10 +1,11 @@
import type { Meta, StoryObj } from '@storybook/react'
import { dayjs } from 'lib/dayjs'
-import { dashboardActivityDescriber } from 'scenes/dashboard/dashboardActivityDescriber'
import { ActivityScope, InsightShortId } from '~/types'
+import { dashboardActivityDescriber } from 'products/dashboards/frontend/dashboardActivityDescriber'
+
import { describerFor, ensureActivityDescribersLoaded } from './activityLogLogic'
import { ActivityLogRow } from './ActivityLogRow'
import { ActivityLogItem, humanize } from './humanizeActivity'
diff --git a/frontend/src/lib/components/ActivityLog/humanizeActivity.test.tsx b/frontend/src/lib/components/ActivityLog/humanizeActivity.test.tsx
index bffb44378702..30b14b33fdf0 100644
--- a/frontend/src/lib/components/ActivityLog/humanizeActivity.test.tsx
+++ b/frontend/src/lib/components/ActivityLog/humanizeActivity.test.tsx
@@ -10,7 +10,6 @@ import {
userNameForLogItem,
} from 'lib/components/ActivityLog/humanizeActivity'
import { cohortActivityDescriber } from 'scenes/cohorts/activityDescriptions'
-import { dashboardActivityDescriber } from 'scenes/dashboard/dashboardActivityDescriber'
import { dataManagementActivityDescriber } from 'scenes/data-management/dataManagementDescribers'
import { notebookActivityDescriber } from 'scenes/notebooks/Notebook/notebookActivityDescriber'
import { surveyActivityDescriber } from 'scenes/surveys/surveyActivityDescriber'
@@ -19,6 +18,7 @@ import { teamActivityDescriber } from 'scenes/team-activity/teamActivityDescribe
import { ActivityScope } from '~/types'
import { actionActivityDescriber } from 'products/actions/frontend/actionActivityDescriber'
+import { dashboardActivityDescriber } from 'products/dashboards/frontend/dashboardActivityDescriber'
import { insightActivityDescriber } from 'products/product_analytics/frontend/insights/activityDescriptions'
describe('humanizeActivity', () => {
diff --git a/frontend/src/lib/components/TileDecorations/TileDecorations.stories.tsx b/frontend/src/lib/components/TileDecorations/TileDecorations.stories.tsx
index 60ca5c445942..c3d77171abc6 100644
--- a/frontend/src/lib/components/TileDecorations/TileDecorations.stories.tsx
+++ b/frontend/src/lib/components/TileDecorations/TileDecorations.stories.tsx
@@ -2,14 +2,15 @@ import type { Meta, StoryObj } from '@storybook/react'
import { waitFor } from '@testing-library/react'
import { App } from 'scenes/App'
-import __dashboard1 from 'scenes/dashboard/__mocks__/dashboard1.json'
-import __dashboards from 'scenes/dashboard/__mocks__/dashboards.json'
import { urls } from 'scenes/urls'
import { mswDecorator } from '~/mocks/browser'
import { EMPTY_PAGINATED_RESPONSE } from '~/mocks/handlers'
import type { TileBadge } from '~/types'
+import __dashboard1 from 'products/dashboards/frontend/__mocks__/dashboard1.json'
+import __dashboards from 'products/dashboards/frontend/__mocks__/dashboards.json'
+
interface TileOverrides {
badge?: TileBadge
group_key?: string
diff --git a/frontend/src/productActivityDescribers.tsx b/frontend/src/productActivityDescribers.tsx
index 01fe39e291e2..3f65c5dcbc60 100644
--- a/frontend/src/productActivityDescribers.tsx
+++ b/frontend/src/productActivityDescribers.tsx
@@ -40,7 +40,9 @@ export const productActivityDescribers: Partial<Record<ActivityScope, () => Prom
(module) => module.crossProjectDashboardActivityDescriber
),
[ActivityScope.DASHBOARD]: () =>
- import('scenes/dashboard/dashboardActivityDescriber').then((module) => module.dashboardActivityDescriber),
+ import('../../products/dashboards/frontend/dashboardActivityDescriber').then(
+ (module) => module.dashboardActivityDescriber
+ ),
[ActivityScope.DATA_WAREHOUSE_SAVED_QUERY]: () =>
import('scenes/data-warehouse/saved_queries/activityDescriptions').then(
(module) => module.dataWarehouseSavedQueryActivityDescriber
diff --git a/frontend/src/scenes/dashboard/Dashboard.tsx b/frontend/src/scenes/dashboard/Dashboard.tsx
index 99c0e24f6092..4b0604d86704 100644
--- a/frontend/src/scenes/dashboard/Dashboard.tsx
+++ b/frontend/src/scenes/dashboard/Dashboard.tsx
@@ -14,8 +14,6 @@ import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { Link } from 'lib/lemon-ui/Link'
import { cn } from 'lib/utils/css-classes'
import { lazyWithRetry } from 'lib/utils/retryImport'
-import { DashboardFilterBar } from 'scenes/dashboard/DashboardFilters'
-import { DashboardItems } from 'scenes/dashboard/DashboardItems'
import { DashboardLogicProps, dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { dataThemeLogic } from 'scenes/dataThemeLogic'
import { InsightErrorState } from 'scenes/insights/EmptyStates'
@@ -27,28 +25,32 @@ import { SceneStickyBar } from '~/layout/scenes/components/SceneStickyBar'
import { ProductKey } from '~/queries/schema/schema-general'
import { DashboardPlacement, DashboardType, DataColorThemeModel } from '~/types'
+import { addInsightToDashboardLogic } from 'products/dashboards/frontend/addInsightToDashboardModalLogic'
+import { DashboardFilterBar } from 'products/dashboards/frontend/DashboardFilters'
+import { DashboardFlagCalledBanner } from 'products/dashboards/frontend/DashboardFlagCalledBanner'
+import { DashboardEmbeddedShareButton } from 'products/dashboards/frontend/DashboardHeaderActions'
+import { DashboardItems } from 'products/dashboards/frontend/DashboardItems'
+import { DashboardModalLoading } from 'products/dashboards/frontend/DashboardModalLoading'
+import { dashboardPerformanceLogic } from 'products/dashboards/frontend/dashboardPerformanceLogic'
+import { DashboardQueryScanBanner } from 'products/dashboards/frontend/DashboardQueryScanBanner'
+import { DashboardRetentionBanner } from 'products/dashboards/frontend/DashboardRetentionBanner'
+import { dashboardSubscribeNudgeLogic } from 'products/dashboards/frontend/dashboardSubscribeNudgeLogic'
+import { DashboardWarehouseSyncBanner } from 'products/dashboards/frontend/DashboardWarehouseSyncBanner'
+import { DashboardZoomControl } from 'products/dashboards/frontend/DashboardZoomControl'
+import { EmptyDashboardComponent } from 'products/dashboards/frontend/EmptyDashboardComponent'
import { useAttachedContext } from 'products/posthog_ai/frontend/api/logics'
import { SubscriptionSummaries } from 'products/subscriptions/frontend/components/SubscriptionSummaries/SubscriptionSummaries'
import { teamLogic } from '../teamLogic'
-import { addInsightToDashboardLogic } from './addInsightToDashboardModalLogic'
-import { DashboardFlagCalledBanner } from './DashboardFlagCalledBanner'
import { DashboardHeader } from './DashboardHeader'
-import { DashboardEmbeddedShareButton } from './DashboardHeaderActions'
-import { DashboardModalLoading } from './DashboardModalLoading'
-import { dashboardPerformanceLogic } from './dashboardPerformanceLogic'
-import { DashboardQueryScanBanner } from './DashboardQueryScanBanner'
-import { DashboardRetentionBanner } from './DashboardRetentionBanner'
-import { dashboardSubscribeNudgeLogic } from './dashboardSubscribeNudgeLogic'
-import { DashboardWarehouseSyncBanner } from './DashboardWarehouseSyncBanner'
-import { DashboardZoomControl } from './DashboardZoomControl'
-import { EmptyDashboardComponent } from './EmptyDashboardComponent'
// The modal renders the saved insights list, which no dashboard needs until someone adds an insight.
const AddInsightToDashboardModal = lazyWithRetry(() =>
- import('./addInsightToDashboardModal/AddInsightToDashboardModal').then((m) => ({
- default: m.AddInsightToDashboardModal,
- }))
+ import('products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal').then(
+ (m) => ({
+ default: m.AddInsightToDashboardModal,
+ })
+ )
)
// Mount-only: runs the subscribe-nudge eligibility machinery for this dashboard; renders nothing.
diff --git a/frontend/src/scenes/dashboard/DashboardHeader.test.tsx b/frontend/src/scenes/dashboard/DashboardHeader.test.tsx
index fa31887d0644..da54dddba8ca 100644
--- a/frontend/src/scenes/dashboard/DashboardHeader.test.tsx
+++ b/frontend/src/scenes/dashboard/DashboardHeader.test.tsx
@@ -11,11 +11,11 @@ import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { AccessControlLevel, DashboardMode, DashboardPlacement, DashboardType, InsightModel } from '~/types'
+import { DashboardEmbeddedShareButton } from 'products/dashboards/frontend/DashboardHeaderActions'
import { useMcpToolApplyBack } from 'products/posthog_ai/frontend/api/logics'
import type { ToolStreamEvent } from 'products/posthog_ai/frontend/types/streamTypes'
import { DashboardHeader, insightIsAddedToDashboard } from './DashboardHeader'
-import { DashboardEmbeddedShareButton } from './DashboardHeaderActions'
import { DashboardLoadAction, dashboardLogic } from './dashboardLogic'
jest.mock('lib/components/FullScreen', () => ({
diff --git a/frontend/src/scenes/dashboard/DashboardHeader.tsx b/frontend/src/scenes/dashboard/DashboardHeader.tsx
index ed63d75d2a21..38f282868823 100644
--- a/frontend/src/scenes/dashboard/DashboardHeader.tsx
+++ b/frontend/src/scenes/dashboard/DashboardHeader.tsx
@@ -11,14 +11,18 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import { dashboardsModel } from '~/models/dashboardsModel'
import { DashboardMode } from '~/types'
+import {
+ EditModeActions,
+ FullscreenModeActions,
+ ViewModeActions,
+} from 'products/dashboards/frontend/DashboardHeaderActions'
+import { DashboardModals } from 'products/dashboards/frontend/DashboardModals'
+import { DashboardSceneMenuBar } from 'products/dashboards/frontend/DashboardSceneMenuBar'
+import { DashboardScenePanel } from 'products/dashboards/frontend/DashboardScenePanel'
+import { QuillDashboardHeaderActions } from 'products/dashboards/frontend/QuillDashboardHeaderActions'
import { useMcpToolApplyBack } from 'products/posthog_ai/frontend/api/logics'
-import { EditModeActions, FullscreenModeActions, ViewModeActions } from './DashboardHeaderActions'
import { DashboardLoadAction, dashboardLogic } from './dashboardLogic'
-import { DashboardModals } from './DashboardModals'
-import { DashboardSceneMenuBar } from './DashboardSceneMenuBar'
-import { DashboardScenePanel } from './DashboardScenePanel'
-import { QuillDashboardHeaderActions } from './QuillDashboardHeaderActions'
export const DASHBOARD_CANNOT_EDIT_MESSAGE =
"You don't have edit permissions for this dashboard. Ask a dashboard collaborator with edit access to add you."
diff --git a/frontend/src/scenes/dashboard/NewDashboardModal.test.tsx b/frontend/src/scenes/dashboard/NewDashboardModal.test.tsx
index e56362e1a49b..0c0e20d12aab 100644
--- a/frontend/src/scenes/dashboard/NewDashboardModal.test.tsx
+++ b/frontend/src/scenes/dashboard/NewDashboardModal.test.tsx
@@ -5,9 +5,10 @@ import { useActions, useMountedLogic, useValues } from 'kea'
import { type ReactNode } from 'react'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { dashboardTemplateVariablesLogic } from 'scenes/dashboard/dashboardTemplateVariablesLogic'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
+import { dashboardTemplateVariablesLogic } from 'products/dashboards/frontend/dashboardTemplateVariablesLogic'
+
import { NewDashboardModal } from './NewDashboardModal'
jest.mock('kea', () => ({
@@ -28,27 +29,27 @@ jest.mock('scenes/dashboard/newDashboardLogic', () => ({
newDashboardLogic: { __mock: 'newDashboardLogic' },
}))
-jest.mock('scenes/dashboard/dashboards/templates/dashboardTemplatesLogic', () => ({
+jest.mock('products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic', () => ({
dashboardTemplatesLogic: jest.fn(),
}))
-jest.mock('scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic', () => {
+jest.mock('products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic', () => {
const actual = jest.requireActual<
- typeof import('scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic')
- >('scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic')
+ typeof import('products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic')
+ >('products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic')
return {
...actual,
dashboardTemplateChooserLogic: jest.fn(),
}
})
-jest.mock('./dashboards/templates/DashboardTemplateChooser', () => ({
+jest.mock('products/dashboards/frontend/dashboards/templates/DashboardTemplateChooser', () => ({
DashboardTemplateChooser: ({ redirectAfterCreation }: { redirectAfterCreation?: boolean }) => (
<div data-attr="dashboard-template-chooser" data-redirect-after-creation={String(redirectAfterCreation)} />
),
}))
-jest.mock('./DashboardTemplateVariables', () => ({
+jest.mock('products/dashboards/frontend/DashboardTemplateVariables', () => ({
DashboardTemplateVariables: () => <div data-attr="dashboard-template-variables" />,
}))
@@ -67,10 +68,10 @@ const mockedUseActions = useActions as jest.Mock
const mockedUseMountedLogic = useMountedLogic as jest.Mock
const mockedDashboardTemplatesLogic = jest.requireMock<{
dashboardTemplatesLogic: jest.Mock
-}>('scenes/dashboard/dashboards/templates/dashboardTemplatesLogic').dashboardTemplatesLogic
+}>('products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic').dashboardTemplatesLogic
const mockedDashboardTemplateChooserLogic = jest.requireMock<{
dashboardTemplateChooserLogic: jest.Mock
-}>('scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic').dashboardTemplateChooserLogic
+}>('products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic').dashboardTemplateChooserLogic
const mockTemplatesLogic = { __mock: 'dashboardTemplatesLogic' as const }
const mockChooserLogic = { __mock: 'dashboardTemplateChooserLogic' as const }
diff --git a/frontend/src/scenes/dashboard/NewDashboardModal.tsx b/frontend/src/scenes/dashboard/NewDashboardModal.tsx
index 5a3a3d636581..b7df56631a86 100644
--- a/frontend/src/scenes/dashboard/NewDashboardModal.tsx
+++ b/frontend/src/scenes/dashboard/NewDashboardModal.tsx
@@ -7,13 +7,13 @@ import { DialogClose, DialogPrimitive, DialogPrimitiveTitle } from 'lib/ui/Dialo
import { cn } from 'lib/utils/css-classes'
import { isMobile } from 'lib/utils/dom'
import { pluralize } from 'lib/utils/strings'
-import { dashboardTemplateChooserLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic'
-import { dashboardTemplatesLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
-import { DashboardTemplateChooser } from './dashboards/templates/DashboardTemplateChooser'
-import { DashboardTemplateVariables } from './DashboardTemplateVariables'
-import { dashboardTemplateVariablesLogic } from './dashboardTemplateVariablesLogic'
+import { DashboardTemplateChooser } from 'products/dashboards/frontend/dashboards/templates/DashboardTemplateChooser'
+import { dashboardTemplateChooserLogic } from 'products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic'
+import { dashboardTemplatesLogic } from 'products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic'
+import { DashboardTemplateVariables } from 'products/dashboards/frontend/DashboardTemplateVariables'
+import { dashboardTemplateVariablesLogic } from 'products/dashboards/frontend/dashboardTemplateVariablesLogic'
export function NewDashboardModal({ redirectAfterCreation = true }: { redirectAfterCreation?: boolean }): JSX.Element {
const builtLogic = useMountedLogic(newDashboardLogic)
diff --git a/frontend/src/scenes/dashboard/dashboardLogic.test.ts b/frontend/src/scenes/dashboard/dashboardLogic.test.ts
index fcf9a5ffd463..2414ec6ed5b2 100644
--- a/frontend/src/scenes/dashboard/dashboardLogic.test.ts
+++ b/frontend/src/scenes/dashboard/dashboardLogic.test.ts
@@ -21,9 +21,7 @@ import { apiStatusLogic } from 'lib/logic/apiStatusLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { DashboardEventSource, eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { pluralize } from 'lib/utils/strings'
-import { addInsightToDashboardLogic } from 'scenes/dashboard/addInsightToDashboardModalLogic'
import { parseDashboardId } from 'scenes/dashboard/Dashboard'
-import { dashboardInsightColorsModalLogic } from 'scenes/dashboard/dashboardInsightColorsModalLogic'
import {
DashboardLoadAction,
dashboardLogic,
@@ -32,7 +30,6 @@ import {
} from 'scenes/dashboard/dashboardLogic'
import * as dashboardUtils from 'scenes/dashboard/dashboardUtils'
import { liveDashboardIds } from 'scenes/dashboard/liveDashboardIds'
-import * as widgetFetchUtils from 'scenes/dashboard/widgetFetchUtils'
import { sceneLogic } from 'scenes/sceneLogic'
import { Scene } from 'scenes/sceneTypes'
import { teamLogic } from 'scenes/teamLogic'
@@ -57,8 +54,11 @@ import {
InsightModel,
} from '~/types'
+import { addInsightToDashboardLogic } from 'products/dashboards/frontend/addInsightToDashboardModalLogic'
import { DashboardGridCompaction, getDashboardGridCompactor } from 'products/dashboards/frontend/dashboardCustomization'
+import { dashboardInsightColorsModalLogic } from 'products/dashboards/frontend/dashboardInsightColorsModalLogic'
import { dashboardTileGroupChoicesLogic } from 'products/dashboards/frontend/dashboardTileGroupChoicesLogic'
+import * as widgetFetchUtils from 'products/dashboards/frontend/widgetFetchUtils'
import { dashboardResult, insightOnDashboard, tileFromInsight } from './dashboardLogic.testHelpers'
diff --git a/frontend/src/scenes/dashboard/dashboardLogic.testHelpers.ts b/frontend/src/scenes/dashboard/dashboardLogic.testHelpers.ts
index afded0504a5e..194075d7d584 100644
--- a/frontend/src/scenes/dashboard/dashboardLogic.testHelpers.ts
+++ b/frontend/src/scenes/dashboard/dashboardLogic.testHelpers.ts
@@ -1,7 +1,7 @@
import { DashboardFilter } from '~/queries/schema/schema-general'
import { DashboardTile, DashboardType, InsightModel } from '~/types'
-import _dashboardJson from './__mocks__/dashboard.json'
+import _dashboardJson from 'products/dashboards/frontend/__mocks__/dashboard.json'
const dashboardJson = _dashboardJson as any as DashboardType
diff --git a/frontend/src/scenes/dashboard/dashboardLogic.tsx b/frontend/src/scenes/dashboard/dashboardLogic.tsx
index bc76fc2b5b00..0b2f97e53f88 100644
--- a/frontend/src/scenes/dashboard/dashboardLogic.tsx
+++ b/frontend/src/scenes/dashboard/dashboardLogic.tsx
@@ -60,7 +60,6 @@ import { DashboardEventSource, eventUsageLogic, filtersForAnalytics, sanitizeQue
import { objectsEqual } from 'lib/utils/objects'
import { shouldCancelQuery } from 'lib/utils/requests'
import { toParams } from 'lib/utils/url'
-import { addInsightToDashboardLogic } from 'scenes/dashboard/addInsightToDashboardModalLogic'
import {
DashboardFilterChangeType,
dashboardViewedProperties,
@@ -75,15 +74,6 @@ import {
} from 'scenes/dashboard/dashboardEvents'
import { BREAKPOINTS, dashboardToSaveableTemplate, getDashboardTileDisplayName } from 'scenes/dashboard/dashboardUtils'
import { liveDashboardIds } from 'scenes/dashboard/liveDashboardIds'
-import { calculateDuplicateLayout, calculateLayouts } from 'scenes/dashboard/tileLayouts'
-import {
- chunkTileIds,
- fetchRunWidgets,
- findNewlyAddedWidgetTiles,
- isWidgetStale,
- WIDGET_CLIENT_TTL_MS,
-} from 'scenes/dashboard/widgetFetchUtils'
-import { createDashboardWidgetTileRefreshScheduler } from 'scenes/dashboard/widgetTileRefreshScheduler'
import { dataThemeLogic } from 'scenes/dataThemeLogic'
import { MaxContextInput, createMaxContextHelpers } from 'scenes/max/maxTypes'
import { sceneLogic } from 'scenes/sceneLogic'
@@ -136,7 +126,13 @@ import {
TileLayout,
} from '~/types'
+import { addInsightToDashboardLogic } from 'products/dashboards/frontend/addInsightToDashboardModalLogic'
import { getImageOnlyTextCardImage } from 'products/dashboards/frontend/components/ImageTile/imageTileUtils'
+import {
+ DashboardControl,
+ DashboardControlScope,
+ getDashboardControlScopes,
+} from 'products/dashboards/frontend/dashboardControls'
import { DashboardGridCompaction, getDashboardGridCompactor } from 'products/dashboards/frontend/dashboardCustomization'
import {
dashboardFiltersEqual,
@@ -167,6 +163,17 @@ import {
UNGROUPED_TILES_TAB_KEY,
getTileGroupSectionKey,
} from 'products/dashboards/frontend/dashboardTileSections'
+import { TileFiltersOverride } from 'products/dashboards/frontend/TileFiltersOverride'
+import { calculateDuplicateLayout, calculateLayouts } from 'products/dashboards/frontend/tileLayouts'
+import { tileLogic } from 'products/dashboards/frontend/tileLogic'
+import {
+ chunkTileIds,
+ fetchRunWidgets,
+ findNewlyAddedWidgetTiles,
+ isWidgetStale,
+ WIDGET_CLIENT_TTL_MS,
+} from 'products/dashboards/frontend/widgetFetchUtils'
+import { createDashboardWidgetTileRefreshScheduler } from 'products/dashboards/frontend/widgetTileRefreshScheduler'
import { dataRetentionBannerLogic } from 'products/product_analytics/frontend/insights/dataRetention/dataRetentionBannerLogic'
import { exceedsRetention } from 'products/product_analytics/frontend/insights/dataRetention/exceedsRetention'
@@ -185,7 +192,6 @@ import {
mergeBreakdownColorConfigs,
} from './dashboardBreakdownColors'
import { AUTO_REFRESH_INITIAL_INTERVAL_SECONDS } from './dashboardConstants'
-import { DashboardControl, DashboardControlScope, getDashboardControlScopes } from './dashboardControls'
import {
BREAKPOINT_COLUMN_COUNTS,
DASHBOARD_MIN_REFRESH_INTERVAL_MINUTES,
@@ -212,8 +218,6 @@ import {
searchParamsWithUrlFilters,
shouldSharedDashboardAutoForceForStaleTime,
} from './dashboardUtils'
-import { TileFiltersOverride } from './TileFiltersOverride'
-import { tileLogic } from './tileLogic'
function dashboardSettingsMatch(first: DashboardSettings, second: DashboardSettings): boolean {
return dashboardFiltersEqual(first.filters, second.filters) && equal(first.variables, second.variables)
diff --git a/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.test.ts b/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.test.ts
index 7aef9be53a43..f13684e9c6ef 100644
--- a/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.test.ts
+++ b/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.test.ts
@@ -20,11 +20,10 @@ import { dashboardsModel } from '~/models/dashboardsModel'
import { initKeaTests } from '~/test/init'
import { AppContext, DashboardType, UserBasicType } from '~/types'
+import dashboardJson from 'products/dashboards/frontend/__mocks__/dashboard.json'
import * as generatedApi from 'products/dashboards/frontend/generated/api'
import type { DashboardBulkDeleteResponseApi } from 'products/dashboards/frontend/generated/api.schemas'
-import dashboardJson from '../__mocks__/dashboard.json'
-
let dashboardId = 1234
const dashboard = (extras: Partial<DashboardType>): DashboardType => {
dashboardId = dashboardId + 1
diff --git a/frontend/src/scenes/dashboard/newDashboardLogic.ts b/frontend/src/scenes/dashboard/newDashboardLogic.ts
index 47cf5c0803b5..00aa3779418a 100644
--- a/frontend/src/scenes/dashboard/newDashboardLogic.ts
+++ b/frontend/src/scenes/dashboard/newDashboardLogic.ts
@@ -39,6 +39,7 @@ import {
SidePanelTab,
} from '~/types'
+import { legacyEntityToNode, sanitizeRetentionEntity } from 'products/dashboards/frontend/dashboardTemplateEntities'
import { WEBSITE_METRICS_METRIC_CARD_TILES } from 'products/dashboards/frontend/websiteMetricsMetricCardTemplate'
import {
titleMentionsMCP,
@@ -46,7 +47,6 @@ import {
} from 'products/mcp_analytics/frontend/nudge/mcpAnalyticsNudgeLogic'
import { UNFILED_DASHBOARDS_FOLDER } from './dashboardConstants'
-import { legacyEntityToNode, sanitizeRetentionEntity } from './dashboardTemplateEntities'
export interface NewDashboardForm {
name: string
diff --git a/frontend/src/scenes/dashboard/useDashboardLayoutInteraction.ts b/frontend/src/scenes/dashboard/useDashboardLayoutInteraction.ts
index 84c3c82cd42a..614c0c46fc6f 100644
--- a/frontend/src/scenes/dashboard/useDashboardLayoutInteraction.ts
+++ b/frontend/src/scenes/dashboard/useDashboardLayoutInteraction.ts
@@ -3,16 +3,15 @@ import type { MutableRefObject } from 'react'
import { cloneLayoutItem } from 'react-grid-layout'
import type { Compactor, Layout, LayoutItem } from 'react-grid-layout'
+import type { DashboardLayoutSize } from '~/types'
+
+import { DashboardGridCompaction, getDashboardGridCompactor } from 'products/dashboards/frontend/dashboardCustomization'
import {
getResizeNeighbors,
resizeNeighborToFitRow,
restoreUnmovedItemPositions,
-} from 'scenes/dashboard/dashboardResizeCompactor'
-import type { ResizeNeighbors } from 'scenes/dashboard/dashboardResizeCompactor'
-
-import type { DashboardLayoutSize } from '~/types'
-
-import { DashboardGridCompaction, getDashboardGridCompactor } from 'products/dashboards/frontend/dashboardCustomization'
+} from 'products/dashboards/frontend/dashboardResizeCompactor'
+import type { ResizeNeighbors } from 'products/dashboards/frontend/dashboardResizeCompactor'
type InteractionKind = 'drag' | 'resize'
diff --git a/frontend/src/scenes/insights/insightLogic.tsx b/frontend/src/scenes/insights/insightLogic.tsx
index fe1f6a4dd5b9..7b01f302ec77 100644
--- a/frontend/src/scenes/insights/insightLogic.tsx
+++ b/frontend/src/scenes/insights/insightLogic.tsx
@@ -35,7 +35,6 @@ import { objectsEqual } from 'lib/utils/objects'
import { RetainedValues } from 'lib/utils/retainedValues'
import { retryImport } from 'lib/utils/retryImport'
import { withBackLink } from 'scenes/analytics/analyticsBackLink'
-import { isDashboardFilterOverrideEmpty } from 'scenes/dashboard/dashboardFilterEmpty'
import { liveDashboardIds } from 'scenes/dashboard/liveDashboardIds'
import { insightSceneLogic } from 'scenes/insights/insightSceneLogic'
import { summarizeInsight } from 'scenes/insights/summarizeInsight'
@@ -76,6 +75,7 @@ import {
SetInsightOptions,
} from '~/types'
+import { isDashboardFilterOverrideEmpty } from 'products/dashboards/frontend/dashboardFilterEmpty'
import { dashboardsPartialUpdate } from 'products/dashboards/frontend/generated/api'
import {
titleMentionsMCP,
diff --git a/frontend/src/scenes/insights/insightSceneLogic.tsx b/frontend/src/scenes/insights/insightSceneLogic.tsx
index 86ebc30ae15b..3a02866fcfe7 100644
--- a/frontend/src/scenes/insights/insightSceneLogic.tsx
+++ b/frontend/src/scenes/insights/insightSceneLogic.tsx
@@ -23,7 +23,6 @@ import { InsightEventSource, sanitizeQuery } from 'lib/utils/eventUsageLogic'
import { isEmptyObject, isObject } from 'lib/utils/guards'
import { objectsEqual } from 'lib/utils/objects'
import { analyticsBackLink } from 'scenes/analytics/analyticsBackLink'
-import { isDashboardFilterOverrideEmpty } from 'scenes/dashboard/dashboardFilterEmpty'
import {
SEARCH_PARAM_FILTERS_KEY,
dashboardSearchParamsFromOverrides,
@@ -71,6 +70,7 @@ import {
} from '~/types'
import { AlertType } from 'products/alerts/frontend/types'
+import { isDashboardFilterOverrideEmpty } from 'products/dashboards/frontend/dashboardFilterEmpty'
import { PRODUCT_ANALYTICS_DEFAULT_QUERY_TAGS } from 'products/product_analytics/frontend/constants'
import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
diff --git a/frontend/src/scenes/notebooks/Notebook/NotebookWidgetViews.stories.tsx b/frontend/src/scenes/notebooks/Notebook/NotebookWidgetViews.stories.tsx
index dc8e8185b64e..fd15f72eae13 100644
--- a/frontend/src/scenes/notebooks/Notebook/NotebookWidgetViews.stories.tsx
+++ b/frontend/src/scenes/notebooks/Notebook/NotebookWidgetViews.stories.tsx
@@ -6,7 +6,6 @@ import { HttpResponse } from 'msw'
import { FEATURE_FLAGS } from 'lib/constants'
import { App } from 'scenes/App'
-import dashboardFixture from 'scenes/dashboard/__mocks__/dashboard.json'
import { recordingMetaJson } from 'scenes/session-recordings/__mocks__/recording_meta'
import { recordingPlaylists } from 'scenes/session-recordings/__mocks__/recording_playlists'
import { snapshotsAsJSONLines } from 'scenes/session-recordings/__mocks__/recording_snapshots'
@@ -29,6 +28,7 @@ import {
} from '~/types'
import traceWithoutContent from 'products/ai_observability/frontend/__mocks__/traceWithoutContent.json'
+import dashboardFixture from 'products/dashboards/frontend/__mocks__/dashboard.json'
import {
errorTrackingEventsQueryResponse,
errorTrackingQueryResponse,
diff --git a/frontend/src/scenes/project-homepage/ProjectHomepage.stories.tsx b/frontend/src/scenes/project-homepage/ProjectHomepage.stories.tsx
index a80007b08b88..3721bbf574a4 100644
--- a/frontend/src/scenes/project-homepage/ProjectHomepage.stories.tsx
+++ b/frontend/src/scenes/project-homepage/ProjectHomepage.stories.tsx
@@ -12,8 +12,8 @@ import { mswDecorator } from '~/mocks/browser'
import { EMPTY_PAGINATED_RESPONSE } from '~/mocks/handlers'
import type { MockResolverInfo } from '~/mocks/utils'
-import __dashboard1 from '../dashboard/__mocks__/dashboard1.json'
-import __dashboards from '../dashboard/__mocks__/dashboards.json'
+import __dashboard1 from 'products/dashboards/frontend/__mocks__/dashboard1.json'
+import __dashboards from 'products/dashboards/frontend/__mocks__/dashboards.json'
const dashboardRaw = __dashboard1 as any
// Mark all tiles as cached to prevent refresh attempts in storybook
diff --git a/frontend/src/scenes/project-homepage/projectHomepageLogic.test.ts b/frontend/src/scenes/project-homepage/projectHomepageLogic.test.ts
index 7bc3a3206f9f..e246d2034614 100644
--- a/frontend/src/scenes/project-homepage/projectHomepageLogic.test.ts
+++ b/frontend/src/scenes/project-homepage/projectHomepageLogic.test.ts
@@ -9,7 +9,8 @@ import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { DashboardType } from '~/types'
-import _dashboardJson from '../dashboard/__mocks__/dashboard.json'
+import _dashboardJson from 'products/dashboards/frontend/__mocks__/dashboard.json'
+
import { projectHomepageLogic } from './projectHomepageLogic'
const dashboardJson = _dashboardJson as any as DashboardType
diff --git a/frontend/src/scenes/saved-insights/savedInsightsLogic.test.ts b/frontend/src/scenes/saved-insights/savedInsightsLogic.test.ts
index b468ce0a6ed3..a1c12af18ec1 100644
--- a/frontend/src/scenes/saved-insights/savedInsightsLogic.test.ts
+++ b/frontend/src/scenes/saved-insights/savedInsightsLogic.test.ts
@@ -7,8 +7,6 @@ import api from 'lib/api'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
-import { DeleteDashboardForm, deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
-import { DuplicateDashboardForm, duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
import { sceneLogic } from 'scenes/sceneLogic'
import { Scene } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -18,6 +16,9 @@ import { dashboardsModel } from '~/models/dashboardsModel'
import { initKeaTests } from '~/test/init'
import { InsightModel, SavedInsightsTabs } from '~/types'
+import { DeleteDashboardForm, deleteDashboardLogic } from 'products/dashboards/frontend/deleteDashboardLogic'
+import { DuplicateDashboardForm, duplicateDashboardLogic } from 'products/dashboards/frontend/duplicateDashboardLogic'
+
import {
INSIGHTS_PER_PAGE,
InsightsResult,
diff --git a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
index b2d3565da041..1fe467a9ee05 100644
--- a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
+++ b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
@@ -15,8 +15,6 @@ import { trackedActionToUrl } from 'lib/logic/scenes/trackedActionToUrl'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { objectDiffShallow, objectsEqual } from 'lib/utils/objects'
import { toParams } from 'lib/utils/url'
-import { deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
-import { duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
import { crushDraftQueryForLocalStorage, parseDraftQueryFromLocalStorage } from 'scenes/insights/utils'
import { insightsApi } from 'scenes/insights/utils/api'
import { sceneLogic } from 'scenes/sceneLogic'
@@ -29,14 +27,16 @@ import { dashboardsModel } from '~/models/dashboardsModel'
import { insightsModel } from '~/models/insightsModel'
import { Breadcrumb, InsightModel, SavedInsightsTabs, UserType } from '~/types'
+import { deleteDashboardLogic } from 'products/dashboards/frontend/deleteDashboardLogic'
+import type { DeleteDashboardForm } from 'products/dashboards/frontend/deleteDashboardLogic'
+import { duplicateDashboardLogic } from 'products/dashboards/frontend/duplicateDashboardLogic'
+import type { DuplicateDashboardForm } from 'products/dashboards/frontend/duplicateDashboardLogic'
import {
InsightBulkDeleteResponseApi,
InsightBulkRestoreResponseApi,
} from 'products/product_analytics/frontend/generated/api.schemas'
import type { Node } from '../../queries/schema/schema-general'
-import type { DeleteDashboardForm } from '../dashboard/deleteDashboardLogic'
-import type { DuplicateDashboardForm } from '../dashboard/duplicateDashboardLogic'
import { teamLogic } from '../teamLogic'
import { DraftInsightQuery, draftInsightListItem, isValidDraftInsightQuery } from './draftInsight'
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
index e31da2b6fcbc..7648e5e0ad2f 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/components/MarketingAnalyticsTable/MarketingAnalyticsTable.tsx
@@ -8,7 +8,6 @@ import { LemonButton, LemonInput, LemonSegmentedButton, Tooltip } from '@posthog
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { lazyWithRetry } from 'lib/utils/retryImport'
-import { DashboardModalLoading } from 'scenes/dashboard/DashboardModalLoading'
import { teamLogic } from 'scenes/teamLogic'
import { TileId } from 'scenes/web-analytics/common'
import { WebTileHeader } from 'scenes/web-analytics/WebTileHeader'
@@ -31,6 +30,7 @@ import { useMarketingAnalyticsPrecompute } from '~/scenes/marketing-analytics/us
import { webAnalyticsDataTableQueryContext } from '~/scenes/web-analytics/tiles/WebAnalyticsTile'
import { InsightLogicProps } from '~/types'
+import { DashboardModalLoading } from 'products/dashboards/frontend/DashboardModalLoading'
import { MetricSourceBadge } from 'products/marketing_analytics/frontend/components/MetricSourceBadge'
import {
conversionRecordingsTableQuery,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7df7defb9dcd..16ef0c1692aa 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -3366,8 +3366,8 @@ importers:
specifier: 18.3.1
version: 18.3.1([email protected])
react-grid-layout:
- specifier: ^2.2.4
+ specifier: ^2.3.0
react-intersection-observer:
specifier: ^9.5.3
version: 9.5.3([email protected])
@@ -21527,12 +21527,6 @@ packages:
peerDependencies:
react: 18.3.1
- resolution: {integrity: sha512-Eb57FsgOMYOfsUGrMI1ku/FFR+dPNPrE8qo+3hwZubpqVSy4GO9v52DeX50Tl3JDYAlCypP4rmw7Vrqk/zOIvA==}
- peerDependencies:
- react: 18.3.1
- react-dom: 18.3.1
-
resolution: {integrity: sha512-4ofzuR/MlYchp+ixDUVBxH6ybaw+JH51M+rpf675ik/++4Dn0Kax/Vf2Gv/7Z++mV1ZC7mY9UV2sRRycjGjKXQ==}
peerDependencies:
@@ -43738,17 +43732,6 @@ snapshots:
react: 18.3.1
unlayer-types: 1.532.0
- dependencies:
- clsx: 2.1.1
- fast-equals: 4.0.3
- prop-types: 15.8.1
- react: 18.3.1
- react-dom: 18.3.1([email protected])
- react-draggable: 4.5.0(patch_hash=b88af139afc5e153f59c5614bc991ce1404e950acff31e86a86d2f81bcf659e6)([email protected]([email protected]))([email protected])
- resize-observer-polyfill: 1.5.1
-
dependencies:
clsx: 2.1.1
diff --git a/products/dashboards/PERFORMANCE.md b/products/dashboards/PERFORMANCE.md
index 82493f98dd79..152fd172512e 100644
--- a/products/dashboards/PERFORMANCE.md
+++ b/products/dashboards/PERFORMANCE.md
@@ -205,9 +205,9 @@ Do not convert one local result into a general performance guarantee.
## Code references
-- [Dashboard grid and event handlers](../../frontend/src/scenes/dashboard/DashboardItems.tsx).
+- [Dashboard grid and event handlers](./frontend/DashboardItems.tsx).
- [Interaction state and layout commits](../../frontend/src/scenes/dashboard/useDashboardLayoutInteraction.ts).
-- [Neighbor resize](../../frontend/src/scenes/dashboard/dashboardResizeCompactor.ts) and [compaction modes](./frontend/dashboardCustomization.ts).
+- [Neighbor resize](./frontend/dashboardResizeCompactor.ts) and [compaction modes](./frontend/dashboardCustomization.ts).
- [Insight card lifecycle](../../frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx).
- [Canvas sizing](../../packages/quill/packages/charts/src/core/hooks/useChartCanvas.ts) and [draw scheduling](../../packages/quill/packages/charts/src/core/hooks/useChartDraw.ts).
- [Dashboard engineering skill](../../.agents/skills/managing-dashboards/SKILL.md) for access, queries, and surface contracts.
diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.py
index 21949f3b46d0..1dcc84c845db 100644
--- a/products/dashboards/backend/api/dashboard.py
+++ b/products/dashboards/backend/api/dashboard.py
@@ -588,7 +588,7 @@ def _apply_reorder_layout(
layout_mode: ReorderLayout,
) -> None:
"""Repack tiles. ``preserve`` keeps each tile's existing w/h and reuses the lowest-segment
- greedy algorithm from ``frontend/src/scenes/dashboard/tileLayouts.ts``; the other modes overwrite w/h."""
+ greedy algorithm from ``products/dashboards/frontend/tileLayouts.ts``; the other modes overwrite w/h."""
tiles_per_row = REORDER_LAYOUT_TILES_PER_ROW.get(layout_mode)
if tiles_per_row is not None:
tile_width = DASHBOARD_GRID_COLUMN_COUNT // tiles_per_row
diff --git a/products/dashboards/backend/widget_layouts.py b/products/dashboards/backend/widget_layouts.py
index f59f9d8445eb..b068ed9670eb 100644
--- a/products/dashboards/backend/widget_layouts.py
+++ b/products/dashboards/backend/widget_layouts.py
@@ -83,7 +83,7 @@ def collect_dashboard_sm_layouts(dashboard_tiles: list[Any]) -> list[dict[str, A
def _pack_at_bottom(column_heights: list[int], width: int, height: int) -> dict[str, int]:
"""Lowest-segment greedy placement, mirroring the dirty-tile packing in
- ``frontend/src/scenes/dashboard/tileLayouts.ts``: pick the leftmost ``width``-wide
+ ``products/dashboards/frontend/tileLayouts.ts``: pick the leftmost ``width``-wide
segment with the lowest top, ties keeping the leftmost."""
w = max(1, min(width, DASHBOARD_GRID_COLUMN_COUNT))
h = max(1, height)
diff --git a/frontend/src/scenes/dashboard/DashboardAddTileSubMenu.tsx b/products/dashboards/frontend/DashboardAddTileSubMenu.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/DashboardAddTileSubMenu.tsx
rename to products/dashboards/frontend/DashboardAddTileSubMenu.tsx
index 7098d59295b9..7b082707e0ff 100644
--- a/frontend/src/scenes/dashboard/DashboardAddTileSubMenu.tsx
+++ b/products/dashboards/frontend/DashboardAddTileSubMenu.tsx
@@ -1,10 +1,11 @@
import { useActions, useValues } from 'kea'
import { Fragment } from 'react'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+
import { SceneMenuBarItem, SceneMenuBarSeparator, SceneMenuBarSubMenu } from '~/layout/scenes/components/SceneMenuBar'
import { getDashboardAddTileOptions, groupDashboardAddTileOptions } from './dashboardAddTileOptions'
-import { dashboardLogic } from './dashboardLogic'
export function DashboardAddTileSubMenu(): JSX.Element {
const { tileGroupSectionsEnabled } = useValues(dashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DashboardAiPromptComposer.tsx b/products/dashboards/frontend/DashboardAiPromptComposer.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardAiPromptComposer.tsx
rename to products/dashboards/frontend/DashboardAiPromptComposer.tsx
index f93ab53b64ea..314b7ffff2ef 100644
--- a/frontend/src/scenes/dashboard/DashboardAiPromptComposer.tsx
+++ b/products/dashboards/frontend/DashboardAiPromptComposer.tsx
@@ -5,9 +5,9 @@ import type { FormEvent } from 'react'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
import { Link } from 'lib/lemon-ui/Link'
+import { reportDashboardEmptyAiPromptSubmitted } from 'scenes/dashboard/dashboardEvents'
import { dashboardAiPromptComposerLogic } from './dashboardAiPromptComposerLogic'
-import { reportDashboardEmptyAiPromptSubmitted } from './dashboardEvents'
function reportDashboardEmptyAiPromptClicked(
promptLabel: string,
diff --git a/frontend/src/scenes/dashboard/DashboardCustomizeButton.tsx b/products/dashboards/frontend/DashboardCustomizeButton.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardCustomizeButton.tsx
rename to products/dashboards/frontend/DashboardCustomizeButton.tsx
index 33afe58a0d56..125a94dac6cc 100644
--- a/frontend/src/scenes/dashboard/DashboardCustomizeButton.tsx
+++ b/products/dashboards/frontend/DashboardCustomizeButton.tsx
@@ -8,11 +8,11 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonMenu, LemonMenuOverlay } from 'lib/lemon-ui/LemonMenu'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { Scene } from 'scenes/sceneTypes'
import { DashboardCustomizeMenu } from 'products/dashboards/frontend/components/DashboardCustomizeMenu/DashboardCustomizeMenu'
-import { dashboardLogic } from './dashboardLogic'
import { QuillDashboardCustomizeButton } from './QuillDashboardCustomizeButton'
export function DashboardCustomizeButton(): JSX.Element {
diff --git a/frontend/src/scenes/dashboard/DashboardCustomizeSubMenu.tsx b/products/dashboards/frontend/DashboardCustomizeSubMenu.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardCustomizeSubMenu.tsx
rename to products/dashboards/frontend/DashboardCustomizeSubMenu.tsx
index 9cbb3a3b0cfe..36275045f9a5 100644
--- a/frontend/src/scenes/dashboard/DashboardCustomizeSubMenu.tsx
+++ b/products/dashboards/frontend/DashboardCustomizeSubMenu.tsx
@@ -3,6 +3,7 @@ import { useActions, useValues } from 'kea'
import { IconGridMasonry } from '@posthog/icons'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import {
SceneMenuBarItem,
@@ -21,8 +22,6 @@ import {
TILE_GROUP_DISPLAY_LABELS,
} from 'products/dashboards/frontend/dashboardCustomization'
-import { dashboardLogic } from './dashboardLogic'
-
export function DashboardCustomizeSubMenu(): JSX.Element | null {
const {
dashboard,
diff --git a/frontend/src/scenes/dashboard/DashboardEditBar.tsx b/products/dashboards/frontend/DashboardEditBar.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardEditBar.tsx
rename to products/dashboards/frontend/DashboardEditBar.tsx
index 3c2ac5a1dc9d..b793d89e7149 100644
--- a/frontend/src/scenes/dashboard/DashboardEditBar.tsx
+++ b/products/dashboards/frontend/DashboardEditBar.tsx
@@ -13,12 +13,6 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
import { getProjectEventExistence } from 'lib/utils/getAppContext'
-import {
- DashboardControl,
- dashboardControlScopeText,
- isDashboardControlHidden,
-} from 'scenes/dashboard/dashboardControls'
-import { DashboardEditBarAdvancedFilters } from 'scenes/dashboard/DashboardEditBarAdvancedFilters'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { insightLogic } from 'scenes/insights/insightLogic'
import { Scene } from 'scenes/sceneTypes'
@@ -31,6 +25,9 @@ import { InsightLogicProps, IntervalType } from '~/types'
import { DashboardMetricVariables } from 'products/metrics/frontend/components/dashboardVariables/DashboardMetricVariables'
import { TaxonomicBreakdownFilter } from 'products/product_analytics/frontend/insights/editor/filters/BreakdownFilter/TaxonomicBreakdownFilter'
+import { DashboardControl, dashboardControlScopeText, isDashboardControlHidden } from './dashboardControls'
+import { DashboardEditBarAdvancedFilters } from './DashboardEditBarAdvancedFilters'
+
interface DashboardEditBarProps {
showDateFilter?: boolean
className?: string
diff --git a/frontend/src/scenes/dashboard/DashboardEditBarAdvancedFilters.tsx b/products/dashboards/frontend/DashboardEditBarAdvancedFilters.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardEditBarAdvancedFilters.tsx
rename to products/dashboards/frontend/DashboardEditBarAdvancedFilters.tsx
index 3de1150262e4..3033015ca6f9 100644
--- a/frontend/src/scenes/dashboard/DashboardEditBarAdvancedFilters.tsx
+++ b/products/dashboards/frontend/DashboardEditBarAdvancedFilters.tsx
@@ -7,8 +7,6 @@ import { LemonBadge, LemonButton, LemonDivider, LemonLabel, LemonSegmentedButton
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { Popover } from 'lib/lemon-ui/Popover'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
-import { dashboardControlScopeText } from 'scenes/dashboard/dashboardControls'
-import { dashboardInsightColorsModalLogic } from 'scenes/dashboard/dashboardInsightColorsModalLogic'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
@@ -17,6 +15,9 @@ import { DashboardPlacement } from '~/types'
import { DashboardCompareFilter } from 'products/dashboards/frontend/components/DashboardCompareFilter/DashboardCompareFilter'
+import { dashboardControlScopeText } from './dashboardControls'
+import { dashboardInsightColorsModalLogic } from './dashboardInsightColorsModalLogic'
+
type TestAccountFilterChoice = 'inherit' | 'filter-out' | 'include'
const CHOICE_TO_FILTER: Record<TestAccountFilterChoice, boolean | null> = {
diff --git a/frontend/src/scenes/dashboard/DashboardEmptyGroupAddButton.tsx b/products/dashboards/frontend/DashboardEmptyGroupAddButton.tsx
similarity index 95%
rename from frontend/src/scenes/dashboard/DashboardEmptyGroupAddButton.tsx
rename to products/dashboards/frontend/DashboardEmptyGroupAddButton.tsx
index 519c524e391d..f535726f40f7 100644
--- a/frontend/src/scenes/dashboard/DashboardEmptyGroupAddButton.tsx
+++ b/products/dashboards/frontend/DashboardEmptyGroupAddButton.tsx
@@ -4,9 +4,9 @@ import { IconPlusSmall } from '@posthog/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonMenu } from 'lib/lemon-ui/LemonMenu'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { getAddTileMenuItems } from './DashboardHeaderActions'
-import { dashboardLogic } from './dashboardLogic'
export function DashboardEmptyGroupAddButton({ groupKey }: { groupKey: string }): JSX.Element {
const {
diff --git a/products/dashboards/frontend/DashboardFilters.stories.tsx b/products/dashboards/frontend/DashboardFilters.stories.tsx
index 648a10eefecc..7651f6d246ea 100644
--- a/products/dashboards/frontend/DashboardFilters.stories.tsx
+++ b/products/dashboards/frontend/DashboardFilters.stories.tsx
@@ -4,7 +4,6 @@ import { BindLogic } from 'kea'
import { router } from 'kea-router'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
-import { DashboardFilterBar } from 'scenes/dashboard/DashboardFilters'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { encodeURLFilters, encodeURLVariables } from 'scenes/dashboard/dashboardUtils'
@@ -13,6 +12,8 @@ import { variableDataLogic } from '~/queries/nodes/DataVisualization/Components/
import { NodeKind, type DashboardFilter } from '~/queries/schema/schema-general'
import { AccessControlLevel, DashboardType, PropertyFilterType, PropertyOperator, InsightModel } from '~/types'
+import { DashboardFilterBar } from './DashboardFilters'
+
type FilterBarState = 'saved' | 'unsaved'
type DashboardFilterKind = 'date' | 'properties' | 'breakdown' | 'interval' | 'testAccounts'
type DashboardChangeKind = DashboardFilterKind | 'sqlVariables'
diff --git a/frontend/src/scenes/dashboard/DashboardFilters.test.tsx b/products/dashboards/frontend/DashboardFilters.test.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/DashboardFilters.test.tsx
rename to products/dashboards/frontend/DashboardFilters.test.tsx
index 306282f8dddb..c405d73e0891 100644
--- a/frontend/src/scenes/dashboard/DashboardFilters.test.tsx
+++ b/products/dashboards/frontend/DashboardFilters.test.tsx
@@ -5,12 +5,12 @@ import { BindLogic } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { initKeaTests } from '~/test/init'
import { AccessControlLevel, DashboardPlacement, DashboardType } from '~/types'
import { DashboardFilterBar } from './DashboardFilters'
-import { dashboardLogic } from './dashboardLogic'
const FILTERS = {
metricVariables: [{ name: 'service', label: 'Service', source: 'custom', customValues: ['api', 'web'] }],
diff --git a/frontend/src/scenes/dashboard/DashboardFilters.tsx b/products/dashboards/frontend/DashboardFilters.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardFilters.tsx
rename to products/dashboards/frontend/DashboardFilters.tsx
index 03916e8063d5..7e6323b95f10 100644
--- a/frontend/src/scenes/dashboard/DashboardFilters.tsx
+++ b/products/dashboards/frontend/DashboardFilters.tsx
@@ -5,6 +5,7 @@ import { IconEllipsis } from '@posthog/icons'
import { LemonButton, LemonMenu } from '@posthog/lemon-ui'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { urls } from 'scenes/urls'
import { isSharedView } from '~/exporter/exporterViewLogic'
@@ -15,7 +16,6 @@ import { DashboardUnsavedChangesIndicator } from 'products/dashboards/frontend/d
import { DashboardMetricVariables } from 'products/metrics/frontend/components/dashboardVariables/DashboardMetricVariables'
import { DashboardEditBar } from './DashboardEditBar'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardReloadAction, LastRefreshText } from './DashboardReloadAction'
interface DashboardFilterBarProps {
diff --git a/frontend/src/scenes/dashboard/DashboardFlagCalledBanner.tsx b/products/dashboards/frontend/DashboardFlagCalledBanner.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardFlagCalledBanner.tsx
rename to products/dashboards/frontend/DashboardFlagCalledBanner.tsx
index e3ac5e5e5cbf..bf04fb837ed4 100644
--- a/frontend/src/scenes/dashboard/DashboardFlagCalledBanner.tsx
+++ b/products/dashboards/frontend/DashboardFlagCalledBanner.tsx
@@ -5,12 +5,11 @@ import { Link } from '@posthog/lemon-ui'
import { insightReadsFlagCalls } from 'lib/components/FlagCalledRebuildBanner/flagCalledDependencies'
import { FlagCalledRebuildBanner } from 'lib/components/FlagCalledRebuildBanner/FlagCalledRebuildBanner'
import { pluralize } from 'lib/utils/strings'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { urls } from 'scenes/urls'
import { DashboardPlacement } from '~/types'
-import { dashboardLogic } from './dashboardLogic'
-
export function DashboardFlagCalledBanner(): JSX.Element | null {
const { insightTiles, placement } = useValues(dashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DashboardHeaderActions.tsx b/products/dashboards/frontend/DashboardHeaderActions.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardHeaderActions.tsx
rename to products/dashboards/frontend/DashboardHeaderActions.tsx
index 0de38e803178..af55745f42b9 100644
--- a/frontend/src/scenes/dashboard/DashboardHeaderActions.tsx
+++ b/products/dashboards/frontend/DashboardHeaderActions.tsx
@@ -11,6 +11,8 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonMenu, LemonMenuItem, LemonMenuItems } from 'lib/lemon-ui/LemonMenu'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
+import { reportDashboardAddMenuOpened } from 'scenes/dashboard/dashboardEvents'
+import { DashboardLoadAction, dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { MaxTool } from 'scenes/max/MaxTool'
import { Scene } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -28,8 +30,6 @@ import {
groupDashboardAddTileOptions,
} from './dashboardAddTileOptions'
import { DashboardCustomizeButton } from './DashboardCustomizeButton'
-import { reportDashboardAddMenuOpened } from './dashboardEvents'
-import { DashboardLoadAction, dashboardLogic } from './dashboardLogic'
import { DashboardSubscribeButton } from './DashboardSubscribeButton'
// pinned: autocapture data-attrs for the header's Add menu items
diff --git a/frontend/src/scenes/dashboard/DashboardInsightColorsModal.stories.tsx b/products/dashboards/frontend/DashboardInsightColorsModal.stories.tsx
similarity index 84%
rename from frontend/src/scenes/dashboard/DashboardInsightColorsModal.stories.tsx
rename to products/dashboards/frontend/DashboardInsightColorsModal.stories.tsx
index 6f00fce5e223..e7e2b65c943e 100644
--- a/frontend/src/scenes/dashboard/DashboardInsightColorsModal.stories.tsx
+++ b/products/dashboards/frontend/DashboardInsightColorsModal.stories.tsx
@@ -2,14 +2,15 @@ import { Meta, StoryObj } from '@storybook/react'
import { BindLogic, useActions, useMountedLogic } from 'kea'
import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import dashboardFixture from 'scenes/dashboard/__mocks__/dashboard.json'
-import { DashboardInsightColorsModal } from 'scenes/dashboard/DashboardInsightColorsModal'
-import { dashboardInsightColorsModalLogic } from 'scenes/dashboard/dashboardInsightColorsModalLogic'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { useStorybookMocks } from '~/mocks/browser'
import { DashboardType } from '~/types'
+import dashboardFixture from './__mocks__/dashboard.json'
+import { DashboardInsightColorsModal } from './DashboardInsightColorsModal'
+import { dashboardInsightColorsModalLogic } from './dashboardInsightColorsModalLogic'
+
const DASHBOARD_ID = 5
const dashboard = {
diff --git a/frontend/src/scenes/dashboard/DashboardInsightColorsModal.tsx b/products/dashboards/frontend/DashboardInsightColorsModal.tsx
similarity index 99%
rename from frontend/src/scenes/dashboard/DashboardInsightColorsModal.tsx
rename to products/dashboards/frontend/DashboardInsightColorsModal.tsx
index 25b4c8dfe5a5..f86790e13aff 100644
--- a/frontend/src/scenes/dashboard/DashboardInsightColorsModal.tsx
+++ b/products/dashboards/frontend/DashboardInsightColorsModal.tsx
@@ -13,6 +13,15 @@ import {
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
import stringWithWBR from 'lib/utils/stringWithWBR'
+import {
+ BreakdownColorConfig,
+ BreakdownValueAndType,
+ COHORT_BREAKDOWN_PROPERTY_KEY,
+ denormalizeBreakdownValue,
+ findBreakdownColorConfig,
+ parseBreakdownPropertyKey,
+} from 'scenes/dashboard/dashboardBreakdownColors'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { formatBreakdownLabel } from 'scenes/insights/utils'
import { dataColorThemesLogic } from 'scenes/settings/environment/dataColorThemesLogic'
@@ -23,16 +32,7 @@ import { DataColorThemeModel } from '~/types'
import { BreakdownTag } from 'products/product_analytics/frontend/insights/editor/filters/BreakdownFilter/BreakdownTag'
-import {
- BreakdownColorConfig,
- BreakdownValueAndType,
- COHORT_BREAKDOWN_PROPERTY_KEY,
- denormalizeBreakdownValue,
- findBreakdownColorConfig,
- parseBreakdownPropertyKey,
-} from './dashboardBreakdownColors'
import { dashboardInsightColorsModalLogic } from './dashboardInsightColorsModalLogic'
-import { dashboardLogic } from './dashboardLogic'
type BreakdownColorRow = BreakdownColorConfig & { pinnedConfig?: BreakdownColorConfig }
diff --git a/frontend/src/scenes/dashboard/DashboardItems.test.tsx b/products/dashboards/frontend/DashboardItems.test.tsx
similarity index 99%
rename from frontend/src/scenes/dashboard/DashboardItems.test.tsx
rename to products/dashboards/frontend/DashboardItems.test.tsx
index 626c114cb6bc..42723a3ca7e3 100644
--- a/frontend/src/scenes/dashboard/DashboardItems.test.tsx
+++ b/products/dashboards/frontend/DashboardItems.test.tsx
@@ -211,7 +211,7 @@ jest.mock('react-grid-layout/extras', () => ({
),
}))
-jest.mock('@posthog/products-dashboards/frontend/components/DashboardWidgetItem/DashboardWidgetItem', () => ({
+jest.mock('./components/DashboardWidgetItem/DashboardWidgetItem', () => ({
DashboardWidgetItem: () => <div data-attr="widget-card" />,
}))
diff --git a/frontend/src/scenes/dashboard/DashboardItems.tsx b/products/dashboards/frontend/DashboardItems.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardItems.tsx
rename to products/dashboards/frontend/DashboardItems.tsx
index 4aa0e1875afd..4fb9349a3a60 100644
--- a/frontend/src/scenes/dashboard/DashboardItems.tsx
+++ b/products/dashboards/frontend/DashboardItems.tsx
@@ -1,5 +1,3 @@
-import './DashboardItems.scss'
-
import clsx from 'clsx'
import { useActions, useAsyncActions, useMountedLogic, useValues } from 'kea'
import { router } from 'kea-router'
@@ -9,9 +7,7 @@ import { GridLayout, Responsive as ReactGridLayout } from 'react-grid-layout'
import type { Layout, LayoutItem } from 'react-grid-layout'
import { type PositionStrategy, setTransform } from 'react-grid-layout/core'
-import { DashboardWidgetItem } from '@posthog/products-dashboards/frontend/components/DashboardWidgetItem/DashboardWidgetItem'
-import { getDashboardWidgetFetchDisplayError } from '@posthog/products-dashboards/frontend/widgets/constants'
-
+import 'scenes/dashboard/DashboardItems.scss'
import { ApiError } from 'lib/api'
import { dashboardWidgetMenusLogic } from 'lib/components/Cards/InsightCard/dashboardWidgetMenusLogic'
import { EditModeEdge, useResizeHandleScrollbarPassThrough } from 'lib/components/Cards/InsightCard/EditModeEdgeOverlay'
@@ -19,8 +15,6 @@ import { TileDecorations } from 'lib/components/TileDecorations/TileDecorations'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
import { objectsEqual } from 'lib/utils/objects'
-import { getDashboardAddTileOptions } from 'scenes/dashboard/dashboardAddTileOptions'
-import { DashboardEmptyGroupAddButton } from 'scenes/dashboard/DashboardEmptyGroupAddButton'
import { reportDashboardTileRepositioned } from 'scenes/dashboard/dashboardEvents'
import { DashboardLoadAction, dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import {
@@ -57,8 +51,12 @@ import { useClickToMoveTile } from 'products/dashboards/frontend/useClickToMoveT
import { useDashboardContainerWidth } from 'products/dashboards/frontend/useDashboardContainerWidth'
import { TAKE_OUT_DROP_ZONE_KEY, useTileGroupDrag } from 'products/dashboards/frontend/useTileGroupDrag'
+import { DashboardWidgetItem } from './components/DashboardWidgetItem/DashboardWidgetItem'
+import { getDashboardAddTileOptions } from './dashboardAddTileOptions'
+import { DashboardEmptyGroupAddButton } from './DashboardEmptyGroupAddButton'
import { DashboardButtonTileItem } from './items/DashboardButtonTileItem'
import { DashboardErrorTileItem } from './items/DashboardErrorTileItem'
+import { getDashboardWidgetFetchDisplayError } from './widgets/constants'
const BASE_ROW_HEIGHT = 80
const BASE_MARGIN: [number, number] = [16, 16]
diff --git a/frontend/src/scenes/dashboard/DashboardModalLoading.test.tsx b/products/dashboards/frontend/DashboardModalLoading.test.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardModalLoading.test.tsx
rename to products/dashboards/frontend/DashboardModalLoading.test.tsx
diff --git a/frontend/src/scenes/dashboard/DashboardModalLoading.tsx b/products/dashboards/frontend/DashboardModalLoading.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardModalLoading.tsx
rename to products/dashboards/frontend/DashboardModalLoading.tsx
diff --git a/frontend/src/scenes/dashboard/DashboardModals.test.tsx b/products/dashboards/frontend/DashboardModals.test.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardModals.test.tsx
rename to products/dashboards/frontend/DashboardModals.test.tsx
index 045528853a39..42018930d2ba 100644
--- a/frontend/src/scenes/dashboard/DashboardModals.test.tsx
+++ b/products/dashboards/frontend/DashboardModals.test.tsx
@@ -3,13 +3,13 @@ import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { ButtonTileCardModal } from 'lib/components/Cards/ButtonTileCard/ButtonTileCardModal'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import type { DashboardType } from '~/types'
import { ImageTileModal } from 'products/dashboards/frontend/components/ImageTile/ImageTileModal'
import { EditModeActions } from './DashboardHeaderActions'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardModals } from './DashboardModals'
jest.mock('kea', () => ({
@@ -21,7 +21,7 @@ jest.mock('kea-router', () => ({
router: { __mock: 'router', values: { location: { pathname: '/project/1/dashboard/5' }, searchParams: {} } },
}))
-jest.mock('./dashboardLogic', () => ({
+jest.mock('scenes/dashboard/dashboardLogic', () => ({
dashboardLogic: { __mock: 'dashboardLogic' },
}))
@@ -50,7 +50,7 @@ jest.mock('products/dashboards/frontend/components/DashboardCustomizeMenu/Dashbo
jest.mock('./DashboardCustomizeButton', () => ({ DashboardCustomizeButton: () => null }))
-jest.mock('@posthog/products-dashboards/frontend/widgets/AddWidgetModal', () => ({
+jest.mock('./widgets/AddWidgetModal', () => ({
AddWidgetModal: () => null,
}))
diff --git a/frontend/src/scenes/dashboard/DashboardModals.tsx b/products/dashboards/frontend/DashboardModals.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardModals.tsx
rename to products/dashboards/frontend/DashboardModals.tsx
index 516ccc833eb5..bffdf2206fb8 100644
--- a/frontend/src/scenes/dashboard/DashboardModals.tsx
+++ b/products/dashboards/frontend/DashboardModals.tsx
@@ -6,6 +6,7 @@ import { ButtonTileCardModal } from 'lib/components/Cards/ButtonTileCard/ButtonT
import { useKeepMountedWhileOpen } from 'lib/hooks/useKeepMountedWhileOpen'
import { removeProjectIdIfPresent } from 'lib/utils/kea-router'
import { lazyWithRetry } from 'lib/utils/retryImport'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -15,7 +16,6 @@ import { DashboardMode, DashboardType } from '~/types'
import { getImageOnlyTextCardImage } from 'products/dashboards/frontend/components/ImageTile/imageTileUtils'
import { DashboardInsightColorsModal } from './DashboardInsightColorsModal'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardModalLoading } from './DashboardModalLoading'
import { DashboardTemplateEditor } from './DashboardTemplateEditor'
import { DeleteDashboardModal } from './DeleteDashboardModal'
@@ -23,7 +23,7 @@ import { DuplicateDashboardModal } from './DuplicateDashboardModal'
// These modals carry their own editors, the rich text stack included, and integration setup, which a dashboard needs only once one opens.
const AddWidgetModal = lazyWithRetry(() =>
- import('@posthog/products-dashboards/frontend/widgets/AddWidgetModal').then((m) => ({ default: m.AddWidgetModal }))
+ import('./widgets/AddWidgetModal').then((m) => ({ default: m.AddWidgetModal }))
)
const SharingModal = lazyWithRetry(() =>
import('lib/components/Sharing/SharingModal').then((m) => ({ default: m.SharingModal }))
diff --git a/frontend/src/scenes/dashboard/DashboardQueryScanBanner.tsx b/products/dashboards/frontend/DashboardQueryScanBanner.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardQueryScanBanner.tsx
rename to products/dashboards/frontend/DashboardQueryScanBanner.tsx
index 2c06ebecf0b0..6692ecae5ca1 100644
--- a/frontend/src/scenes/dashboard/DashboardQueryScanBanner.tsx
+++ b/products/dashboards/frontend/DashboardQueryScanBanner.tsx
@@ -2,11 +2,11 @@ import { useActions, useValues } from 'kea'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { Link } from 'lib/lemon-ui/Link'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { urls } from 'scenes/urls'
import { QueryScanDashboardEntry, queryScanDashboardEntries } from '~/queries/nodes/DataNode/queryScan'
-import { dashboardLogic } from './dashboardLogic'
import { dashboardQueryScanBannerLogic } from './dashboardQueryScanBannerLogic'
const COLLAPSED_ENTRY_COUNT = 3
diff --git a/frontend/src/scenes/dashboard/DashboardReloadAction.test.tsx b/products/dashboards/frontend/DashboardReloadAction.test.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/DashboardReloadAction.test.tsx
rename to products/dashboards/frontend/DashboardReloadAction.test.tsx
index 4931a2fe2bc4..af5758b7896a 100644
--- a/frontend/src/scenes/dashboard/DashboardReloadAction.test.tsx
+++ b/products/dashboards/frontend/DashboardReloadAction.test.tsx
@@ -5,14 +5,14 @@ import { BindLogic } from 'kea'
import { expectLogic } from 'kea-test-utils'
import { dayjs } from 'lib/dayjs'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+import * as dashboardUtils from 'scenes/dashboard/dashboardUtils'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { AccessControlLevel, DashboardTile, DashboardType, InsightModel } from '~/types'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardReloadAction } from './DashboardReloadAction'
-import * as dashboardUtils from './dashboardUtils'
const REFRESH_BUTTON_SELECTOR = '[data-attr="dashboard-items-action-refresh"]'
// The "up to date" check icon is what contradicted a stale age, and its clip path is the only marker it leaves
diff --git a/frontend/src/scenes/dashboard/DashboardReloadAction.tsx b/products/dashboards/frontend/DashboardReloadAction.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardReloadAction.tsx
rename to products/dashboards/frontend/DashboardReloadAction.tsx
diff --git a/frontend/src/scenes/dashboard/DashboardRetentionBanner.tsx b/products/dashboards/frontend/DashboardRetentionBanner.tsx
similarity index 93%
rename from frontend/src/scenes/dashboard/DashboardRetentionBanner.tsx
rename to products/dashboards/frontend/DashboardRetentionBanner.tsx
index f2f55cb137c2..1871679b29bd 100644
--- a/frontend/src/scenes/dashboard/DashboardRetentionBanner.tsx
+++ b/products/dashboards/frontend/DashboardRetentionBanner.tsx
@@ -2,9 +2,9 @@ import { useActions, useValues } from 'kea'
import { LemonBanner } from '@posthog/lemon-ui'
-import { dataRetentionBannerLogic } from 'products/product_analytics/frontend/insights/dataRetention/dataRetentionBannerLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import { dashboardLogic } from './dashboardLogic'
+import { dataRetentionBannerLogic } from 'products/product_analytics/frontend/insights/dataRetention/dataRetentionBannerLogic'
export const DashboardRetentionBanner = (): JSX.Element | null => {
const { showRetentionBanner, retentionPeriodLabel } = useValues(dashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DashboardSaveAsTemplateSceneActions.tsx b/products/dashboards/frontend/DashboardSaveAsTemplateSceneActions.tsx
similarity index 94%
rename from frontend/src/scenes/dashboard/DashboardSaveAsTemplateSceneActions.tsx
rename to products/dashboards/frontend/DashboardSaveAsTemplateSceneActions.tsx
index 1ac8c643b22b..574faec7b9b6 100644
--- a/frontend/src/scenes/dashboard/DashboardSaveAsTemplateSceneActions.tsx
+++ b/products/dashboards/frontend/DashboardSaveAsTemplateSceneActions.tsx
@@ -5,10 +5,11 @@ import { IconScreen } from '@posthog/icons'
import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'
import { getAccessControlDisabledReason, userHasAccess } from 'lib/utils/accessControlUtils'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import { dashboardTemplateModalLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplateModalLogic'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
+import { dashboardTemplateModalLogic } from './dashboards/templates/dashboardTemplateModalLogic'
+
/** Single entry: save this dashboard as a project template (modal; staff get an optional JSON editor from there). */
export function DashboardSaveAsTemplateSceneActions(): JSX.Element | null {
const { asDashboardTemplate, canSaveProjectDashboardTemplate } = useValues(dashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DashboardSceneMenuBar.tsx b/products/dashboards/frontend/DashboardSceneMenuBar.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/DashboardSceneMenuBar.tsx
rename to products/dashboards/frontend/DashboardSceneMenuBar.tsx
index c1dc6cd0c22d..f1ecf7fb873e 100644
--- a/frontend/src/scenes/dashboard/DashboardSceneMenuBar.tsx
+++ b/products/dashboards/frontend/DashboardSceneMenuBar.tsx
@@ -29,8 +29,8 @@ import { getAccessControlDisabledReason, userHasAccess } from 'lib/utils/accessC
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
import { newInternalTab } from 'lib/utils/newInternalTab'
import { slugify } from 'lib/utils/strings'
-import { deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
-import { duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+import { dashboardTemplateForExport } from 'scenes/dashboard/dashboardUtils'
import { interProjectCopyLogic } from 'scenes/resource-transfer/interProjectCopyLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -55,9 +55,9 @@ import { urlForSubscriptions } from 'products/subscriptions/frontend/components/
import { DashboardAddTileSubMenu } from './DashboardAddTileSubMenu'
import { DashboardCustomizeSubMenu } from './DashboardCustomizeSubMenu'
import { dashboardInsightColorsModalLogic } from './dashboardInsightColorsModalLogic'
-import { dashboardLogic } from './dashboardLogic'
import { dashboardTemplateModalLogic } from './dashboards/templates/dashboardTemplateModalLogic'
-import { dashboardTemplateForExport } from './dashboardUtils'
+import { deleteDashboardLogic } from './deleteDashboardLogic'
+import { duplicateDashboardLogic } from './duplicateDashboardLogic'
const RESOURCE_TYPE = 'dashboard'
diff --git a/frontend/src/scenes/dashboard/DashboardScenePanel.tsx b/products/dashboards/frontend/DashboardScenePanel.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardScenePanel.tsx
rename to products/dashboards/frontend/DashboardScenePanel.tsx
index ec45146f0b23..e9362449fd70 100644
--- a/frontend/src/scenes/dashboard/DashboardScenePanel.tsx
+++ b/products/dashboards/frontend/DashboardScenePanel.tsx
@@ -15,8 +15,8 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
import { slugify } from 'lib/utils/strings'
-import { deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
-import { duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+import { dashboardTemplateForExport } from 'scenes/dashboard/dashboardUtils'
import { interProjectCopyLogic } from 'scenes/resource-transfer/interProjectCopyLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -32,10 +32,10 @@ import { tagsModel } from '~/models/tagsModel'
import { AccessControlLevel, AccessControlResourceType, DashboardMode, ExporterFormat } from '~/types'
import { dashboardInsightColorsModalLogic } from './dashboardInsightColorsModalLogic'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardTemplateModal } from './dashboards/templates/DashboardTemplateModal'
import { DashboardSaveAsTemplateSceneActions } from './DashboardSaveAsTemplateSceneActions'
-import { dashboardTemplateForExport } from './dashboardUtils'
+import { deleteDashboardLogic } from './deleteDashboardLogic'
+import { duplicateDashboardLogic } from './duplicateDashboardLogic'
const RESOURCE_TYPE = 'dashboard'
diff --git a/products/dashboards/frontend/DashboardStates.stories.tsx b/products/dashboards/frontend/DashboardStates.stories.tsx
index 76a488e31e94..b48ac336b156 100644
--- a/products/dashboards/frontend/DashboardStates.stories.tsx
+++ b/products/dashboards/frontend/DashboardStates.stories.tsx
@@ -6,11 +6,11 @@ import { NotFound } from 'lib/components/NotFound'
import { Link } from 'lib/lemon-ui/Link'
import { DashboardHeader } from 'scenes/dashboard/DashboardHeader'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import { EmptyDashboardComponent } from 'scenes/dashboard/EmptyDashboardComponent'
import { InsightErrorState } from 'scenes/insights/EmptyStates'
import { urls } from 'scenes/urls'
import { DashboardLoadingState } from './components/DashboardLoadingState/DashboardLoadingState'
+import { EmptyDashboardComponent } from './EmptyDashboardComponent'
const DASHBOARD_STATES = [
'Loading',
diff --git a/frontend/src/scenes/dashboard/DashboardSubscribeButton.scss b/products/dashboards/frontend/DashboardSubscribeButton.scss
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardSubscribeButton.scss
rename to products/dashboards/frontend/DashboardSubscribeButton.scss
diff --git a/frontend/src/scenes/dashboard/DashboardSubscribeButton.tsx b/products/dashboards/frontend/DashboardSubscribeButton.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardSubscribeButton.tsx
rename to products/dashboards/frontend/DashboardSubscribeButton.tsx
index 87d978f098d0..13f94379f374 100644
--- a/frontend/src/scenes/dashboard/DashboardSubscribeButton.tsx
+++ b/products/dashboards/frontend/DashboardSubscribeButton.tsx
@@ -9,11 +9,11 @@ import { IconBell } from '@posthog/icons'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { IconWithCount } from 'lib/lemon-ui/icons/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { subscriptionsLogic } from 'products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic'
import { urlForSubscriptions } from 'products/subscriptions/frontend/components/Subscriptions/utils'
-import { dashboardLogic } from './dashboardLogic'
import { QuillDashboardSubscribeButton } from './QuillDashboardSubscribeButton'
function SubscribeCountIcon({ dashboardId }: { dashboardId: number }): JSX.Element {
diff --git a/frontend/src/scenes/dashboard/DashboardSubscribeNudgeToast.tsx b/products/dashboards/frontend/DashboardSubscribeNudgeToast.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardSubscribeNudgeToast.tsx
rename to products/dashboards/frontend/DashboardSubscribeNudgeToast.tsx
diff --git a/frontend/src/scenes/dashboard/DashboardTemplateEditor.tsx b/products/dashboards/frontend/DashboardTemplateEditor.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/DashboardTemplateEditor.tsx
rename to products/dashboards/frontend/DashboardTemplateEditor.tsx
diff --git a/frontend/src/scenes/dashboard/DashboardTemplateVariables.tsx b/products/dashboards/frontend/DashboardTemplateVariables.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DashboardTemplateVariables.tsx
rename to products/dashboards/frontend/DashboardTemplateVariables.tsx
index b17486017fc7..24f159632627 100644
--- a/frontend/src/scenes/dashboard/DashboardTemplateVariables.tsx
+++ b/products/dashboards/frontend/DashboardTemplateVariables.tsx
@@ -3,13 +3,13 @@ import { useEffect } from 'react'
import { LemonLabel } from '@posthog/lemon-ui'
+import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
import { SeriesActionFilter } from 'scenes/insights/filters/ActionFilter/ActionFilter'
import { ChartDisplayCategory } from '~/types'
import { seriesToTemplateVariableStep, templateVariableStepToSeries } from './dashboardTemplateEntities'
import { dashboardTemplateVariablesLogic } from './dashboardTemplateVariablesLogic'
-import { newDashboardLogic } from './newDashboardLogic'
export function DashboardTemplateVariables(): JSX.Element {
const { activeDashboardTemplate } = useValues(newDashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DashboardWarehouseSyncBanner.tsx b/products/dashboards/frontend/DashboardWarehouseSyncBanner.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/DashboardWarehouseSyncBanner.tsx
rename to products/dashboards/frontend/DashboardWarehouseSyncBanner.tsx
index 2b7662fbd448..68190ba65554 100644
--- a/frontend/src/scenes/dashboard/DashboardWarehouseSyncBanner.tsx
+++ b/products/dashboards/frontend/DashboardWarehouseSyncBanner.tsx
@@ -2,12 +2,11 @@ import { useValues } from 'kea'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { pluralize } from 'lib/utils/strings'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { urls } from 'scenes/urls'
import { warehouseSyncDashboardSummary } from '~/queries/nodes/DataNode/warehouseSyncWarnings'
-import { dashboardLogic } from './dashboardLogic'
-
export function DashboardWarehouseSyncBanner(): JSX.Element | null {
const { dashboard, insightTiles } = useValues(dashboardLogic)
const summary = dashboard ? warehouseSyncDashboardSummary(insightTiles) : null
diff --git a/frontend/src/scenes/dashboard/DashboardZoomControl.tsx b/products/dashboards/frontend/DashboardZoomControl.tsx
similarity index 93%
rename from frontend/src/scenes/dashboard/DashboardZoomControl.tsx
rename to products/dashboards/frontend/DashboardZoomControl.tsx
index 32793310373f..755468354241 100644
--- a/frontend/src/scenes/dashboard/DashboardZoomControl.tsx
+++ b/products/dashboards/frontend/DashboardZoomControl.tsx
@@ -4,11 +4,10 @@ import posthog from 'posthog-js'
import { LemonButton } from '@posthog/lemon-ui'
import { Shortcut } from 'lib/components/Shortcuts/Shortcut'
+import { sanitizeDashboard } from 'scenes/dashboard/dashboardEvents'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { Scene } from 'scenes/sceneTypes'
-import { sanitizeDashboard } from './dashboardEvents'
-import { dashboardLogic } from './dashboardLogic'
-
interface DashboardZoomControlProps {
layoutZoom: number
setLayoutZoom: (value: number) => void
diff --git a/products/dashboards/frontend/DashboardsList.stories.tsx b/products/dashboards/frontend/DashboardsList.stories.tsx
index 576f4830704d..0885738ecff3 100644
--- a/products/dashboards/frontend/DashboardsList.stories.tsx
+++ b/products/dashboards/frontend/DashboardsList.stories.tsx
@@ -1,9 +1,8 @@
import type { Meta, StoryObj } from '@storybook/react'
-import __dashboards from 'scenes/dashboard/__mocks__/dashboards.json'
-
import { mswDecorator } from '~/mocks/browser'
+import __dashboards from './__mocks__/dashboards.json'
import { DashboardsTableContainer } from './dashboards/DashboardsTable'
const meta: Meta<typeof DashboardsTableContainer> = {
diff --git a/frontend/src/scenes/dashboard/DeleteDashboardModal.tsx b/products/dashboards/frontend/DeleteDashboardModal.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/DeleteDashboardModal.tsx
rename to products/dashboards/frontend/DeleteDashboardModal.tsx
index ed5d0f6eef1b..f473747d3ce8 100644
--- a/frontend/src/scenes/dashboard/DeleteDashboardModal.tsx
+++ b/products/dashboards/frontend/DeleteDashboardModal.tsx
@@ -5,7 +5,8 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonCheckbox } from 'lib/lemon-ui/LemonCheckbox'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonModal } from 'lib/lemon-ui/LemonModal'
-import { deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
+
+import { deleteDashboardLogic } from './deleteDashboardLogic'
export function DeleteDashboardModal(): JSX.Element {
const { hideDeleteDashboardModal } = useActions(deleteDashboardLogic)
diff --git a/frontend/src/scenes/dashboard/DuplicateDashboardModal.tsx b/products/dashboards/frontend/DuplicateDashboardModal.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/DuplicateDashboardModal.tsx
rename to products/dashboards/frontend/DuplicateDashboardModal.tsx
index 65da0ff48dcf..95a427e047e3 100644
--- a/frontend/src/scenes/dashboard/DuplicateDashboardModal.tsx
+++ b/products/dashboards/frontend/DuplicateDashboardModal.tsx
@@ -5,7 +5,8 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonCheckbox } from 'lib/lemon-ui/LemonCheckbox'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonModal } from 'lib/lemon-ui/LemonModal'
-import { duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
+
+import { duplicateDashboardLogic } from './duplicateDashboardLogic'
export function DuplicateDashboardModal(): JSX.Element {
const { hideDuplicateDashboardModal } = useActions(duplicateDashboardLogic)
diff --git a/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx b/products/dashboards/frontend/EmptyDashboardComponent.test.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx
rename to products/dashboards/frontend/EmptyDashboardComponent.test.tsx
index 3919a3f5dd25..1cbdfc8c2455 100644
--- a/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx
+++ b/products/dashboards/frontend/EmptyDashboardComponent.test.tsx
@@ -4,6 +4,7 @@ import { cleanup, render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { BindLogic } from 'kea'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'
import { useMocks } from '~/mocks/jest'
@@ -11,7 +12,6 @@ import { initKeaTests } from '~/test/init'
import { AccessControlLevel, DashboardType } from '~/types'
import { addInsightToDashboardLogic } from './addInsightToDashboardModalLogic'
-import { dashboardLogic } from './dashboardLogic'
import { EmptyDashboardComponent } from './EmptyDashboardComponent'
const MOCK_DASHBOARD: DashboardType = {
diff --git a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx b/products/dashboards/frontend/EmptyDashboardComponent.tsx
similarity index 95%
rename from frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx
rename to products/dashboards/frontend/EmptyDashboardComponent.tsx
index 560acf4e7c7e..3fcf00ac948a 100644
--- a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx
+++ b/products/dashboards/frontend/EmptyDashboardComponent.tsx
@@ -2,13 +2,18 @@ import { useActions, useValues } from 'kea'
import * as chartPng from '@posthog/brand/hoggies/png/chart'
import { IconChevronDown, IconPlus } from '@posthog/icons'
-import { DashboardLoadingState } from '@posthog/products-dashboards/frontend/components/DashboardLoadingState/DashboardLoadingState'
import { pngHoggie } from 'lib/brand/hoggies'
import { AccessControlAction } from 'lib/components/AccessControlAction'
import { ProductIntroduction } from 'lib/components/ProductIntroduction/ProductIntroduction'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonMenu } from 'lib/lemon-ui/LemonMenu'
+import {
+ reportDashboardEmptyAddChartClicked,
+ reportDashboardEmptyWebAnalyticsClicked,
+} from 'scenes/dashboard/dashboardEvents'
+import { DASHBOARD_CANNOT_EDIT_MESSAGE } from 'scenes/dashboard/DashboardHeader'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'
import { urls } from 'scenes/urls'
@@ -16,11 +21,9 @@ import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePane
import { AccessControlLevel, AccessControlResourceType, DashboardType, SidePanelTab } from '~/types'
import { addInsightToDashboardLogic } from './addInsightToDashboardModalLogic'
+import { DashboardLoadingState } from './components/DashboardLoadingState/DashboardLoadingState'
import { DashboardAiPromptComposer } from './DashboardAiPromptComposer'
-import { reportDashboardEmptyAddChartClicked, reportDashboardEmptyWebAnalyticsClicked } from './dashboardEvents'
-import { DASHBOARD_CANNOT_EDIT_MESSAGE } from './DashboardHeader'
import { getAddTileMenuItems } from './DashboardHeaderActions'
-import { dashboardLogic } from './dashboardLogic'
const HedgehogChart = pngHoggie(chartPng)
diff --git a/products/dashboards/frontend/NewDashboardModal.stories.tsx b/products/dashboards/frontend/NewDashboardModal.stories.tsx
index 3d229accac49..795f3f5aefb8 100644
--- a/products/dashboards/frontend/NewDashboardModal.stories.tsx
+++ b/products/dashboards/frontend/NewDashboardModal.stories.tsx
@@ -1,8 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react'
import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import __dashboard_template_schema from 'scenes/dashboard/__mocks__/dashboard_template_schema.json'
-import __dashboard_templates from 'scenes/dashboard/__mocks__/dashboard_templates.json'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
import { NewDashboardModal as NewDashboardModalComponent } from 'scenes/dashboard/NewDashboardModal'
@@ -10,6 +8,9 @@ import { mswDecorator } from '~/mocks/browser'
import { useAvailableFeatures } from '~/mocks/features'
import { BaseMathType, EntityTypes } from '~/types'
+import __dashboard_template_schema from './__mocks__/dashboard_template_schema.json'
+import __dashboard_templates from './__mocks__/dashboard_templates.json'
+
const meta: Meta<typeof NewDashboardModalComponent> = {
component: NewDashboardModalComponent,
title: 'Products/Dashboards',
diff --git a/frontend/src/scenes/dashboard/QuillDashboardAddTileButton.tsx b/products/dashboards/frontend/QuillDashboardAddTileButton.tsx
similarity index 96%
rename from frontend/src/scenes/dashboard/QuillDashboardAddTileButton.tsx
rename to products/dashboards/frontend/QuillDashboardAddTileButton.tsx
index d72e4d107b4c..b342ca9c8ccc 100644
--- a/frontend/src/scenes/dashboard/QuillDashboardAddTileButton.tsx
+++ b/products/dashboards/frontend/QuillDashboardAddTileButton.tsx
@@ -13,6 +13,8 @@ import {
} from '@posthog/quill'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
+import { reportDashboardAddMenuOpened } from 'scenes/dashboard/dashboardEvents'
+import { DashboardLoadAction, dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { MaxTool } from 'scenes/max/MaxTool'
import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'
@@ -23,8 +25,6 @@ import {
getDashboardAddTileOptions,
groupDashboardAddTileOptions,
} from './dashboardAddTileOptions'
-import { reportDashboardAddMenuOpened } from './dashboardEvents'
-import { DashboardLoadAction, dashboardLogic } from './dashboardLogic'
// pinned: autocapture data-attrs for the header's Add menu items
const ADD_TILE_MENU_DATA_ATTRS: Record<DashboardAddTileKey, string> = {
diff --git a/frontend/src/scenes/dashboard/QuillDashboardCustomizeButton.tsx b/products/dashboards/frontend/QuillDashboardCustomizeButton.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/QuillDashboardCustomizeButton.tsx
rename to products/dashboards/frontend/QuillDashboardCustomizeButton.tsx
index ca24b161c145..13516c42747c 100644
--- a/frontend/src/scenes/dashboard/QuillDashboardCustomizeButton.tsx
+++ b/products/dashboards/frontend/QuillDashboardCustomizeButton.tsx
@@ -15,12 +15,11 @@ import {
import { Shortcut } from 'lib/components/Shortcuts/Shortcut'
import { keyBinds } from 'lib/components/Shortcuts/shortcuts'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { Scene } from 'scenes/sceneTypes'
import { DashboardCustomizeMenu } from 'products/dashboards/frontend/components/DashboardCustomizeMenu/DashboardCustomizeMenu'
-import { dashboardLogic } from './dashboardLogic'
-
export function QuillDashboardCustomizeButton(): JSX.Element {
const { setDashboardEditing } = useActions(dashboardLogic)
const { currentLayoutSize } = useValues(dashboardLogic)
diff --git a/frontend/src/scenes/dashboard/QuillDashboardHeaderActions.tsx b/products/dashboards/frontend/QuillDashboardHeaderActions.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/QuillDashboardHeaderActions.tsx
rename to products/dashboards/frontend/QuillDashboardHeaderActions.tsx
index 780d5358ec13..183b4d3d85a1 100644
--- a/frontend/src/scenes/dashboard/QuillDashboardHeaderActions.tsx
+++ b/products/dashboards/frontend/QuillDashboardHeaderActions.tsx
@@ -8,6 +8,7 @@ import { Shortcut } from 'lib/components/Shortcuts/Shortcut'
import { keyBinds } from 'lib/components/Shortcuts/shortcuts'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { Scene } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -15,7 +16,6 @@ import { AccessControlLevel, AccessControlResourceType, DashboardMode } from '~/
import { DashboardCustomizeMenu } from 'products/dashboards/frontend/components/DashboardCustomizeMenu/DashboardCustomizeMenu'
-import { dashboardLogic } from './dashboardLogic'
import { QuillDashboardAddTileButton } from './QuillDashboardAddTileButton'
import { QuillDashboardCustomizeButton } from './QuillDashboardCustomizeButton'
import { QuillDashboardSubscribeButton } from './QuillDashboardSubscribeButton'
diff --git a/frontend/src/scenes/dashboard/QuillDashboardSubscribeButton.tsx b/products/dashboards/frontend/QuillDashboardSubscribeButton.tsx
similarity index 95%
rename from frontend/src/scenes/dashboard/QuillDashboardSubscribeButton.tsx
rename to products/dashboards/frontend/QuillDashboardSubscribeButton.tsx
index 299df94d4a6b..d8ecba0a7be2 100644
--- a/frontend/src/scenes/dashboard/QuillDashboardSubscribeButton.tsx
+++ b/products/dashboards/frontend/QuillDashboardSubscribeButton.tsx
@@ -5,10 +5,11 @@ import posthog from 'posthog-js'
import { IconBell } from '@posthog/icons'
import { Button } from '@posthog/quill'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+
import { subscriptionsLogic } from 'products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic'
import { urlForSubscriptions } from 'products/subscriptions/frontend/components/Subscriptions/utils'
-import { dashboardLogic } from './dashboardLogic'
import { SubscriptionCountBadge } from './SubscriptionCountBadge'
export function QuillDashboardSubscribeButton(): JSX.Element | null {
diff --git a/frontend/src/scenes/dashboard/SubscriptionCountBadge.tsx b/products/dashboards/frontend/SubscriptionCountBadge.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/SubscriptionCountBadge.tsx
rename to products/dashboards/frontend/SubscriptionCountBadge.tsx
diff --git a/frontend/src/scenes/dashboard/TileFiltersOverride.scss b/products/dashboards/frontend/TileFiltersOverride.scss
similarity index 100%
rename from frontend/src/scenes/dashboard/TileFiltersOverride.scss
rename to products/dashboards/frontend/TileFiltersOverride.scss
diff --git a/frontend/src/scenes/dashboard/TileFiltersOverride.tsx b/products/dashboards/frontend/TileFiltersOverride.tsx
similarity index 99%
rename from frontend/src/scenes/dashboard/TileFiltersOverride.tsx
rename to products/dashboards/frontend/TileFiltersOverride.tsx
index 9b94c55ace2b..61e1e5d344a1 100644
--- a/frontend/src/scenes/dashboard/TileFiltersOverride.tsx
+++ b/products/dashboards/frontend/TileFiltersOverride.tsx
@@ -1,4 +1,3 @@
-// scenes/dashboard/TileFiltersOverride.tsx
import './TileFiltersOverride.scss'
import { BindLogic, useActions, useValues } from 'kea'
diff --git a/frontend/src/scenes/dashboard/__mocks__/dashboard.json b/products/dashboards/frontend/__mocks__/dashboard.json
similarity index 100%
rename from frontend/src/scenes/dashboard/__mocks__/dashboard.json
rename to products/dashboards/frontend/__mocks__/dashboard.json
diff --git a/frontend/src/scenes/dashboard/__mocks__/dashboard1.json b/products/dashboards/frontend/__mocks__/dashboard1.json
similarity index 100%
rename from frontend/src/scenes/dashboard/__mocks__/dashboard1.json
rename to products/dashboards/frontend/__mocks__/dashboard1.json
diff --git a/frontend/src/scenes/dashboard/__mocks__/dashboard_template_schema.json b/products/dashboards/frontend/__mocks__/dashboard_template_schema.json
similarity index 100%
rename from frontend/src/scenes/dashboard/__mocks__/dashboard_template_schema.json
rename to products/dashboards/frontend/__mocks__/dashboard_template_schema.json
diff --git a/frontend/src/scenes/dashboard/__mocks__/dashboard_templates.json b/products/dashboards/frontend/__mocks__/dashboard_templates.json
similarity index 100%
rename from frontend/src/scenes/dashboard/__mocks__/dashboard_templates.json
rename to products/dashboards/frontend/__mocks__/dashboard_templates.json
diff --git a/frontend/src/scenes/dashboard/__mocks__/dashboards.json b/products/dashboards/frontend/__mocks__/dashboards.json
similarity index 100%
rename from frontend/src/scenes/dashboard/__mocks__/dashboards.json
rename to products/dashboards/frontend/__mocks__/dashboards.json
diff --git a/frontend/src/scenes/dashboard/__snapshots__/DashboardItems.test.tsx.snap b/products/dashboards/frontend/__snapshots__/DashboardItems.test.tsx.snap
similarity index 100%
rename from frontend/src/scenes/dashboard/__snapshots__/DashboardItems.test.tsx.snap
rename to products/dashboards/frontend/__snapshots__/DashboardItems.test.tsx.snap
diff --git a/frontend/src/scenes/dashboard/addInsightToDashboardModalLogic.ts b/products/dashboards/frontend/addInsightToDashboardModalLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/addInsightToDashboardModalLogic.ts
rename to products/dashboards/frontend/addInsightToDashboardModalLogic.ts
diff --git a/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.stories.tsx b/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.stories.tsx
index dfc7fa63ba84..204b6ccd985d 100644
--- a/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.stories.tsx
+++ b/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.stories.tsx
@@ -2,14 +2,15 @@ import { Meta, StoryObj } from '@storybook/react'
import { BindLogic } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
-import __dashboard1 from 'scenes/dashboard/__mocks__/dashboard1.json'
-import __dashboards from 'scenes/dashboard/__mocks__/dashboards.json'
-import { AddInsightToDashboardModal } from 'scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal'
-import { addInsightToDashboardLogic } from 'scenes/dashboard/addInsightToDashboardModalLogic'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { mswDecorator } from '~/mocks/browser'
+import __dashboard1 from '../../__mocks__/dashboard1.json'
+import __dashboards from '../../__mocks__/dashboards.json'
+import { addInsightToDashboardLogic } from '../../addInsightToDashboardModalLogic'
+import { AddInsightToDashboardModal } from './AddInsightToDashboardModal'
+
const dashboardRaw = __dashboard1 as any
const dashboard = {
diff --git a/frontend/src/scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal.tsx b/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal.tsx
rename to products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.tsx
index d4a47bb7c24a..50b28fe92abb 100644
--- a/frontend/src/scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal.tsx
+++ b/products/dashboards/frontend/components/AddInsightToDashboardModal/AddInsightToDashboardModal.tsx
@@ -9,6 +9,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonModal } from 'lib/lemon-ui/LemonModal'
import { Popover } from 'lib/lemon-ui/Popover'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { addSavedInsightsModalLogic } from 'scenes/saved-insights/addSavedInsightsModalLogic'
import {
INSIGHT_TYPES_METADATA,
@@ -22,8 +23,7 @@ import { InsightType } from '~/types'
import { AddSavedInsightsToDashboard } from 'products/product_analytics/frontend/insights/savedInsights/AddSavedInsightsToDashboard'
-import { addInsightToDashboardLogic } from '../addInsightToDashboardModalLogic'
-import { dashboardLogic } from '../dashboardLogic'
+import { addInsightToDashboardLogic } from '../../addInsightToDashboardModalLogic'
const QUICK_CREATE_TYPES = [
{ type: InsightType.TRENDS, icon: IconInsightTrends, label: 'Trend' },
diff --git a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateItem.stories.tsx b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateItem.stories.tsx
index 615256506e85..57d10ae576bc 100644
--- a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateItem.stories.tsx
+++ b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateItem.stories.tsx
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from '@storybook/react'
-import type { DashboardTemplateItemProps } from 'scenes/dashboard/dashboards/templates/DashboardTemplateItem'
-import { TemplateItem } from 'scenes/dashboard/dashboards/templates/DashboardTemplateItem'
+import type { DashboardTemplateItemProps } from '../../dashboards/templates/DashboardTemplateItem'
+import { TemplateItem } from '../../dashboards/templates/DashboardTemplateItem'
// A small inline SVG data URI so stories don't depend on external network requests (picsum.photos)
// which cause flaky timeouts in CI when waiting for image naturalWidth.
diff --git a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateModal.stories.tsx b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateModal.stories.tsx
index abee1ca76065..9b41565d5be7 100644
--- a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateModal.stories.tsx
+++ b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplateModal.stories.tsx
@@ -3,18 +3,19 @@ import { MOCK_DEFAULT_USER, MOCK_TEAM_ID } from 'lib/api.mock'
import { Meta, StoryObj, type Decorator } from '@storybook/react'
import { useEffect } from 'react'
-import __dashboard_template_schema from 'scenes/dashboard/__mocks__/dashboard_template_schema.json'
-import __dashboard_templates from 'scenes/dashboard/__mocks__/dashboard_templates.json'
-import { DashboardTemplateModal } from 'scenes/dashboard/dashboards/templates/DashboardTemplateModal'
-import { dashboardTemplateModalLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplateModalLogic'
-import { DashboardTemplateEditor } from 'scenes/dashboard/DashboardTemplateEditor'
-import { dashboardTemplateEditorLogic } from 'scenes/dashboard/dashboardTemplateEditorLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
import { mswDecorator } from '~/mocks/browser'
import { InsightColor, type DashboardTemplateEditorType, type DashboardTemplateType } from '~/types'
+import __dashboard_template_schema from '../../__mocks__/dashboard_template_schema.json'
+import __dashboard_templates from '../../__mocks__/dashboard_templates.json'
+import { DashboardTemplateModal } from '../../dashboards/templates/DashboardTemplateModal'
+import { dashboardTemplateModalLogic } from '../../dashboards/templates/dashboardTemplateModalLogic'
+import { DashboardTemplateEditor } from '../../DashboardTemplateEditor'
+import { dashboardTemplateEditorLogic } from '../../dashboardTemplateEditorLogic'
+
type ViewerMode = 'staff' | 'nonStaff'
type ModalStoryVariant = 'create' | 'edit'
diff --git a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplatesTable.stories.tsx b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplatesTable.stories.tsx
index ff480156ad15..252b4f049191 100644
--- a/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplatesTable.stories.tsx
+++ b/products/dashboards/frontend/components/DashboardTemplates/DashboardTemplatesTable.stories.tsx
@@ -11,10 +11,6 @@ import {
import { Meta, StoryObj, type Decorator } from '@storybook/react'
import { useEffect } from 'react'
-import __dashboard_template_schema from 'scenes/dashboard/__mocks__/dashboard_template_schema.json'
-import { DashboardTemplateModal } from 'scenes/dashboard/dashboards/templates/DashboardTemplateModal'
-import { dashboardTemplatesLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
-import { DashboardTemplateEditor } from 'scenes/dashboard/DashboardTemplateEditor'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -30,7 +26,11 @@ import {
type UserType,
} from '~/types'
+import __dashboard_template_schema from '../../__mocks__/dashboard_template_schema.json'
+import { DashboardTemplateModal } from '../../dashboards/templates/DashboardTemplateModal'
+import { dashboardTemplatesLogic } from '../../dashboards/templates/dashboardTemplatesLogic'
import { DashboardTemplatesTable } from '../../dashboards/templates/DashboardTemplatesTable'
+import { DashboardTemplateEditor } from '../../DashboardTemplateEditor'
/** Same key as `DashboardTemplatesTable` — list load is driven by `/dashboard` urlToAction in-app; storybook calls `getAllTemplates` after mount so the table is not stuck empty. */
const templatesTabListLogic = dashboardTemplatesLogic({ scope: 'default', templatesTabList: true })
diff --git a/frontend/src/scenes/dashboard/dashboardActivityDescriber.test.tsx b/products/dashboards/frontend/dashboardActivityDescriber.test.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardActivityDescriber.test.tsx
rename to products/dashboards/frontend/dashboardActivityDescriber.test.tsx
diff --git a/frontend/src/scenes/dashboard/dashboardActivityDescriber.tsx b/products/dashboards/frontend/dashboardActivityDescriber.tsx
similarity index 99%
rename from frontend/src/scenes/dashboard/dashboardActivityDescriber.tsx
rename to products/dashboards/frontend/dashboardActivityDescriber.tsx
index abef04119989..c188da743ad0 100644
--- a/frontend/src/scenes/dashboard/dashboardActivityDescriber.tsx
+++ b/products/dashboards/frontend/dashboardActivityDescriber.tsx
@@ -2,11 +2,6 @@ import posthog from 'posthog-js'
import { DashboardFilter, HogQLVariable } from 'src/queries/schema/schema-general'
import { Link } from '@posthog/lemon-ui'
-import {
- DASHBOARD_GRID_COMPACTION_LABELS,
- DASHBOARD_TILE_SPACING_LABELS,
- TILE_GROUP_DISPLAY_LABELS,
-} from '@posthog/products-dashboards/frontend/dashboardCustomization'
import {
describeDescriptionChange,
@@ -36,6 +31,12 @@ import { urls } from 'scenes/urls'
import { DashboardType } from '~/types'
+import {
+ DASHBOARD_GRID_COMPACTION_LABELS,
+ DASHBOARD_TILE_SPACING_LABELS,
+ TILE_GROUP_DISPLAY_LABELS,
+} from './dashboardCustomization'
+
function nameAndLink(logItem?: ActivityLogItem): JSX.Element {
return logItem?.item_id ? (
<Link to={urls.dashboard(logItem.item_id)}>{logItem?.detail?.name || 'Unknown dashboard'}</Link>
diff --git a/frontend/src/scenes/dashboard/dashboardAddTileOptions.ts b/products/dashboards/frontend/dashboardAddTileOptions.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardAddTileOptions.ts
rename to products/dashboards/frontend/dashboardAddTileOptions.ts
diff --git a/frontend/src/scenes/dashboard/dashboardAiPromptComposerLogic.test.ts b/products/dashboards/frontend/dashboardAiPromptComposerLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardAiPromptComposerLogic.test.ts
rename to products/dashboards/frontend/dashboardAiPromptComposerLogic.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardAiPromptComposerLogic.ts b/products/dashboards/frontend/dashboardAiPromptComposerLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardAiPromptComposerLogic.ts
rename to products/dashboards/frontend/dashboardAiPromptComposerLogic.ts
diff --git a/frontend/src/scenes/dashboard/dashboardControls.test.ts b/products/dashboards/frontend/dashboardControls.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardControls.test.ts
rename to products/dashboards/frontend/dashboardControls.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardControls.ts b/products/dashboards/frontend/dashboardControls.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardControls.ts
rename to products/dashboards/frontend/dashboardControls.ts
diff --git a/frontend/src/scenes/dashboard/dashboardFilterEmpty.test.ts b/products/dashboards/frontend/dashboardFilterEmpty.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardFilterEmpty.test.ts
rename to products/dashboards/frontend/dashboardFilterEmpty.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardFilterEmpty.ts b/products/dashboards/frontend/dashboardFilterEmpty.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardFilterEmpty.ts
rename to products/dashboards/frontend/dashboardFilterEmpty.ts
diff --git a/frontend/src/scenes/dashboard/dashboardInsightColorsModalLogic.ts b/products/dashboards/frontend/dashboardInsightColorsModalLogic.ts
similarity index 98%
rename from frontend/src/scenes/dashboard/dashboardInsightColorsModalLogic.ts
rename to products/dashboards/frontend/dashboardInsightColorsModalLogic.ts
index 9a38d5efd39c..7f8f2fbb811d 100644
--- a/frontend/src/scenes/dashboard/dashboardInsightColorsModalLogic.ts
+++ b/products/dashboards/frontend/dashboardInsightColorsModalLogic.ts
@@ -1,17 +1,16 @@
import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
-
-import { DashboardTile } from '~/types'
-
import {
BreakdownColorConfig,
BreakdownValueAndType,
BreakdownValueGroup,
extractBreakdownValues,
groupBreakdownValuesByProperty,
-} from './dashboardBreakdownColors'
-import { dashboardLogic } from './dashboardLogic'
+} from 'scenes/dashboard/dashboardBreakdownColors'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+
+import { DashboardTile } from '~/types'
/** Unsaved color state captured when the modal opens, so Cancel can put it back. */
interface ColorStateAtOpen {
diff --git a/frontend/src/scenes/dashboard/dashboardPerformance.test.ts b/products/dashboards/frontend/dashboardPerformance.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardPerformance.test.ts
rename to products/dashboards/frontend/dashboardPerformance.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardPerformance.ts b/products/dashboards/frontend/dashboardPerformance.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardPerformance.ts
rename to products/dashboards/frontend/dashboardPerformance.ts
diff --git a/frontend/src/scenes/dashboard/dashboardPerformanceLogic.ts b/products/dashboards/frontend/dashboardPerformanceLogic.ts
similarity index 97%
rename from frontend/src/scenes/dashboard/dashboardPerformanceLogic.ts
rename to products/dashboards/frontend/dashboardPerformanceLogic.ts
index 1577bc13604e..e35ec4bca9e7 100644
--- a/frontend/src/scenes/dashboard/dashboardPerformanceLogic.ts
+++ b/products/dashboards/frontend/dashboardPerformanceLogic.ts
@@ -1,8 +1,9 @@
import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
+import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
+
import { DashboardPlacement } from '~/types'
-import { dashboardLogic } from './dashboardLogic'
import { DashboardPerformanceMonitor } from './dashboardPerformance'
// Embedded, exported and public placements have their own layout and load paths, which would mix into the numbers.
diff --git a/frontend/src/scenes/dashboard/dashboardQueryScanBannerLogic.ts b/products/dashboards/frontend/dashboardQueryScanBannerLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardQueryScanBannerLogic.ts
rename to products/dashboards/frontend/dashboardQueryScanBannerLogic.ts
diff --git a/frontend/src/scenes/dashboard/dashboardResizeCompactor.test.ts b/products/dashboards/frontend/dashboardResizeCompactor.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardResizeCompactor.test.ts
rename to products/dashboards/frontend/dashboardResizeCompactor.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardResizeCompactor.ts b/products/dashboards/frontend/dashboardResizeCompactor.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardResizeCompactor.ts
rename to products/dashboards/frontend/dashboardResizeCompactor.ts
diff --git a/products/dashboards/frontend/dashboardSettings/DashboardFilters.test.tsx b/products/dashboards/frontend/dashboardSettings/DashboardFilters.test.tsx
index bf2fdf46cc31..b281022612f2 100644
--- a/products/dashboards/frontend/dashboardSettings/DashboardFilters.test.tsx
+++ b/products/dashboards/frontend/dashboardSettings/DashboardFilters.test.tsx
@@ -7,7 +7,6 @@ import { router } from 'kea-router'
import { expectLogic } from 'kea-test-utils'
import { DashboardEventSource } from 'lib/utils/eventUsageLogic'
-import { DashboardFilterBar } from 'scenes/dashboard/DashboardFilters'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import * as dashboardUtils from 'scenes/dashboard/dashboardUtils'
import { SEARCH_PARAM_FILTERS_KEY } from 'scenes/dashboard/dashboardUtils'
@@ -16,6 +15,8 @@ import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { AccessControlLevel, DashboardPlacement, DashboardType, InsightModel } from '~/types'
+import { DashboardFilterBar } from '../DashboardFilters'
+
const MOCK_DASHBOARD: DashboardType = {
id: 5,
name: 'Test Dashboard',
diff --git a/frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.test.ts b/products/dashboards/frontend/dashboardSubscribeNudgeLogic.test.ts
similarity index 99%
rename from frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.test.ts
rename to products/dashboards/frontend/dashboardSubscribeNudgeLogic.test.ts
index 497f868cf08a..ecb18f6d2e6c 100644
--- a/frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.test.ts
+++ b/products/dashboards/frontend/dashboardSubscribeNudgeLogic.test.ts
@@ -8,10 +8,6 @@ import { createElement } from 'react'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import posthog from 'lib/posthog-typed'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import {
- dashboardNudgeScopeKey,
- dashboardSubscribeNudgeStoreLogic,
-} from 'scenes/dashboard/dashboardSubscribeNudgeStoreLogic'
import { userLogic } from 'scenes/userLogic'
import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'
@@ -24,6 +20,7 @@ import { subscriptionsLogic } from 'products/subscriptions/frontend/components/S
import { subscriptionsList } from 'products/subscriptions/frontend/generated/api'
import { DASHBOARD_SUBSCRIBE_NUDGE_VIEW_THRESHOLD, dashboardSubscribeNudgeLogic } from './dashboardSubscribeNudgeLogic'
+import { dashboardNudgeScopeKey, dashboardSubscribeNudgeStoreLogic } from './dashboardSubscribeNudgeStoreLogic'
import {
DASHBOARD_VIEW_DEDUPE_WINDOW_MS,
DASHBOARD_VIEW_LOG_WINDOW_MS,
diff --git a/frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.ts b/products/dashboards/frontend/dashboardSubscribeNudgeLogic.ts
similarity index 97%
rename from frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.ts
rename to products/dashboards/frontend/dashboardSubscribeNudgeLogic.ts
index bbffdcfd276f..d39fa89d61a4 100644
--- a/frontend/src/scenes/dashboard/dashboardSubscribeNudgeLogic.ts
+++ b/products/dashboards/frontend/dashboardSubscribeNudgeLogic.ts
@@ -13,21 +13,13 @@ import {
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
-import { dashboardsSubscribeNudgeCreate } from '@posthog/products-dashboards/frontend/generated/api'
-import type { DashboardSubscribeNudgeResponseApi } from '@posthog/products-dashboards/frontend/generated/api.schemas'
-
import posthog from 'lib/posthog-typed'
import { getCurrentTeamId } from 'lib/utils/getAppContext'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import {
- dashboardNudgeScopeKey,
- dashboardSubscribeNudgeStoreLogic,
- freshTimestamps,
-} from 'scenes/dashboard/dashboardSubscribeNudgeStoreLogic'
-import { showDashboardSubscribeNudgeToast } from 'scenes/dashboard/DashboardSubscribeNudgeToast'
import { userLogic } from 'scenes/userLogic'
import { AvailableFeature, DashboardPlacement } from '~/types'
+import type { DashboardType } from '~/types'
import {
fetchHasSubscriptionForDashboard,
@@ -36,8 +28,15 @@ import {
import { subscriptionsLogic } from 'products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic'
import { canNudgeToSubscribe } from 'products/subscriptions/frontend/components/Subscriptions/utils'
-import type { DashboardType } from '../../types'
+import {
+ dashboardNudgeScopeKey,
+ dashboardSubscribeNudgeStoreLogic,
+ freshTimestamps,
+} from './dashboardSubscribeNudgeStoreLogic'
import type { DashboardViewLog } from './dashboardSubscribeNudgeStoreLogic'
+import { showDashboardSubscribeNudgeToast } from './DashboardSubscribeNudgeToast'
+import { dashboardsSubscribeNudgeCreate } from './generated/api'
+import type { DashboardSubscribeNudgeResponseApi } from './generated/api.schemas'
export const DASHBOARD_SUBSCRIBE_NUDGE_VIEW_THRESHOLD = 3
diff --git a/frontend/src/scenes/dashboard/dashboardSubscribeNudgeStoreLogic.ts b/products/dashboards/frontend/dashboardSubscribeNudgeStoreLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardSubscribeNudgeStoreLogic.ts
rename to products/dashboards/frontend/dashboardSubscribeNudgeStoreLogic.ts
diff --git a/frontend/src/scenes/dashboard/dashboardTemplateEditorLogic.test.ts b/products/dashboards/frontend/dashboardTemplateEditorLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardTemplateEditorLogic.test.ts
rename to products/dashboards/frontend/dashboardTemplateEditorLogic.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardTemplateEditorLogic.ts b/products/dashboards/frontend/dashboardTemplateEditorLogic.ts
similarity index 99%
rename from frontend/src/scenes/dashboard/dashboardTemplateEditorLogic.ts
rename to products/dashboards/frontend/dashboardTemplateEditorLogic.ts
index 3dd495f8f613..2a5b5896acd0 100644
--- a/frontend/src/scenes/dashboard/dashboardTemplateEditorLogic.ts
+++ b/products/dashboards/frontend/dashboardTemplateEditorLogic.ts
@@ -6,10 +6,10 @@ import { LemonDialog, lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { DashboardTemplateEditorType, DashboardTemplateType, MonacoMarker, NonPortableReferences } from '~/types'
-import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
import { dashboardTemplatesLogic } from './dashboards/templates/dashboardTemplatesLogic'
function refreshDashboardTemplateListsAfterMutation(): void {
diff --git a/frontend/src/scenes/dashboard/dashboardTemplateEntities.test.ts b/products/dashboards/frontend/dashboardTemplateEntities.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardTemplateEntities.test.ts
rename to products/dashboards/frontend/dashboardTemplateEntities.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboardTemplateEntities.ts b/products/dashboards/frontend/dashboardTemplateEntities.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardTemplateEntities.ts
rename to products/dashboards/frontend/dashboardTemplateEntities.ts
diff --git a/frontend/src/scenes/dashboard/dashboardTemplateVariablesLogic.ts b/products/dashboards/frontend/dashboardTemplateVariablesLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboardTemplateVariablesLogic.ts
rename to products/dashboards/frontend/dashboardTemplateVariablesLogic.ts
diff --git a/products/dashboards/frontend/dashboardTileGroups.test.ts b/products/dashboards/frontend/dashboardTileGroups.test.ts
index a11488cb6124..7dd4482c643e 100644
--- a/products/dashboards/frontend/dashboardTileGroups.test.ts
+++ b/products/dashboards/frontend/dashboardTileGroups.test.ts
@@ -1,12 +1,11 @@
import type { Layout } from 'react-grid-layout'
-import { calculateLayouts } from 'scenes/dashboard/tileLayouts'
-
import type { DashboardLayoutSize, DashboardTile, DashboardWidgetModel, TileLayout } from '~/types'
import { DashboardGridCompaction, getDashboardGridCompactor } from './dashboardCustomization'
import { getGroupTitlesByTileId, hasTileDecorations } from './dashboardTileGroups'
import type { DashboardTileGroupApi } from './generated/api.schemas'
+import { calculateLayouts } from './tileLayouts'
const tile = (id: number, group_key: string | null): DashboardTile =>
({ id, group_key, layouts: {}, color: null }) as DashboardTile
diff --git a/products/dashboards/frontend/dashboards/Dashboards.tsx b/products/dashboards/frontend/dashboards/Dashboards.tsx
index 2df65e81d511..76ac24a1dcdd 100644
--- a/products/dashboards/frontend/dashboards/Dashboards.tsx
+++ b/products/dashboards/frontend/dashboards/Dashboards.tsx
@@ -12,10 +12,6 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonTab, LemonTabs } from 'lib/lemon-ui/LemonTabs'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { DashboardsTab, dashboardsLogic } from 'scenes/dashboard/dashboards/dashboardsLogic'
-import { DashboardTemplateModal } from 'scenes/dashboard/dashboards/templates/DashboardTemplateModal'
-import { DashboardTemplateEditor } from 'scenes/dashboard/DashboardTemplateEditor'
-import { DeleteDashboardModal } from 'scenes/dashboard/DeleteDashboardModal'
-import { DuplicateDashboardModal } from 'scenes/dashboard/DuplicateDashboardModal'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
import { NewDashboardModal } from 'scenes/dashboard/NewDashboardModal'
import { sceneConfigurations } from 'scenes/scenes'
@@ -31,10 +27,14 @@ import { CrossProjectDashboardsList } from 'products/cross_project_dashboards/fr
import { NewCrossProjectDashboardButton } from 'products/cross_project_dashboards/frontend/NewCrossProjectDashboardButton'
import { dashboardsEmptyState } from 'products/dashboards/frontend/emptyState/dashboardsEmptyState'
+import { DashboardTemplateEditor } from '../DashboardTemplateEditor'
+import { DeleteDashboardModal } from '../DeleteDashboardModal'
+import { DuplicateDashboardModal } from '../DuplicateDashboardModal'
import { DashboardsSceneMenuBar } from './DashboardsSceneMenuBar'
import { DashboardsTableContainer } from './DashboardsTable'
import { NewDashboardMenu } from './NewDashboardMenu'
import { QuillDashboardsActions } from './QuillDashboardsActions'
+import { DashboardTemplateModal } from './templates/DashboardTemplateModal'
import { DashboardTemplatesTable } from './templates/DashboardTemplatesTable'
export const scene: SceneExport = {
diff --git a/products/dashboards/frontend/dashboards/DashboardsTable.tsx b/products/dashboards/frontend/dashboards/DashboardsTable.tsx
index 4a424283492e..7b7f49adae9d 100644
--- a/products/dashboards/frontend/dashboards/DashboardsTable.tsx
+++ b/products/dashboards/frontend/dashboards/DashboardsTable.tsx
@@ -24,8 +24,6 @@ import { UNFILED_DASHBOARDS_FOLDER } from 'scenes/dashboard/dashboardConstants'
import { DASHBOARD_CANNOT_EDIT_MESSAGE } from 'scenes/dashboard/DashboardHeader'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
import { dashboardsLogic } from 'scenes/dashboard/dashboards/dashboardsLogic'
-import { deleteDashboardLogic } from 'scenes/dashboard/deleteDashboardLogic'
-import { duplicateDashboardLogic } from 'scenes/dashboard/duplicateDashboardLogic'
import { sceneLogic } from 'scenes/sceneLogic'
import { emptySceneParams } from 'scenes/scenes'
import { Scene } from 'scenes/sceneTypes'
@@ -35,6 +33,8 @@ import { urls } from 'scenes/urls'
import { dashboardsModel, nameCompareFunction } from '~/models/dashboardsModel'
import { AccessControlLevel, AccessControlResourceType, DashboardBasicType, DashboardType } from '~/types'
+import { deleteDashboardLogic } from '../deleteDashboardLogic'
+import { duplicateDashboardLogic } from '../duplicateDashboardLogic'
import { DashboardsFiltersBar } from './DashboardsFiltersBar'
function BulkMoveToFolderButton({
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateChooser.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplateChooser.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateChooser.tsx
rename to products/dashboards/frontend/dashboards/templates/DashboardTemplateChooser.tsx
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateItem.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplateItem.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateItem.tsx
rename to products/dashboards/frontend/dashboards/templates/DashboardTemplateItem.tsx
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateItemSkeleton.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplateItemSkeleton.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateItemSkeleton.tsx
rename to products/dashboards/frontend/dashboards/templates/DashboardTemplateItemSkeleton.tsx
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateModal.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplateModal.tsx
similarity index 98%
rename from frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateModal.tsx
rename to products/dashboards/frontend/dashboards/templates/DashboardTemplateModal.tsx
index 112b7e7b40dd..e1b736ee712c 100644
--- a/frontend/src/scenes/dashboard/dashboards/templates/DashboardTemplateModal.tsx
+++ b/products/dashboards/frontend/dashboards/templates/DashboardTemplateModal.tsx
@@ -2,11 +2,11 @@ import { useActions, useValues } from 'kea'
import { LemonButton, LemonInput, LemonInputSelect, LemonModal, LemonTextArea } from '@posthog/lemon-ui'
-import { dashboardTemplateEditorLogic } from 'scenes/dashboard/dashboardTemplateEditorLogic'
import { userLogic } from 'scenes/userLogic'
import type { DashboardTemplateEditorType } from '~/types'
+import { dashboardTemplateEditorLogic } from '../../dashboardTemplateEditorLogic'
import { dashboardTemplateModalLogic } from './dashboardTemplateModalLogic'
export function DashboardTemplateModal(): JSX.Element | null {
diff --git a/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.test.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.test.tsx
index 4c80888f75af..4b79f37f2d70 100644
--- a/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.test.tsx
+++ b/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.test.tsx
@@ -46,7 +46,7 @@ jest.mock('lib/lemon-ui/LemonButton/More', () => ({
// The table calls `dashboardTemplatesLogic({...})` at module load; return a stable sentinel so that import works.
// `useValues` keys only on `userLogic` below; every other logic falls through to the table values.
// Which templates a viewer can manage is decided by the logic's selectors and tested in dashboardTemplatesLogic.test.ts.
-jest.mock('scenes/dashboard/dashboards/templates/dashboardTemplatesLogic', () => ({
+jest.mock('./dashboardTemplatesLogic', () => ({
dashboardTemplatesLogic: jest.fn(() => ({ __mock: 'templatesTableLogic' })),
}))
diff --git a/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.tsx b/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.tsx
index 407595fae813..443eb2301ccd 100644
--- a/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.tsx
+++ b/products/dashboards/frontend/dashboards/templates/DashboardTemplatesTable.tsx
@@ -14,15 +14,15 @@ import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { getAppContext } from 'lib/utils/getAppContext'
import { humanFriendlyNumber } from 'lib/utils/numbers'
-import { dashboardTemplateModalLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplateModalLogic'
-import { dashboardTemplatesLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
-import { dashboardTemplateEditorLogic } from 'scenes/dashboard/dashboardTemplateEditorLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
import { DashboardTemplateType } from '~/types'
+import { dashboardTemplateEditorLogic } from '../../dashboardTemplateEditorLogic'
+import { dashboardTemplateModalLogic } from './dashboardTemplateModalLogic'
import { DashboardTemplatesEmptyState } from './DashboardTemplatesEmptyState'
+import { dashboardTemplatesLogic } from './dashboardTemplatesLogic'
const templatesTableLogic = dashboardTemplatesLogic({ scope: 'default', templatesTabList: true })
diff --git a/products/dashboards/frontend/dashboards/templates/FeaturedTemplatesChooser.tsx b/products/dashboards/frontend/dashboards/templates/FeaturedTemplatesChooser.tsx
deleted file mode 100644
index f254fdd4bc2e..000000000000
--- a/products/dashboards/frontend/dashboards/templates/FeaturedTemplatesChooser.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { useMemo } from 'react'
-
-import { IconPlus } from '@posthog/icons'
-
-import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { cn } from 'lib/utils/css-classes'
-import {
- runBlankDashboardFlow,
- runDashboardTemplateClickFlow,
-} from 'scenes/dashboard/dashboards/templates/dashboardTemplateCreationFlows'
-import { TemplateItem } from 'scenes/dashboard/dashboards/templates/DashboardTemplateItem'
-import { DashboardTemplateItemSkeleton } from 'scenes/dashboard/dashboards/templates/DashboardTemplateItemSkeleton'
-import {
- DashboardTemplateProps,
- dashboardTemplatesLogic,
-} from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
-import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
-
-import { DashboardTemplateType, TemplateAvailabilityContext } from '~/types'
-
-import BlankDashboardHog from 'public/blank-dashboard-hog.png'
-
-export type FeaturedTemplatesChooserProps = Pick<
- DashboardTemplateProps,
- 'scope' | 'onItemClick' | 'redirectAfterCreation' | 'availabilityContexts' | 'className'
->
-
-export function FeaturedTemplatesChooser({
- scope = 'default',
- onItemClick,
- redirectAfterCreation = true,
- availabilityContexts,
- className,
-}: FeaturedTemplatesChooserProps): JSX.Element {
- const templatesLogic = dashboardTemplatesLogic({ scope, listQuery: { is_featured: true } })
- const { allTemplates, allTemplatesLoading } = useValues(templatesLogic)
-
- const { isLoading, newDashboardModalVisible } = useValues(newDashboardLogic)
- const {
- setActiveDashboardTemplate,
- createDashboardFromTemplate,
- addDashboard,
- setIsLoading,
- showVariableSelectModal,
- } = useActions(newDashboardLogic)
- const filteredTemplates = useMemo(() => {
- return allTemplates.filter((template) => {
- if (availabilityContexts) {
- return availabilityContexts.some((context) => template.availability_contexts?.includes(context))
- }
- return true
- })
- }, [allTemplates, availabilityContexts])
-
- const hasFeaturedTiles = filteredTemplates.length > 0
-
- const handleTemplateClick = (template: DashboardTemplateType): void => {
- runDashboardTemplateClickFlow(template, {
- isLoading,
- newDashboardModalVisible,
- redirectAfterCreation,
- setIsLoading,
- createDashboardFromTemplate,
- showVariableSelectModal,
- setActiveDashboardTemplate,
- onItemClick,
- })
- }
-
- const showBlankDashboardAction =
- !availabilityContexts || availabilityContexts.includes(TemplateAvailabilityContext.GENERAL)
-
- const createBlankDashboard = (): void => {
- runBlankDashboardFlow({ isLoading, setIsLoading, addDashboard })
- }
-
- return (
- <div className={cn('flex flex-col gap-4 w-full', className)}>
- <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 w-full">
- {allTemplatesLoading ? (
- <>
- {Array.from({ length: 3 }).map((_, i) => (
- <DashboardTemplateItemSkeleton key={i} />
- ))}
- </>
- ) : !hasFeaturedTiles && showBlankDashboardAction ? (
- <TemplateItem
- template={{
- template_name: 'Blank dashboard',
- dashboard_description: 'Create a blank dashboard',
- image_url: BlankDashboardHog,
- }}
- onClick={createBlankDashboard}
- index={0}
- data-attr="create-dashboard-blank"
- />
- ) : (
- filteredTemplates.map((template, index) => (
- <TemplateItem
- key={template.id}
- template={template}
- onClick={() => handleTemplateClick(template)}
- index={index}
- data-attr="create-dashboard-from-featured-template"
- />
- ))
- )}
- </div>
- {showBlankDashboardAction && hasFeaturedTiles ? (
- <LemonButton
- type="secondary"
- icon={<IconPlus className="size-3.5" />}
- onClick={createBlankDashboard}
- loading={isLoading}
- data-attr="create-dashboard-blank-from-scratch"
- className="self-center @min-[48rem]/main-content:self-start"
- >
- Or start from scratch
- </LemonButton>
- ) : null}
- </div>
- )
-}
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic.ts
similarity index 98%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic.ts
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic.ts
index 2aa03c259f80..02207128bcee 100644
--- a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateChooserLogic.ts
+++ b/products/dashboards/frontend/dashboards/templates/dashboardTemplateChooserLogic.ts
@@ -2,11 +2,11 @@ import { MakeLogicType, actions, connect, kea, key, listeners, path, props, sele
import posthog from 'posthog-js'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
+import type { NewDashboardForm } from 'scenes/dashboard/newDashboardLogic'
import { DashboardTemplateType, TemplateAvailabilityContext } from '~/types'
+import type { DashboardTemplateVariableType } from '~/types'
-import type { DashboardTemplateVariableType } from '../../../../types'
-import type { NewDashboardForm } from '../../newDashboardLogic'
import { runBlankDashboardFlow, runDashboardTemplateClickFlow } from './dashboardTemplateCreationFlows'
import { DashboardTemplateProps, dashboardTemplatesLogic } from './dashboardTemplatesLogic'
diff --git a/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.test.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.test.ts
index 2a0ceae3c8f3..0419516cc7a2 100644
--- a/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.test.ts
+++ b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.test.ts
@@ -5,7 +5,6 @@ import { expectLogic } from 'kea-test-utils'
import api, { ApiError } from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { dashboardTemplatesLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
import { urls } from 'scenes/urls'
import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'
@@ -13,6 +12,7 @@ import { initKeaTests } from '~/test/init'
import type { DashboardTemplateType } from '~/types'
import { dashboardTemplateCopyLogic } from './dashboardTemplateCopyLogic'
+import { dashboardTemplatesLogic } from './dashboardTemplatesLogic'
jest.mock('lib/lemon-ui/LemonToast/LemonToast', () => ({
lemonToast: { success: jest.fn(), error: jest.fn() },
diff --git a/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.ts
index c4d9994d7df4..09aaa390d609 100644
--- a/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.ts
+++ b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCopyLogic.ts
@@ -5,7 +5,6 @@ import { subscriptions } from 'kea-subscriptions'
import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { dashboardTemplatesLogic } from 'scenes/dashboard/dashboards/templates/dashboardTemplatesLogic'
import { organizationLogic } from 'scenes/organizationLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
@@ -13,6 +12,8 @@ import { urls } from 'scenes/urls'
import type { DashboardTemplateType } from '~/types'
import type { OrganizationType } from '~/types'
+import { dashboardTemplatesLogic } from './dashboardTemplatesLogic'
+
export interface DashboardTemplateCopyLogicProps {
sourceTemplateId: string
sourceTeamId?: number
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateCreationFlows.test.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCreationFlows.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateCreationFlows.test.ts
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplateCreationFlows.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateCreationFlows.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateCreationFlows.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateCreationFlows.ts
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplateCreationFlows.ts
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateModalLogic.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplateModalLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplateModalLogic.ts
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplateModalLogic.ts
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplatesLogic.test.ts b/products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplatesLogic.test.ts
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic.test.ts
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplatesLogic.tsx b/products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic.tsx
similarity index 99%
rename from frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplatesLogic.tsx
rename to products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic.tsx
index d76c28601989..128b28d6f898 100644
--- a/frontend/src/scenes/dashboard/dashboards/templates/dashboardTemplatesLogic.tsx
+++ b/products/dashboards/frontend/dashboards/templates/dashboardTemplatesLogic.tsx
@@ -7,6 +7,7 @@ import { urlToAction } from 'kea-router'
import api from 'lib/api'
import { dayjs } from 'lib/dayjs'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { userHasAccess } from 'lib/utils/accessControlUtils'
import { getAppContext } from 'lib/utils/getAppContext'
import { teamLogic } from 'scenes/teamLogic'
@@ -24,8 +25,6 @@ import {
import { dashboardTemplatesList } from 'products/dashboards/frontend/generated/api'
-import type { FeatureFlagsSet } from '../../../../lib/logic/featureFlagLogic'
-
export interface DashboardTemplateProps {
// default is to present global templates _and_ those visible only in the current team
scope?: 'default' | DashboardTemplateScope
diff --git a/frontend/src/scenes/dashboard/deleteDashboardLogic.ts b/products/dashboards/frontend/deleteDashboardLogic.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/deleteDashboardLogic.ts
rename to products/dashboards/frontend/deleteDashboardLogic.ts
diff --git a/frontend/src/scenes/dashboard/docs/troubleshooting/README.md b/products/dashboards/frontend/docs/troubleshooting/README.md
similarity index 77%
rename from frontend/src/scenes/dashboard/docs/troubleshooting/README.md
rename to products/dashboards/frontend/docs/troubleshooting/README.md
index 00875f5e4ca0..cf0e2ed35abf 100644
--- a/frontend/src/scenes/dashboard/docs/troubleshooting/README.md
+++ b/products/dashboards/frontend/docs/troubleshooting/README.md
@@ -1,6 +1,6 @@
# Dashboard scene troubleshooting
-Symptom-driven notes for the dashboard scene (`frontend/src/scenes/dashboard/`).
+Symptom-driven notes for the dashboard scene (`products/dashboards/frontend/` and `frontend/src/scenes/dashboard/`).
## Edit mode / react-grid-layout
diff --git a/frontend/src/scenes/dashboard/docs/troubleshooting/rgl-edit-mode-tile-resize.md b/products/dashboards/frontend/docs/troubleshooting/rgl-edit-mode-tile-resize.md
similarity index 96%
rename from frontend/src/scenes/dashboard/docs/troubleshooting/rgl-edit-mode-tile-resize.md
rename to products/dashboards/frontend/docs/troubleshooting/rgl-edit-mode-tile-resize.md
index 8b18d149d57e..11d1ba65e806 100644
--- a/frontend/src/scenes/dashboard/docs/troubleshooting/rgl-edit-mode-tile-resize.md
+++ b/products/dashboards/frontend/docs/troubleshooting/rgl-edit-mode-tile-resize.md
@@ -28,7 +28,7 @@ Common triggers:
## Files (check in this order)
-1. `DashboardItems.scss` — `.react-grid-item > .handle`, placeholder z-index
+1. `frontend/src/scenes/dashboard/DashboardItems.scss` — `.react-grid-item > .handle`, placeholder z-index
2. `lib/components/Cards/handles.tsx` — decorative handle markup
3. Tile roots: `InsightCard.tsx`, `TextCard.tsx`, `ButtonTileCard.tsx`, product tile shells (e.g. `WidgetCard.tsx` + scene wrapper)
4. `DashboardItems.tsx` — tile render branches if a new wrapper broke `ref`/`style`/`children` forwarding
diff --git a/frontend/src/scenes/dashboard/duplicateDashboardLogic.ts b/products/dashboards/frontend/duplicateDashboardLogic.ts
similarity index 99%
rename from frontend/src/scenes/dashboard/duplicateDashboardLogic.ts
rename to products/dashboards/frontend/duplicateDashboardLogic.ts
index e5910c54add0..fb44069d7ff0 100644
--- a/frontend/src/scenes/dashboard/duplicateDashboardLogic.ts
+++ b/products/dashboards/frontend/duplicateDashboardLogic.ts
@@ -9,8 +9,7 @@ import { urls } from 'scenes/urls'
import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
import { dashboardsModel } from '~/models/dashboardsModel'
import { insightsModel } from '~/models/insightsModel'
-
-import type { DashboardType } from '../../types'
+import type { DashboardType } from '~/types'
export interface DuplicateDashboardForm {
dashboardId: number | null
diff --git a/frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx b/products/dashboards/frontend/items/DashboardButtonTileItem.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx
rename to products/dashboards/frontend/items/DashboardButtonTileItem.tsx
diff --git a/frontend/src/scenes/dashboard/items/DashboardErrorTileItem.tsx b/products/dashboards/frontend/items/DashboardErrorTileItem.tsx
similarity index 97%
rename from frontend/src/scenes/dashboard/items/DashboardErrorTileItem.tsx
rename to products/dashboards/frontend/items/DashboardErrorTileItem.tsx
index a63742dd3127..c29b6694b5a3 100644
--- a/frontend/src/scenes/dashboard/items/DashboardErrorTileItem.tsx
+++ b/products/dashboards/frontend/items/DashboardErrorTileItem.tsx
@@ -5,12 +5,11 @@ import { CardMeta, Resizeable } from 'lib/components/Cards/CardMeta'
import { DashboardResizeHandles } from 'lib/components/Cards/handles'
import { EditModeEdge, EditModeEdgeOverlay } from 'lib/components/Cards/InsightCard/EditModeEdgeOverlay'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
+import { getDashboardTileDisplayName } from 'scenes/dashboard/dashboardUtils'
import { InsightErrorState } from 'scenes/insights/EmptyStates'
import { DashboardPlacement, DashboardTile } from '~/types'
-import { getDashboardTileDisplayName } from '../dashboardUtils'
-
interface DashboardErrorTileItemProps extends React.HTMLAttributes<HTMLDivElement>, Resizeable {
tile: DashboardTile
canEnterEditModeFromEdge?: boolean
diff --git a/frontend/src/scenes/dashboard/tileLayouts.test.ts b/products/dashboards/frontend/tileLayouts.test.ts
similarity index 99%
rename from frontend/src/scenes/dashboard/tileLayouts.test.ts
rename to products/dashboards/frontend/tileLayouts.test.ts
index 69095bc764ae..4c3c6cc66498 100644
--- a/frontend/src/scenes/dashboard/tileLayouts.test.ts
+++ b/products/dashboards/frontend/tileLayouts.test.ts
@@ -1,10 +1,10 @@
import { Layout, LayoutItem } from 'react-grid-layout'
-import { calculateDuplicateLayout, calculateInsertionLayout, calculateLayouts } from 'scenes/dashboard/tileLayouts'
-
import { NodeKind } from '~/queries/schema/schema-general'
import { ChartDisplayType, DashboardLayoutSize, DashboardTile, TileLayout } from '~/types'
+import { calculateDuplicateLayout, calculateInsertionLayout, calculateLayouts } from './tileLayouts'
+
function textTileWithLayout(layouts: Record<DashboardLayoutSize, TileLayout>, tileId: number = 1): DashboardTile {
return {
id: tileId,
diff --git a/frontend/src/scenes/dashboard/tileLayouts.ts b/products/dashboards/frontend/tileLayouts.ts
similarity index 99%
rename from frontend/src/scenes/dashboard/tileLayouts.ts
rename to products/dashboards/frontend/tileLayouts.ts
index 25445e38bafa..ea705603b012 100644
--- a/frontend/src/scenes/dashboard/tileLayouts.ts
+++ b/products/dashboards/frontend/tileLayouts.ts
@@ -1,11 +1,5 @@
import { Layout } from 'react-grid-layout'
-import {
- DASHBOARD_WIDGET_CATALOG,
- getDashboardWidgetCatalogEntry,
- type DashboardWidgetCatalogEntry,
-} from '@posthog/products-dashboards/frontend/widget_types/catalog'
-
import { BREAKPOINT_COLUMN_COUNTS } from 'scenes/dashboard/dashboardUtils'
import {
@@ -20,6 +14,12 @@ import { ChartDisplayType, DashboardLayoutSize, DashboardTile } from '~/types'
import { getImageOnlyTextCardImage } from 'products/dashboards/frontend/components/ImageTile/imageTileUtils'
+import {
+ DASHBOARD_WIDGET_CATALOG,
+ getDashboardWidgetCatalogEntry,
+ type DashboardWidgetCatalogEntry,
+} from './widget_types/catalog'
+
export interface TileLayout {
x: number
y: number
diff --git a/frontend/src/scenes/dashboard/tileLogic.test.ts b/products/dashboards/frontend/tileLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/tileLogic.test.ts
rename to products/dashboards/frontend/tileLogic.test.ts
diff --git a/frontend/src/scenes/dashboard/tileLogic.tsx b/products/dashboards/frontend/tileLogic.tsx
similarity index 100%
rename from frontend/src/scenes/dashboard/tileLogic.tsx
rename to products/dashboards/frontend/tileLogic.tsx
diff --git a/frontend/src/scenes/dashboard/widgetFetchUtils.test.ts b/products/dashboards/frontend/widgetFetchUtils.test.ts
similarity index 100%
rename from frontend/src/scenes/dashboard/widgetFetchUtils.test.ts
rename to products/dashboards/frontend/widgetFetchUtils.test.ts
diff --git a/frontend/src/scenes/dashboard/widgetFetchUtils.ts b/products/dashboards/frontend/widgetFetchUtils.ts
similarity index 84%
rename from frontend/src/scenes/dashboard/widgetFetchUtils.ts
rename to products/dashboards/frontend/widgetFetchUtils.ts
index 2a4ad92d4509..f20309b17d11 100644
--- a/frontend/src/scenes/dashboard/widgetFetchUtils.ts
+++ b/products/dashboards/frontend/widgetFetchUtils.ts
@@ -1,9 +1,9 @@
-import { dashboardsRunWidgetsRetrieve } from '@posthog/products-dashboards/frontend/generated/api'
-import type { DashboardWidgetRunResultApi } from '@posthog/products-dashboards/frontend/generated/api.schemas'
+import { DASHBOARD_MIN_REFRESH_INTERVAL_MINUTES } from 'scenes/dashboard/dashboardUtils'
import type { DashboardTile } from '~/types'
-import { DASHBOARD_MIN_REFRESH_INTERVAL_MINUTES } from './dashboardUtils'
+import { dashboardsRunWidgetsRetrieve } from './generated/api'
+import type { DashboardWidgetRunResultApi } from './generated/api.schemas'
export const WIDGET_CLIENT_TTL_MS = DASHBOARD_MIN_REFRESH_INTERVAL_MINUTES * 60 * 1000
diff --git a/frontend/src/scenes/dashboard/widgetTileRefreshScheduler.ts b/products/dashboards/frontend/widgetTileRefreshScheduler.ts
similarity index 90%
rename from frontend/src/scenes/dashboard/widgetTileRefreshScheduler.ts
rename to products/dashboards/frontend/widgetTileRefreshScheduler.ts
index 52f662748e0a..18e83354ecf9 100644
--- a/frontend/src/scenes/dashboard/widgetTileRefreshScheduler.ts
+++ b/products/dashboards/frontend/widgetTileRefreshScheduler.ts
@@ -1,4 +1,4 @@
-import { WIDGET_TILE_REFRESH_DEBOUNCE_MS } from '@posthog/products-dashboards/frontend/widgets/constants'
+import { WIDGET_TILE_REFRESH_DEBOUNCE_MS } from './widgets/constants'
export type DashboardWidgetTileRefreshScheduler = {
schedule: (tileId: number) => void
diff --git a/products/dashboards/manifest.tsx b/products/dashboards/manifest.tsx
index a5e8626acc68..0013e2f62b54 100644
--- a/products/dashboards/manifest.tsx
+++ b/products/dashboards/manifest.tsx
@@ -12,7 +12,7 @@ export const manifest: ProductManifest = {
name: 'Dashboards',
activityDescribers: {
[ActivityScope.DASHBOARD]: () =>
- import('scenes/dashboard/dashboardActivityDescriber').then((module) => module.dashboardActivityDescriber),
+ import('./frontend/dashboardActivityDescriber').then((module) => module.dashboardActivityDescriber),
},
urls: {
dashboards: (tab?: `${DashboardsTab}`): string => (tab ? `/dashboard?tab=${tab}` : '/dashboard'),
diff --git a/products/dashboards/package.json b/products/dashboards/package.json
index 950250edf142..9cfd65e03a4c 100644
--- a/products/dashboards/package.json
+++ b/products/dashboards/package.json
@@ -13,7 +13,7 @@
"kea-router": "catalog:",
"kea-subscriptions": "catalog:",
"posthog-js": "catalog:",
- "react-grid-layout": "^2.2.4",
+ "react-grid-layout": "^2.3.0",
"react-intersection-observer": "^9.5.3"
},
"devDependencies": {