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.

chore(products): move three scene dirs into their product folders (#99417)

Thomas Obermülleraa93fdcb99ca
diff --git a/.semgrep/rules/devex/no-environments-api-urls-frontend.yaml b/.semgrep/rules/devex/no-environments-api-urls-frontend.yaml
index f96cf13f30a3..747662577128 100644
--- a/.semgrep/rules/devex/no-environments-api-urls-frontend.yaml
+++ b/.semgrep/rules/devex/no-environments-api-urls-frontend.yaml
@@ -83,8 +83,8 @@ rules:
- '/frontend/src/scenes/feature-flags/defaultEvaluationContextsLogic.ts'
- '/frontend/src/scenes/feature-flags/defaultReleaseConditionsLogic.ts'
- '/frontend/src/scenes/feature-flags/featureFlagLogic.ts'
- - '/frontend/src/scenes/groups/groupLogic.ts'
- - '/frontend/src/scenes/groups/relatedGroupsLogic.ts'
+ - '/products/groups/frontend/logics/groupLogic.ts'
+ - '/products/groups/frontend/logics/relatedGroupsLogic.ts'
- '/frontend/src/scenes/health/categoryDetail/healthCategoryDetailLogic.ts'
- '/frontend/src/scenes/health/healthSceneLogic.tsx'
- '/frontend/src/scenes/health/pipelineStatus/pipelineHealthLogic.ts'
diff --git a/frontend/src/lib/components/ActivityLog/describers.tsx b/frontend/src/lib/components/ActivityLog/describers.tsx
index 897878f46c73..7aa427c4341e 100644
--- a/frontend/src/lib/components/ActivityLog/describers.tsx
+++ b/frontend/src/lib/components/ActivityLog/describers.tsx
@@ -3,8 +3,6 @@ import { ActivityDescriber as errorTrackingActivityDescriber } from '@posthog/pr
import { instanceSettingActivityDescriber } from 'lib/components/ActivityLog/activityDescriptions/instanceSettingActivityDescriber'
import { tagActivityDescriber } from 'lib/components/ActivityLog/activityDescriptions/tagActivityDescriber'
import { ActivityLogItem, Describer, defaultDescriber } from 'lib/components/ActivityLog/humanizeActivity'
-import { actionActivityDescriber } from 'scenes/actions/actionActivityDescriber'
-import { annotationActivityDescriber } from 'scenes/annotations/activityDescriptions'
import { userActivityDescriber } from 'scenes/authentication/shared/activityDescriptions'
import { billingActivityDescriber } from 'scenes/billing/activityDescriptions'
import { cohortActivityDescriber } from 'scenes/cohorts/activityDescriptions'
@@ -16,7 +14,6 @@ import { dataWarehouseSavedQueryActivityDescriber } from 'scenes/data-warehouse/
import { experimentActivityDescriber } from 'scenes/experiments/experimentActivityDescriber'
import { exportedAssetActivityDescriber } from 'scenes/exports/activityDescriptions'
import { flagActivityDescriber } from 'scenes/feature-flags/activityDescriptions'
-import { groupActivityDescriber } from 'scenes/groups/activityDescriptions'
import { hogFunctionActivityDescriber } from 'scenes/hog-functions/misc/activityDescriptions'
import { notebookActivityDescriber } from 'scenes/notebooks/Notebook/notebookActivityDescriber'
import { personActivityDescriber } from 'scenes/persons/activityDescriptions'
@@ -38,13 +35,16 @@ import { teamActivityDescriber } from 'scenes/team-activity/teamActivityDescribe
import { ActivityScope } from '~/types'
+import { actionActivityDescriber } from 'products/actions/frontend/actionActivityDescriber'
import { promptActivityDescriber } from 'products/ai_observability/frontend/prompts/promptActivityDescriber'
import { promptLabelActivityDescriber } from 'products/ai_observability/frontend/prompts/promptLabelActivityDescriber'
import { alertConfigurationActivityDescriber } from 'products/alerts/frontend/components/activityDescriptions'
+import { annotationActivityDescriber } from 'products/annotations/frontend/activityDescriptions'
import { canvasActivityDescriber } from 'products/canvas/frontend/activityDescriber'
import { ticketActivityDescriber } from 'products/conversations/frontend/activityDescriber'
import { externalDataSourceActivityDescriber } from 'products/data_warehouse/frontend/shared/components/activityDescriptions'
import { endpointActivityDescriber } from 'products/endpoints/frontend/activityDescriber'
+import { groupActivityDescriber } from 'products/groups/frontend/activityDescriptions'
import { signalScoutConfigActivityDescriber } from 'products/signals/frontend/activityDescriber'
import { stamphogRepoConfigActivityDescriber } from 'products/stamphog/frontend/activityDescriber'
import { workflowActivityDescriber } from 'products/workflows/frontend/Workflows/misc/workflowActivityDescriber'
diff --git a/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
index f6f1f511663d..de4ec2af3706 100644
--- a/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
+++ b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsOverlay.tsx
@@ -16,13 +16,14 @@ import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
import { pluralize } from 'lib/utils/strings'
import { shortTimeZone } from 'lib/utils/timezones'
-import { AnnotationModal } from 'scenes/annotations/AnnotationModal'
-import { annotationModalLogic, annotationScopeToName } from 'scenes/annotations/annotationModalLogic'
import { insightLogic } from 'scenes/insights/insightLogic'
import { annotationsModel } from '~/models/annotationsModel'
import { AnnotationType, DatedAnnotationType, IntervalType } from '~/types'
+import { AnnotationModal } from 'products/annotations/frontend/components/AnnotationModal'
+import { annotationModalLogic, annotationScopeToName } from 'products/annotations/frontend/logics/annotationModalLogic'
+
import { AnnotationsOverlayLogicProps, annotationsOverlayLogic } from './annotationsOverlayLogic'
import { AnnotationsChartGeometry, useAnnotationsPositioning } from './useAnnotationsPositioning'
diff --git a/frontend/src/productScenes.tsx b/frontend/src/productScenes.tsx
index a797219ac1eb..21c6c634e5cc 100644
--- a/frontend/src/productScenes.tsx
+++ b/frontend/src/productScenes.tsx
@@ -37,6 +37,7 @@ export const productScenes: Record<string, () => Promise<any>> = {
AIObservabilityCluster: () =>
import('../../products/ai_observability/frontend/clusters/AIObservabilityClusterScene'),
Alerts: () => import('../../products/alerts/frontend/AlertsScene'),
+ Annotations: () => import('../../products/annotations/frontend/pages/Annotations'),
BusinessKnowledge: () => import('../../products/business_knowledge/frontend/scenes/BusinessKnowledgeScene'),
BusinessKnowledgeSettings: () =>
import('../../products/business_knowledge/frontend/scenes/BusinessKnowledgeSettingsScene'),
@@ -97,6 +98,9 @@ export const productScenes: Record<string, () => Promise<any>> = {
FeatureFlagsStaffTools: () => import('../../products/feature_flags/frontend/staff/FeatureFlagsStaffToolsScene'),
Game368Hedgehogs: () => import('../../products/games/368Hedgehogs/368Hedgehogs'),
FlappyHog: () => import('../../products/games/FlappyHog/FlappyHog'),
+ Group: () => import('../../products/groups/frontend/pages/Group'),
+ Groups: () => import('../../products/groups/frontend/pages/Groups'),
+ GroupsNew: () => import('../../products/groups/frontend/pages/GroupsNew'),
IdentityMatching: () => import('../../products/growth/frontend/IdentityMatchingScene'),
AIEnrichment: () => import('../../products/growth/frontend/aiEnrichment/AIEnrichmentScene'),
LegalDocuments: () => import('../../products/legal_documents/frontend/scenes/LegalDocumentsScene'),
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index 27ba236e0870..67a7d6174fe9 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -46,6 +46,7 @@ import type { ModelsSceneTab } from './scenes/models/modelsSceneLogic'
import type { NodeDetailSceneTab } from './scenes/models/nodeDetailSceneLogic'
import {
ActionType,
+ AnnotationType,
DashboardType,
FileSystemIconColor,
InsightSceneSource,
@@ -94,6 +95,8 @@ export const productRoutes: Record<string, [string, string]> = {
'/prompt-management/prompts': ['AIObservabilityPrompts', 'aiObservabilityPrompts'],
'/prompt-management/prompts/:name': ['AIObservabilityPrompt', 'aiObservabilityPrompt'],
'/alerts': ['Alerts', 'alerts'],
+ '/data-management/annotations': ['Annotations', 'annotations'],
+ '/data-management/annotations/:id': ['Annotations', 'annotation'],
'/business-knowledge': ['BusinessKnowledge', 'businessKnowledge'],
'/business-knowledge/settings': ['BusinessKnowledgeSettings', 'businessKnowledgeSettings'],
'/transformations': ['Transformations', 'transformations'],
@@ -174,6 +177,10 @@ export const productRoutes: Record<string, [string, string]> = {
'/feature_flags/staff': ['FeatureFlagsStaffTools', 'featureFlagsStaffTools'],
'/games/368hedgehogs': ['Game368Hedgehogs', 'game368Hedgehogs'],
'/games/flappyhog': ['FlappyHog', 'flappyHog'],
+ '/groups/:groupTypeIndex': ['Groups', 'groups'],
+ '/groups/:groupTypeIndex/new': ['GroupsNew', 'groupsNew'],
+ '/groups/:groupTypeIndex/:groupKey': ['Group', 'group'],
+ '/groups/:groupTypeIndex/:groupKey/:groupTab': ['Group', 'groupWithTab'],
'/identity-matching': ['IdentityMatching', 'identityMatching'],
'/ai-enrichment': ['AIEnrichment', 'aiEnrichment'],
'/ai-enrichment/:label': ['AIEnrichment', 'aiEnrichment'],
@@ -557,6 +564,13 @@ export const productConfiguration: Record<string, any> = {
iconType: 'inbox',
description: 'Monitor insight metrics and get notified when conditions are met.',
},
+ Annotations: {
+ name: 'Annotations',
+ projectBased: true,
+ description:
+ 'Annotations allow you to mark when certain changes happened so you can easily see how they impacted your metrics.',
+ iconType: 'annotation',
+ },
BusinessKnowledge: {
name: 'Business knowledge',
projectBased: true,
@@ -742,6 +756,9 @@ export const productConfiguration: Record<string, any> = {
FeatureFlagsStaffTools: { instanceLevel: true, name: 'Flags staff tools' },
Game368Hedgehogs: { name: '368Hedgehogs', projectBased: true, activityScope: 'Games' },
FlappyHog: { name: 'FlappyHog', projectBased: true, activityScope: 'Games' },
+ Group: { name: 'People & groups', projectBased: true },
+ Groups: { name: 'Groups', projectBased: true },
+ GroupsNew: { projectBased: true },
IdentityMatching: {
name: 'Identity matching',
projectBased: true,
@@ -1116,6 +1133,8 @@ export const productUrls = {
`/ai-observability/clusters/${encodeURIComponent(runId)}/${clusterId}`,
alert: (alertId: string): string => `/alerts?alert_type=insights&alert_id=${alertId}`,
alerts: (): string => '/alerts',
+ annotations: (): string => '/data-management/annotations',
+ annotation: (id: AnnotationType['id'] | ':id'): string => `/data-management/annotations/${id}`,
businessKnowledge: (): string => '/business-knowledge',
businessKnowledgeSettings: (): string => '/business-knowledge/settings',
transformations: (): string => '/transformations',
diff --git a/frontend/src/queries/nodes/DataTable/TableView/tableViewLogic.ts b/frontend/src/queries/nodes/DataTable/TableView/tableViewLogic.ts
index 41d4fb157e7e..9e9214d113b4 100644
--- a/frontend/src/queries/nodes/DataTable/TableView/tableViewLogic.ts
+++ b/frontend/src/queries/nodes/DataTable/TableView/tableViewLogic.ts
@@ -8,7 +8,6 @@ import posthog from 'posthog-js'
import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { getCurrentTeamId } from 'lib/utils/getAppContext'
-import { GROUPS_LIST_DEFAULT_QUERY } from 'scenes/groups/groupsListLogic'
import { PERSON_EVENTS_CONTEXT_KEY } from 'scenes/persons/personsLogic'
import { PEOPLE_LIST_CONTEXT_KEY, PEOPLE_LIST_DEFAULT_QUERY } from 'scenes/persons/personsSceneLogic'
import { userLogic } from 'scenes/userLogic'
@@ -18,6 +17,7 @@ import { ActorsQuery, EventsQuery, GroupsQuery, NodeKind } from '~/queries/schem
import { isEventsQuery } from '~/queries/utils'
import { AnyPropertyFilter, PropertyOperator } from '~/types'
+import { GROUPS_LIST_DEFAULT_QUERY } from 'products/groups/frontend/logics/groupsListLogic'
import { ColumnConfigurationApi } from 'products/product_analytics/frontend/generated/api.schemas'
import type { UserType } from '../../../../types'
diff --git a/frontend/src/scenes/annotations/index.ts b/frontend/src/scenes/annotations/index.ts
deleted file mode 100644
index c853e043a2bc..000000000000
--- a/frontend/src/scenes/annotations/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { Annotations } from './Annotations'
diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.ts
index de5bd9d2a8eb..56f959165042 100644
--- a/frontend/src/scenes/appScenes.ts
+++ b/frontend/src/scenes/appScenes.ts
@@ -7,7 +7,6 @@ export const appScenes: Record<Scene | string, () => any> = {
...productScenes,
[Scene.AdvancedActivityLogs]: () => import('./audit-logs/AdvancedActivityLogsScene'),
[Scene.AgenticAuthorize]: () => import('./agentic/AgenticAuthorize'),
- [Scene.Annotations]: () => import('./annotations/Annotations'),
[Scene.Approval]: () => import('./approvals/ApprovalDetail'),
[Scene.AsyncMigrations]: () => import('./instance/AsyncMigrations/AsyncMigrations'),
[Scene.MaterializedColumns]: () => import('./data-management/MaterializedColumns/MaterializedColumns'),
@@ -44,9 +43,6 @@ export const appScenes: Record<Scene | string, () => any> = {
[Scene.ExploreSessions]: () => import('./activity/explore/SessionsScene'),
[Scene.FeatureFlag]: () => import('./feature-flags/FeatureFlag'),
[Scene.FeatureFlags]: () => import('./feature-flags/FeatureFlags'),
- [Scene.Group]: () => import('./groups/Group'),
- [Scene.GroupsNew]: () => import('./groups/GroupsNew'),
- [Scene.Groups]: () => import('./groups/Groups'),
[Scene.HogFunction]: () => import('./hog-functions/HogFunctionScene'),
[Scene.Insight]: () => import('./insights/InsightScene'),
[Scene.InsightQuickStart]: () => import('./insights/InsightQuickStart/InsightQuickStart'),
diff --git a/frontend/src/scenes/experiments/Metrics/Selectors.tsx b/frontend/src/scenes/experiments/Metrics/Selectors.tsx
index 2400bd87397c..06d7790449af 100644
--- a/frontend/src/scenes/experiments/Metrics/Selectors.tsx
+++ b/frontend/src/scenes/experiments/Metrics/Selectors.tsx
@@ -8,11 +8,11 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { capitalizeFirstLetter, pluralize } from 'lib/utils/strings'
-import { GroupIntroductionFooter } from 'scenes/groups/GroupsIntroduction'
import { groupsModel } from '~/models/groupsModel'
import { BreakdownAttributionType, FunnelConversionWindowTimeUnit, StepOrderValue } from '~/types'
+import { GroupIntroductionFooter } from 'products/groups/frontend/components/GroupsIntroduction'
import { FUNNEL_STEP_COUNT_LIMIT } from 'products/product_analytics/frontend/insights/funnels/editor/FunnelsQuerySteps'
import { TIME_INTERVAL_BOUNDS } from 'products/product_analytics/frontend/insights/funnels/funnelUtils'
diff --git a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/useMathSelectorOptions.tsx b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/useMathSelectorOptions.tsx
index dec0cd595116..c188f019f894 100644
--- a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/useMathSelectorOptions.tsx
+++ b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/useMathSelectorOptions.tsx
@@ -5,7 +5,6 @@ import { IconWarning } from '@posthog/icons'
import { LemonSelect, LemonSelectOption, LemonSelectOptions } from '@posthog/lemon-ui'
import { capitalizeFirstLetter } from 'lib/utils/strings'
-import { GroupIntroductionFooter } from 'scenes/groups/GroupsIntroduction'
import {
COUNT_PER_ACTOR_MATH_DEFINITIONS,
MathDefinition,
@@ -24,6 +23,8 @@ import {
} from '~/queries/utils'
import { BaseMathType, ChartDisplayType, CountPerActorMathType, HogQLMathType, PropertyMathType } from '~/types'
+import { GroupIntroductionFooter } from 'products/groups/frontend/components/GroupsIntroduction'
+
import {
getDefaultPropertyMathType,
isCountPerActorMath,
diff --git a/frontend/src/scenes/insights/filters/AggregationSelect.tsx b/frontend/src/scenes/insights/filters/AggregationSelect.tsx
index 4490e8f1e9cb..ce30694e89e3 100644
--- a/frontend/src/scenes/insights/filters/AggregationSelect.tsx
+++ b/frontend/src/scenes/insights/filters/AggregationSelect.tsx
@@ -4,7 +4,6 @@ import { LemonSelect, LemonSelectSection } from '@posthog/lemon-ui'
import { HogQLEditor } from 'lib/components/HogQLEditor/HogQLEditor'
import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
-import { GroupIntroductionFooter } from 'scenes/groups/GroupsIntroduction'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { groupsModel } from '~/models/groupsModel'
@@ -18,6 +17,8 @@ import {
} from '~/queries/utils'
import { InsightLogicProps } from '~/types'
+import { GroupIntroductionFooter } from 'products/groups/frontend/components/GroupsIntroduction'
+
export function getHogQLValue(groupIndex?: number | null, aggregationQuery?: string | null): string {
if (groupIndex != undefined) {
return `$group_${groupIndex}`
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroup.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroup.tsx
index 44c1c4255d9f..6ea69f7278a1 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroup.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroup.tsx
@@ -12,7 +12,6 @@ import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { formatCurrency } from 'lib/utils/currency'
import stringWithWBR from 'lib/utils/stringWithWBR'
-import { groupLogic } from 'scenes/groups/groupLogic'
import { createPostHogWidgetNode } from 'scenes/notebooks/Nodes/NodeWrapper'
import { defineNotebookWidgetViews, getNotebookWidgetDefaultView } from 'scenes/notebooks/notebookWidgetCatalog'
import { groupDisplayId } from 'scenes/persons/GroupActorDisplay'
@@ -24,6 +23,8 @@ import { Query } from '~/queries/Query/Query'
import { CurrencyCode, NodeKind } from '~/queries/schema/schema-general'
import { Group, PropertyFilterType, PropertyOperator } from '~/types'
+import { groupLogic } from 'products/groups/frontend/logics/groupLogic'
+
import { NotebookNodeProps, NotebookNodeType } from '../types'
import { DataSourceIcon } from './components/DataSourceIcon'
import { notebookNodeLogic } from './notebookNodeLogic'
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroupProperties.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroupProperties.tsx
index 51fd2de3f89d..9d954f30b55c 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroupProperties.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeGroupProperties.tsx
@@ -4,11 +4,12 @@ import { LemonSkeleton } from '@posthog/lemon-ui'
import { NotFound } from 'lib/components/NotFound'
import { userPreferencesLogic } from 'lib/logic/userPreferencesLogic'
-import { groupLogic } from 'scenes/groups/groupLogic'
import { createPostHogWidgetNode } from 'scenes/notebooks/Nodes/NodeWrapper'
import { PropertyDefinitionType } from '~/types'
+import { groupLogic } from 'products/groups/frontend/logics/groupLogic'
+
import { NotebookNodeType } from '../types'
import { Properties } from './components/Properties'
import { notebookNodeLogic } from './notebookNodeLogic'
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeRelatedGroups.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeRelatedGroups.tsx
index 8580fddfc80c..44d3a1d3f083 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeRelatedGroups.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeRelatedGroups.tsx
@@ -1,8 +1,9 @@
import { useValues } from 'kea'
-import { RelatedGroups, RelatedGroupsProps } from 'scenes/groups/RelatedGroups'
import { urls } from 'scenes/urls'
+import { RelatedGroups, RelatedGroupsProps } from 'products/groups/frontend/components/RelatedGroups'
+
import { NotebookNodeProps, NotebookNodeType } from '../types'
import { createPostHogWidgetNode } from './NodeWrapper'
import { notebookNodeLogic } from './notebookNodeLogic'
diff --git a/frontend/src/scenes/persons/PersonScene.tsx b/frontend/src/scenes/persons/PersonScene.tsx
index 1b3c11d5b3c9..26fa40a8f927 100644
--- a/frontend/src/scenes/persons/PersonScene.tsx
+++ b/frontend/src/scenes/persons/PersonScene.tsx
@@ -25,7 +25,6 @@ import { copyToClipboard } from 'lib/utils/copyToClipboard'
import { isMobile } from 'lib/utils/dom'
import { pluralize } from 'lib/utils/strings'
import { tryDecodeURIComponent } from 'lib/utils/url'
-import { RelatedGroups } from 'scenes/groups/RelatedGroups'
import { NotebookSelectButton } from 'scenes/notebooks/NotebookSelectButton/NotebookSelectButton'
import { NotebookNodeType } from 'scenes/notebooks/types'
import { PersonDeleteModal } from 'scenes/persons/PersonDeleteModal'
@@ -53,6 +52,7 @@ import {
import { ComposeTicketButton } from 'products/conversations/frontend/components/ComposeTicket'
import { FeedbackButton } from 'products/customer_analytics/frontend/components/FeedbackButton'
+import { RelatedGroups } from 'products/groups/frontend/components/RelatedGroups'
import { MergeSplitPerson } from './MergeSplitPerson'
import { asDisplay, pickBestPersonDistinctId } from './person-utils'
diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.ts
index 27988cbdd32d..9495deb5e2ea 100644
--- a/frontend/src/scenes/scenes.ts
+++ b/frontend/src/scenes/scenes.ts
@@ -55,13 +55,6 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {
name: 'Materialized columns',
description: 'Manage materialized column slot assignments for your team.',
},
- [Scene.Annotations]: {
- projectBased: true,
- name: 'Annotations',
- description:
- 'Annotations allow you to mark when certain changes happened so you can easily see how they impacted your metrics.',
- iconType: 'annotation',
- },
[Scene.Approval]: {
projectBased: true,
name: 'Approval',
@@ -231,12 +224,6 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {
docsHref: 'https://posthog.com/docs/feature-flags',
},
[Scene.Game368]: { name: '368 Hedgehogs', projectBased: true },
- [Scene.Group]: {
- projectBased: true,
- name: 'People & groups',
- },
- [Scene.GroupsNew]: { projectBased: true },
- [Scene.Groups]: { projectBased: true, name: 'Groups' },
[Scene.HogFunction]: { projectBased: true, name: 'Hog function', activityScope: ActivityScope.HOG_FUNCTION },
[Scene.Insight]: {
projectBased: true,
@@ -816,10 +803,6 @@ export const routes: Record<string, [Scene | string, string]> = {
[urls.personByUUID('*', false)]: [Scene.Person, 'personByUUID'],
[urls.persons()]: [Scene.Persons, 'persons'],
[urls.customCss()]: [Scene.CustomCss, 'customCss'],
- [urls.groups(':groupTypeIndex')]: [Scene.Groups, 'groups'],
- [urls.groupsNew(':groupTypeIndex')]: [Scene.GroupsNew, 'groupsNew'],
- [urls.group(':groupTypeIndex', ':groupKey', false)]: [Scene.Group, 'group'],
- [urls.group(':groupTypeIndex', ':groupKey', false, ':groupTab')]: [Scene.Group, 'groupWithTab'],
[urls.cohort(':id')]: [Scene.Cohort, 'cohort'],
[urls.cohortCalculationHistory(':id')]: [Scene.CohortCalculationHistory, 'cohortCalculationHistory'],
[urls.cohorts()]: [Scene.Cohorts, 'cohorts'],
@@ -844,8 +827,6 @@ export const routes: Record<string, [Scene | string, string]> = {
[urls.featureFlagsStaffTools()]: ['FeatureFlagsStaffTools' as Scene, 'featureFlagsStaffTools'],
[urls.cohortsStaffTools()]: ['CohortsStaffTools' as Scene, 'cohortsStaffTools'],
[urls.featureFlag(':id')]: [Scene.FeatureFlag, 'featureFlag'],
- [urls.annotations()]: [Scene.Annotations, 'annotations'],
- [urls.annotation(':id')]: [Scene.Annotations, 'annotation'],
[urls.variables()]: [Scene.DataManagement, 'variables'],
[urls.variableEdit(':id')]: [Scene.SqlVariableEdit, 'sqlVariableEdit'],
[urls.projectHomepage()]: [Scene.ProjectHomepage, 'projectHomepage'],
diff --git a/frontend/src/scenes/settings/environment/GroupAnalyticsConfig.tsx b/frontend/src/scenes/settings/environment/GroupAnalyticsConfig.tsx
index d9b24fd5e323..7eb2011da045 100644
--- a/frontend/src/scenes/settings/environment/GroupAnalyticsConfig.tsx
+++ b/frontend/src/scenes/settings/environment/GroupAnalyticsConfig.tsx
@@ -8,10 +8,11 @@ import { TeamMembershipLevel } from 'lib/constants'
import { GroupsAccessStatus, groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonTable, LemonTableColumns } from 'lib/lemon-ui/LemonTable'
-import { GroupsIntroduction } from 'scenes/groups/GroupsIntroduction'
import { GroupType } from '~/types'
+import { GroupsIntroduction } from 'products/groups/frontend/components/GroupsIntroduction'
+
import { groupAnalyticsConfigLogic } from './groupAnalyticsConfigLogic'
export interface DeleteGroupTypeDialogProps {
diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts
index e5f38383f35e..a0bca946a6a5 100644
--- a/frontend/src/scenes/urls.ts
+++ b/frontend/src/scenes/urls.ts
@@ -10,7 +10,7 @@ import {
ProductKey,
SharingConfigurationSettings,
} from '~/queries/schema/schema-general'
-import { ActivityTab, AnnotationType, OnboardingStepKey, SDKKey } from '~/types'
+import { ActivityTab, OnboardingStepKey, SDKKey } from '~/types'
import type { MetricFormPrefill } from 'products/data_catalog/frontend/common'
@@ -148,8 +148,6 @@ export const urls = {
const hashString = hashParams.toString()
return `/sql${queryString ? `?${queryString}` : ''}${hashString ? `#${hashString}` : ''}`
},
- annotations: (): string => '/data-management/annotations',
- annotation: (id: AnnotationType['id'] | ':id'): string => `/data-management/annotations/${id}`,
variables: (): string => '/data-management/variables',
variable: (id: string | ':id'): string => `/data-management/variables/${id}`,
variableEdit: (id: string | ':id'): string => `/data-management/variables/${id}/edit`,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3a2292023f5e..b5fcf8459d0c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2524,6 +2524,12 @@ importers:
'@posthog/icons':
specifier: 'catalog:'
+ '@testing-library/dom':
+ specifier: '*'
+ version: 10.4.0
+ '@testing-library/user-event':
+ specifier: '*'
+ version: 14.6.1(@testing-library/[email protected])
'@types/react':
specifier: 18.3.27
version: 18.3.27
@@ -2533,6 +2539,12 @@ importers:
kea:
specifier: 'catalog:'
version: 4.0.0-pre.6(patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected])
+ kea-forms:
+ specifier: 'catalog:'
+ version: 3.2.0([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
+ kea-router:
+ specifier: 'catalog:'
+ version: 3.4.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
react:
specifier: 18.3.1
version: 18.3.1
@@ -3536,6 +3548,12 @@ importers:
'@posthog/icons':
specifier: 'catalog:'
+ '@posthog/react':
+ specifier: 'catalog:'
+ '@storybook/react':
+ specifier: 'catalog:'
'@types/react':
specifier: 18.3.27
version: 18.3.27
@@ -3548,15 +3566,25 @@ importers:
kea:
specifier: 'catalog:'
version: 4.0.0-pre.6(patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected])
+ kea-forms:
+ specifier: 'catalog:'
+ version: 3.2.0([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
kea-loaders:
specifier: 'catalog:'
version: 3.1.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
kea-router:
specifier: 'catalog:'
version: 3.4.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
+ posthog-js:
+ specifier: 'catalog:'
+ version: 1.429.2(@types/[email protected])([email protected])
react:
specifier: 18.3.1
version: 18.3.1
+ devDependencies:
+ kea-test-utils:
+ specifier: 'catalog:'
+ version: 0.2.4([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))
products/growth:
dependencies:
diff --git a/frontend/src/scenes/actions/actionActivityDescriber.tsx b/products/actions/frontend/actionActivityDescriber.tsx
similarity index 100%
rename from frontend/src/scenes/actions/actionActivityDescriber.tsx
rename to products/actions/frontend/actionActivityDescriber.tsx
diff --git a/frontend/src/scenes/annotations/activityDescriptions.tsx b/products/annotations/frontend/activityDescriptions.tsx
similarity index 100%
rename from frontend/src/scenes/annotations/activityDescriptions.tsx
rename to products/annotations/frontend/activityDescriptions.tsx
diff --git a/frontend/src/scenes/annotations/AnnotationModal.tsx b/products/annotations/frontend/components/AnnotationModal.tsx
similarity index 99%
rename from frontend/src/scenes/annotations/AnnotationModal.tsx
rename to products/annotations/frontend/components/AnnotationModal.tsx
index 46422021acb0..874a2c63f95a 100644
--- a/frontend/src/scenes/annotations/AnnotationModal.tsx
+++ b/products/annotations/frontend/components/AnnotationModal.tsx
@@ -14,7 +14,7 @@ import { urls } from 'scenes/urls'
import { AnnotationScope, AnnotationType } from '~/types'
-import { annotationModalLogic, annotationScopeToName } from './annotationModalLogic'
+import { annotationModalLogic, annotationScopeToName } from '../logics/annotationModalLogic'
export function NewAnnotationButton(): JSX.Element {
const { openModalToCreateAnnotation } = useActions(annotationModalLogic)
diff --git a/products/annotations/frontend/emptyState/AnnotationsPrimaryAction.tsx b/products/annotations/frontend/emptyState/AnnotationsPrimaryAction.tsx
index f7692d07eb88..f48a3a9418e7 100644
--- a/products/annotations/frontend/emptyState/AnnotationsPrimaryAction.tsx
+++ b/products/annotations/frontend/emptyState/AnnotationsPrimaryAction.tsx
@@ -1,8 +1,9 @@
import { useActions } from 'kea'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { AnnotationModal } from 'scenes/annotations/AnnotationModal'
-import { annotationModalLogic } from 'scenes/annotations/annotationModalLogic'
+
+import { AnnotationModal } from '../components/AnnotationModal'
+import { annotationModalLogic } from '../logics/annotationModalLogic'
/**
* Create button for the annotations empty state. Annotations are created in a modal
diff --git a/frontend/src/scenes/annotations/annotationModalLogic.ts b/products/annotations/frontend/logics/annotationModalLogic.ts
similarity index 98%
rename from frontend/src/scenes/annotations/annotationModalLogic.ts
rename to products/annotations/frontend/logics/annotationModalLogic.ts
index d1f12547fd45..54c37e3e23bc 100644
--- a/frontend/src/scenes/annotations/annotationModalLogic.ts
+++ b/products/annotations/frontend/logics/annotationModalLogic.ts
@@ -15,8 +15,8 @@ import { userLogic } from 'scenes/userLogic'
import { annotationsModel, deserializeAnnotation } from '~/models/annotationsModel'
import { AnnotationScope, AnnotationType, DashboardBasicType, QueryBasedInsightModel } from '~/types'
-import type { UserType } from '../../types'
-import type { RawAnnotationType } from '../../types'
+import type { UserType } from '../../../../frontend/src/types'
+import type { RawAnnotationType } from '../../../../frontend/src/types'
export const ANNOTATION_DAYJS_FORMAT = 'MMMM DD, YYYY h:mm A'
diff --git a/frontend/src/scenes/annotations/annotationsLogic.ts b/products/annotations/frontend/logics/annotationsLogic.ts
similarity index 100%
rename from frontend/src/scenes/annotations/annotationsLogic.ts
rename to products/annotations/frontend/logics/annotationsLogic.ts
diff --git a/frontend/src/scenes/annotations/Annotations.stories.tsx b/products/annotations/frontend/pages/Annotations.stories.tsx
similarity index 100%
rename from frontend/src/scenes/annotations/Annotations.stories.tsx
rename to products/annotations/frontend/pages/Annotations.stories.tsx
diff --git a/frontend/src/scenes/annotations/Annotations.tsx b/products/annotations/frontend/pages/Annotations.tsx
similarity index 98%
rename from frontend/src/scenes/annotations/Annotations.tsx
rename to products/annotations/frontend/pages/Annotations.tsx
index 093108228a26..d57da80289c4 100644
--- a/frontend/src/scenes/annotations/Annotations.tsx
+++ b/products/annotations/frontend/pages/Annotations.tsx
@@ -27,9 +27,9 @@ import { AnnotationScope, AnnotationType, InsightShortId } from '~/types'
import { annotationsEmptyState } from 'products/annotations/frontend/emptyState/annotationsEmptyState'
-import { AnnotationModal } from './AnnotationModal'
-import { annotationModalLogic, annotationScopeToLevel, annotationScopeToName } from './annotationModalLogic'
-import { annotationScopesMenuOptions, annotationsLogic } from './annotationsLogic'
+import { AnnotationModal } from '../components/AnnotationModal'
+import { annotationModalLogic, annotationScopeToLevel, annotationScopeToName } from '../logics/annotationModalLogic'
+import { annotationScopesMenuOptions, annotationsLogic } from '../logics/annotationsLogic'
export const scene: SceneExport = {
component: Annotations,
diff --git a/frontend/src/scenes/annotations/__mocks__/annotations.json b/products/annotations/frontend/pages/__mocks__/annotations.json
similarity index 100%
rename from frontend/src/scenes/annotations/__mocks__/annotations.json
rename to products/annotations/frontend/pages/__mocks__/annotations.json
diff --git a/products/annotations/manifest.tsx b/products/annotations/manifest.tsx
index 05d1447a1865..11b5e6ced1e3 100644
--- a/products/annotations/manifest.tsx
+++ b/products/annotations/manifest.tsx
@@ -3,19 +3,28 @@
*
* Defines scenes, routes, URLs, and navigation for this product.
*/
-import { ProductManifest } from '../../frontend/src/types'
+import { AnnotationType, ProductManifest } from '../../frontend/src/types'
export const manifest: ProductManifest = {
name: 'Annotations',
scenes: {
- // Define scenes here
+ Annotations: {
+ name: 'Annotations',
+ import: () => import('./frontend/pages/Annotations'),
+ projectBased: true,
+ description:
+ 'Annotations allow you to mark when certain changes happened so you can easily see how they impacted your metrics.',
+ iconType: 'annotation',
+ },
},
routes: {
- // Define routes here
+ '/data-management/annotations': ['Annotations', 'annotations'],
+ '/data-management/annotations/:id': ['Annotations', 'annotation'],
},
redirects: {},
urls: {
- // Define URL helpers here
+ annotations: (): string => '/data-management/annotations',
+ annotation: (id: AnnotationType['id'] | ':id'): string => `/data-management/annotations/${id}`,
},
fileSystemTypes: {},
treeItemsNew: [],
diff --git a/products/annotations/package.json b/products/annotations/package.json
index dc339f0d78b4..541027c2fbe7 100644
--- a/products/annotations/package.json
+++ b/products/annotations/package.json
@@ -4,7 +4,9 @@
"backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short"
},
"dependencies": {
- "kea": "catalog:"
+ "kea": "catalog:",
+ "kea-forms": "catalog:",
+ "kea-router": "catalog:"
},
"devDependencies": {
"@storybook/react": "catalog:",
@@ -13,6 +15,8 @@
"peerDependencies": {
"@posthog/brand": "catalog:",
"@posthog/icons": "catalog:",
+ "@testing-library/dom": "*",
+ "@testing-library/user-event": "*",
"@types/react": "*",
"clsx": "*",
"react": "*"
diff --git a/products/conversations/frontend/scenes/ticket/RelatedGroupsPanel.tsx b/products/conversations/frontend/scenes/ticket/RelatedGroupsPanel.tsx
index 486cd9a63d62..c4fc10a07a70 100644
--- a/products/conversations/frontend/scenes/ticket/RelatedGroupsPanel.tsx
+++ b/products/conversations/frontend/scenes/ticket/RelatedGroupsPanel.tsx
@@ -2,13 +2,14 @@ import { useValues } from 'kea'
import { LemonCollapse, LemonTag, Spinner, Tooltip } from '@posthog/lemon-ui'
-import { RelatedGroups } from 'scenes/groups/RelatedGroups'
-import { relatedGroupsLogic } from 'scenes/groups/relatedGroupsLogic'
import { GroupActorDisplay } from 'scenes/persons/GroupActorDisplay'
import { groupsModel } from '~/models/groupsModel'
import { ActorType, Group, GroupActorType } from '~/types'
+import { RelatedGroups } from 'products/groups/frontend/components/RelatedGroups'
+import { relatedGroupsLogic } from 'products/groups/frontend/logics/relatedGroupsLogic'
+
import { creationGroupLogic } from './creationGroupLogic'
const ORIGIN_LABEL = 'Ticket origin'
diff --git a/products/customer_analytics/frontend/CustomerAnalyticsScene.tsx b/products/customer_analytics/frontend/CustomerAnalyticsScene.tsx
index 7bb052166904..573bd3084459 100644
--- a/products/customer_analytics/frontend/CustomerAnalyticsScene.tsx
+++ b/products/customer_analytics/frontend/CustomerAnalyticsScene.tsx
@@ -13,7 +13,6 @@ import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { getAccessControlDisabledReason, userHasAccess } from 'lib/utils/accessControlUtils'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
-import { GroupsIntroduction } from 'scenes/groups/GroupsIntroduction'
import { sceneConfigurations } from 'scenes/scenes'
import { Scene, SceneExport } from 'scenes/sceneTypes'
import { teamLogic } from 'scenes/teamLogic'
@@ -27,6 +26,7 @@ import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-genera
import { AccessControlLevel, AccessControlResourceType } from '~/types'
import { SessionInsights } from 'products/customer_analytics/frontend/components/Insights/SessionInsights'
+import { GroupsIntroduction } from 'products/groups/frontend/components/GroupsIntroduction'
import { AccountNotesTabContent } from './components/AccountNotes/AccountNotesTabContent'
import { AccountsTabContent } from './components/Accounts/AccountsTabContent'
diff --git a/products/customer_analytics/frontend/components/GroupProfileCanvas.tsx b/products/customer_analytics/frontend/components/GroupProfileCanvas.tsx
index 9301d2bbc02b..a57325fce2c2 100644
--- a/products/customer_analytics/frontend/components/GroupProfileCanvas.tsx
+++ b/products/customer_analytics/frontend/components/GroupProfileCanvas.tsx
@@ -4,13 +4,14 @@ import { useMemo } from 'react'
import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
-import { groupLogic } from 'scenes/groups/groupLogic'
import { Notebook } from 'scenes/notebooks/Notebook/Notebook'
import { NotebookLogicProps, notebookLogic } from 'scenes/notebooks/Notebook/notebookLogic'
import { groupsModel } from '~/models/groupsModel'
import { AnyPropertyFilter, CustomerProfileScope, Group, PropertyFilterType, PropertyOperator } from '~/types'
+import { groupLogic } from 'products/groups/frontend/logics/groupLogic'
+
import { customerProfileLogic } from '../customerProfileLogic'
import { CustomerProfileMenu } from './CustomerProfileMenu'
diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/account/CustomerAnalyticsAccountConfig.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/account/CustomerAnalyticsAccountConfig.tsx
index 56560be1b3b2..c1fd54458fe1 100644
--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/account/CustomerAnalyticsAccountConfig.tsx
+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/account/CustomerAnalyticsAccountConfig.tsx
@@ -6,12 +6,13 @@ import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedAr
import { TeamMembershipLevel } from 'lib/constants'
import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
import { capitalizeFirstLetter, wordPluralize } from 'lib/utils/strings'
-import { GroupsIntroduction } from 'scenes/groups/GroupsIntroduction'
import { teamLogic } from 'scenes/teamLogic'
import { groupsModel } from '~/models/groupsModel'
import { CustomerAnalyticsConfig } from '~/queries/schema/schema-general'
+import { GroupsIntroduction } from 'products/groups/frontend/components/GroupsIntroduction'
+
import { CustomPropertiesConfig } from './CustomPropertiesConfig'
import { RelationshipsConfig } from './RelationshipsConfig'
diff --git a/products/experiments/frontend/legacy/components/LegacyFunnelAggregationSelect.tsx b/products/experiments/frontend/legacy/components/LegacyFunnelAggregationSelect.tsx
index 1719b0e64195..e14f5f116d15 100644
--- a/products/experiments/frontend/legacy/components/LegacyFunnelAggregationSelect.tsx
+++ b/products/experiments/frontend/legacy/components/LegacyFunnelAggregationSelect.tsx
@@ -4,10 +4,11 @@ import { LemonSelect, LemonSelectSection } from '@posthog/lemon-ui'
import { HogQLEditor } from 'lib/components/HogQLEditor/HogQLEditor'
import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
-import { GroupIntroductionFooter } from 'scenes/groups/GroupsIntroduction'
import { groupsModel } from '~/models/groupsModel'
+import { GroupIntroductionFooter } from 'products/groups/frontend/components/GroupsIntroduction'
+
/**
* @deprecated
* Legacy funnel aggregation select for ExperimentView.
diff --git a/frontend/src/scenes/groups/activityDescriptions.tsx b/products/groups/frontend/activityDescriptions.tsx
similarity index 100%
rename from frontend/src/scenes/groups/activityDescriptions.tsx
rename to products/groups/frontend/activityDescriptions.tsx
diff --git a/frontend/src/scenes/groups/cards/GroupDashboardCard.tsx b/products/groups/frontend/cards/GroupDashboardCard.tsx
similarity index 99%
rename from frontend/src/scenes/groups/cards/GroupDashboardCard.tsx
rename to products/groups/frontend/cards/GroupDashboardCard.tsx
index 29e155653acd..1d261b8527e3 100644
--- a/frontend/src/scenes/groups/cards/GroupDashboardCard.tsx
+++ b/products/groups/frontend/cards/GroupDashboardCard.tsx
@@ -6,12 +6,13 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { Dashboard } from 'scenes/dashboard/Dashboard'
import { dashboardLogic } from 'scenes/dashboard/dashboardLogic'
-import { groupLogic } from 'scenes/groups/groupLogic'
import { urls } from 'scenes/urls'
import { Node, NodeKind } from '~/queries/schema/schema-general'
import { DashboardPlacement, Group, PropertyFilterType, PropertyOperator } from '~/types'
+import { groupLogic } from 'products/groups/frontend/logics/groupLogic'
+
function GroupDetailDashboard({
groupTypeDetailDashboard,
groupData,
diff --git a/frontend/src/scenes/groups/cards/GroupNotebookCard.tsx b/products/groups/frontend/cards/GroupNotebookCard.tsx
similarity index 100%
rename from frontend/src/scenes/groups/cards/GroupNotebookCard.tsx
rename to products/groups/frontend/cards/GroupNotebookCard.tsx
diff --git a/frontend/src/scenes/groups/cards/GroupPeopleCard.tsx b/products/groups/frontend/cards/GroupPeopleCard.tsx
similarity index 93%
rename from frontend/src/scenes/groups/cards/GroupPeopleCard.tsx
rename to products/groups/frontend/cards/GroupPeopleCard.tsx
index 34376d869cba..c2eafdf0c7c0 100644
--- a/frontend/src/scenes/groups/cards/GroupPeopleCard.tsx
+++ b/products/groups/frontend/cards/GroupPeopleCard.tsx
@@ -3,7 +3,7 @@ import { urls } from 'scenes/urls'
import { Group } from '~/types'
-import { RelatedGroups } from '../RelatedGroups'
+import { RelatedGroups } from '../components/RelatedGroups'
export function GroupPeopleCard({ groupData }: { groupData: Group }): JSX.Element {
return (
diff --git a/frontend/src/scenes/groups/cards/GroupPropertiesCard.tsx b/products/groups/frontend/cards/GroupPropertiesCard.tsx
similarity index 96%
rename from frontend/src/scenes/groups/cards/GroupPropertiesCard.tsx
rename to products/groups/frontend/cards/GroupPropertiesCard.tsx
index 00ccf53ca7b0..612f0338f1dd 100644
--- a/frontend/src/scenes/groups/cards/GroupPropertiesCard.tsx
+++ b/products/groups/frontend/cards/GroupPropertiesCard.tsx
@@ -7,7 +7,7 @@ import { urls } from 'scenes/urls'
import { Group, PropertyDefinitionType } from '~/types'
-import { groupLogic } from '../groupLogic'
+import { groupLogic } from '../logics/groupLogic'
export function GroupPropertiesCard({ groupData }: { groupData: Group }): JSX.Element {
const { editProperty } = useActions(groupLogic)
diff --git a/frontend/src/scenes/groups/components/GroupCaption.tsx b/products/groups/frontend/components/GroupCaption.tsx
similarity index 100%
rename from frontend/src/scenes/groups/components/GroupCaption.tsx
rename to products/groups/frontend/components/GroupCaption.tsx
diff --git a/frontend/src/scenes/groups/GroupOverview.tsx b/products/groups/frontend/components/GroupOverview.tsx
similarity index 77%
rename from frontend/src/scenes/groups/GroupOverview.tsx
rename to products/groups/frontend/components/GroupOverview.tsx
index fc48226024cc..8d8dbc3f6a1d 100644
--- a/frontend/src/scenes/groups/GroupOverview.tsx
+++ b/products/groups/frontend/components/GroupOverview.tsx
@@ -4,10 +4,10 @@ import { capitalizeFirstLetter } from 'lib/utils/strings'
import { Group } from '~/types'
-import { GroupDashboardCard } from './cards/GroupDashboardCard'
-import { GroupPeopleCard } from './cards/GroupPeopleCard'
-import { GroupPropertiesCard } from './cards/GroupPropertiesCard'
-import { groupLogic } from './groupLogic'
+import { GroupDashboardCard } from '../cards/GroupDashboardCard'
+import { GroupPeopleCard } from '../cards/GroupPeopleCard'
+import { GroupPropertiesCard } from '../cards/GroupPropertiesCard'
+import { groupLogic } from '../logics/groupLogic'
export function GroupOverview({ groupData }: { groupData: Group }): JSX.Element {
const { groupTypeName } = useValues(groupLogic)
diff --git a/frontend/src/scenes/groups/GroupsIntroduction.tsx b/products/groups/frontend/components/GroupsIntroduction.tsx
similarity index 100%
rename from frontend/src/scenes/groups/GroupsIntroduction.tsx
rename to products/groups/frontend/components/GroupsIntroduction.tsx
diff --git a/frontend/src/scenes/groups/RelatedGroups.tsx b/products/groups/frontend/components/RelatedGroups.tsx
similarity index 98%
rename from frontend/src/scenes/groups/RelatedGroups.tsx
rename to products/groups/frontend/components/RelatedGroups.tsx
index a43ebf166ce9..c048d10c6048 100644
--- a/frontend/src/scenes/groups/RelatedGroups.tsx
+++ b/products/groups/frontend/components/RelatedGroups.tsx
@@ -6,13 +6,14 @@ import { LemonTag, Tooltip } from '@posthog/lemon-ui'
import { LemonTable, LemonTableColumns } from 'lib/lemon-ui/LemonTable'
import { capitalizeFirstLetter } from 'lib/utils/strings'
-import { relatedGroupsLogic } from 'scenes/groups/relatedGroupsLogic'
import { GroupActorDisplay } from 'scenes/persons/GroupActorDisplay'
import { PersonDisplay } from 'scenes/persons/PersonDisplay'
import { groupsModel } from '~/models/groupsModel'
import { ActorType } from '~/types'
+import { relatedGroupsLogic } from 'products/groups/frontend/logics/relatedGroupsLogic'
+
export interface RelatedGroupsProps {
groupTypeIndex: number | null
id: string
diff --git a/frontend/src/scenes/groups/groupLogic.test.ts b/products/groups/frontend/logics/groupLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/groups/groupLogic.test.ts
rename to products/groups/frontend/logics/groupLogic.test.ts
diff --git a/frontend/src/scenes/groups/groupLogic.ts b/products/groups/frontend/logics/groupLogic.ts
similarity index 97%
rename from frontend/src/scenes/groups/groupLogic.ts
rename to products/groups/frontend/logics/groupLogic.ts
index bccc46f8e6bc..aa9c0e253548 100644
--- a/frontend/src/scenes/groups/groupLogic.ts
+++ b/products/groups/frontend/logics/groupLogic.ts
@@ -25,9 +25,9 @@ import { ActivityScope, Breadcrumb, Group, GroupTypeIndex, PropertyFilterType, P
import { CUSTOMER_ANALYTICS_DEFAULT_QUERY_TAGS } from 'products/customer_analytics/frontend/constants'
-import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
-import type { Noun } from '../../models/groupsModel'
-import type { GroupType } from '../../types'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { Noun } from '../../../../frontend/src/models/groupsModel'
+import type { GroupType } from '../../../../frontend/src/types'
function getGroupEventsQuery(groupTypeIndex: number, groupKey: string): DataTableNode {
return {
@@ -271,6 +271,9 @@ export const groupLogic = kea<groupLogicType>([
loadGroup: async () => {
const params = { group_type_index: props.groupTypeIndex, group_key: props.groupKey }
const url = `api/environments/${values.currentTeamId}/groups/find?${toParams(params)}`
+ // groupsFindRetrieve returns Promise<void> because the endpoint declares no
+ // response schema, so it cannot type the Group this loader returns.
+ // nosemgrep: prefer-codegen-api
return await api.get(url)
},
},
diff --git a/frontend/src/scenes/groups/groupsListLogic.test.ts b/products/groups/frontend/logics/groupsListLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/groups/groupsListLogic.test.ts
rename to products/groups/frontend/logics/groupsListLogic.test.ts
diff --git a/frontend/src/scenes/groups/groupsListLogic.ts b/products/groups/frontend/logics/groupsListLogic.ts
similarity index 98%
rename from frontend/src/scenes/groups/groupsListLogic.ts
rename to products/groups/frontend/logics/groupsListLogic.ts
index 250c722bc93e..ba99b2d2c179 100644
--- a/frontend/src/scenes/groups/groupsListLogic.ts
+++ b/products/groups/frontend/logics/groupsListLogic.ts
@@ -9,8 +9,8 @@ import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, NodeKind, ProductKey } from '~/queries/schema/schema-general'
import { GroupPropertyFilter, GroupTypeIndex } from '~/types'
-import type { Noun } from '../../models/groupsModel'
-import type { GroupType } from '../../types'
+import type { Noun } from '../../../../frontend/src/models/groupsModel'
+import type { GroupType } from '../../../../frontend/src/types'
export interface GroupsListLogicProps {
groupTypeIndex: GroupTypeIndex | number
diff --git a/frontend/src/scenes/groups/groupsNewLogic.test.ts b/products/groups/frontend/logics/groupsNewLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/groups/groupsNewLogic.test.ts
rename to products/groups/frontend/logics/groupsNewLogic.test.ts
diff --git a/frontend/src/scenes/groups/groupsNewLogic.ts b/products/groups/frontend/logics/groupsNewLogic.ts
similarity index 98%
rename from frontend/src/scenes/groups/groupsNewLogic.ts
rename to products/groups/frontend/logics/groupsNewLogic.ts
index 3ade99613012..6abc6f7637be 100644
--- a/frontend/src/scenes/groups/groupsNewLogic.ts
+++ b/products/groups/frontend/logics/groupsNewLogic.ts
@@ -29,8 +29,8 @@ import { urls } from 'scenes/urls'
import { groupsModel } from '~/models/groupsModel'
import { Breadcrumb, CreateGroupParams, Group, GroupTypeIndex } from '~/types'
-import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
-import type { Noun } from '../../models/groupsModel'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { Noun } from '../../../../frontend/src/models/groupsModel'
export type GroupsNewLogicProps = {
groupTypeIndex: number
diff --git a/frontend/src/scenes/groups/groupsSceneLogic.ts b/products/groups/frontend/logics/groupsSceneLogic.ts
similarity index 97%
rename from frontend/src/scenes/groups/groupsSceneLogic.ts
rename to products/groups/frontend/logics/groupsSceneLogic.ts
index d29c921fa95a..c1cfaed7d122 100644
--- a/frontend/src/scenes/groups/groupsSceneLogic.ts
+++ b/products/groups/frontend/logics/groupsSceneLogic.ts
@@ -9,8 +9,8 @@ import { urls } from 'scenes/urls'
import { groupsModel } from '~/models/groupsModel'
import { Breadcrumb } from '~/types'
-import type { Noun } from '../../models/groupsModel'
-import type { GroupType, GroupTypeIndex } from '../../types'
+import type { Noun } from '../../../../frontend/src/models/groupsModel'
+import type { GroupType, GroupTypeIndex } from '../../../../frontend/src/types'
export type GroupsTab = {
key: string
diff --git a/frontend/src/scenes/groups/relatedGroupsLogic.ts b/products/groups/frontend/logics/relatedGroupsLogic.ts
similarity index 90%
rename from frontend/src/scenes/groups/relatedGroupsLogic.ts
rename to products/groups/frontend/logics/relatedGroupsLogic.ts
index c6889894668f..9daaab67a104 100644
--- a/frontend/src/scenes/groups/relatedGroupsLogic.ts
+++ b/products/groups/frontend/logics/relatedGroupsLogic.ts
@@ -7,7 +7,7 @@ import { teamLogic } from 'scenes/teamLogic'
import { ActorType } from '~/types'
-import type { PersonActorType } from '../../types'
+import type { PersonActorType } from '../../../../frontend/src/types'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface relatedGroupsLogicValues {
@@ -91,6 +91,9 @@ export const relatedGroupsLogic = kea<relatedGroupsLogicType>([
group_type_index: props.groupTypeIndex,
id: props.id,
})}`
+ // groupsRelatedRetrieve returns Promise<void> because the endpoint declares no
+ // response schema, so it cannot type the ActorType list this loader returns.
+ // nosemgrep: prefer-codegen-api
return await api.get(url)
},
setGroup: () => [],
diff --git a/frontend/src/scenes/groups/Group.tsx b/products/groups/frontend/pages/Group.tsx
similarity index 97%
rename from frontend/src/scenes/groups/Group.tsx
rename to products/groups/frontend/pages/Group.tsx
index 366c2e9cde0e..32ce44d700e3 100644
--- a/frontend/src/scenes/groups/Group.tsx
+++ b/products/groups/frontend/pages/Group.tsx
@@ -14,7 +14,6 @@ import { LemonTabs } from 'lib/lemon-ui/LemonTabs'
import { Link } from 'lib/lemon-ui/Link'
import { Spinner, SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { GroupLogicProps, groupLogic } from 'scenes/groups/groupLogic'
import { NotebookSelectButton } from 'scenes/notebooks/NotebookSelectButton/NotebookSelectButton'
import { NotebookNodeType } from 'scenes/notebooks/types'
import { groupDisplayId } from 'scenes/persons/GroupActorDisplay'
@@ -42,12 +41,13 @@ import {
import { FeedbackButton } from 'products/customer_analytics/frontend/components/FeedbackButton'
import { GroupProfileCanvas } from 'products/customer_analytics/frontend/components/GroupProfileCanvas'
+import { GroupLogicProps, groupLogic } from 'products/groups/frontend/logics/groupLogic'
-import { GroupDashboardCard } from './cards/GroupDashboardCard'
-import { GroupNotebookCard } from './cards/GroupNotebookCard'
-import { GroupCaption } from './components/GroupCaption'
-import { GroupOverview } from './GroupOverview'
-import { RelatedGroups } from './RelatedGroups'
+import { GroupDashboardCard } from '../cards/GroupDashboardCard'
+import { GroupNotebookCard } from '../cards/GroupNotebookCard'
+import { GroupCaption } from '../components/GroupCaption'
+import { GroupOverview } from '../components/GroupOverview'
+import { RelatedGroups } from '../components/RelatedGroups'
export const scene: SceneExport<GroupLogicProps> = {
component: Group,
diff --git a/frontend/src/scenes/groups/Groups.stories.tsx b/products/groups/frontend/pages/Groups.stories.tsx
similarity index 100%
rename from frontend/src/scenes/groups/Groups.stories.tsx
rename to products/groups/frontend/pages/Groups.stories.tsx
diff --git a/frontend/src/scenes/groups/Groups.tsx b/products/groups/frontend/pages/Groups.tsx
similarity index 96%
rename from frontend/src/scenes/groups/Groups.tsx
rename to products/groups/frontend/pages/Groups.tsx
index 2b82c36c0a85..d1c3806a0819 100644
--- a/frontend/src/scenes/groups/Groups.tsx
+++ b/products/groups/frontend/pages/Groups.tsx
@@ -8,7 +8,6 @@ import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { Link } from 'lib/lemon-ui/Link'
import { capitalizeFirstLetter } from 'lib/utils/strings'
-import { GroupsIntroduction } from 'scenes/groups/GroupsIntroduction'
import { PersonsManagementSceneTabs } from 'scenes/persons-management/PersonsManagementSceneTabs'
import { SceneExport } from 'scenes/sceneTypes'
import { teamLogic } from 'scenes/teamLogic'
@@ -22,9 +21,10 @@ import { ProductKey } from '~/queries/schema/schema-general'
import { QueryContext } from '~/queries/types'
import { FeedbackButton } from 'products/customer_analytics/frontend/components/FeedbackButton'
+import { GroupsIntroduction } from 'products/groups/frontend/components/GroupsIntroduction'
-import { groupsListLogic } from './groupsListLogic'
-import { groupsSceneLogic } from './groupsSceneLogic'
+import { groupsListLogic } from '../logics/groupsListLogic'
+import { groupsSceneLogic } from '../logics/groupsSceneLogic'
export const scene: SceneExport = {
component: GroupsScene,
diff --git a/frontend/src/scenes/groups/GroupsNew.tsx b/products/groups/frontend/pages/GroupsNew.tsx
similarity index 99%
rename from frontend/src/scenes/groups/GroupsNew.tsx
rename to products/groups/frontend/pages/GroupsNew.tsx
index cf0caf8d3e01..6ff4849c5b0e 100644
--- a/frontend/src/scenes/groups/GroupsNew.tsx
+++ b/products/groups/frontend/pages/GroupsNew.tsx
@@ -6,13 +6,14 @@ import { IconPlus, IconTrash } from '@posthog/icons'
import { LemonButton, LemonDivider, LemonInput, LemonSegmentedButton } from '@posthog/lemon-ui'
import { LemonField } from 'lib/lemon-ui/LemonField'
-import { GroupsNewLogicProps, groupsNewLogic } from 'scenes/groups/groupsNewLogic'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
+import { GroupsNewLogicProps, groupsNewLogic } from 'products/groups/frontend/logics/groupsNewLogic'
+
export const scene: SceneExport<GroupsNewLogicProps> = {
component: GroupsNew,
logic: groupsNewLogic,
diff --git a/products/groups/manifest.tsx b/products/groups/manifest.tsx
index 4c7f9d06228c..0a862ddf8337 100644
--- a/products/groups/manifest.tsx
+++ b/products/groups/manifest.tsx
@@ -2,6 +2,28 @@ import { ProductManifest } from '../../frontend/src/types'
export const manifest: ProductManifest = {
name: 'Groups',
+ scenes: {
+ Group: {
+ name: 'People & groups',
+ import: () => import('./frontend/pages/Group'),
+ projectBased: true,
+ },
+ Groups: {
+ name: 'Groups',
+ import: () => import('./frontend/pages/Groups'),
+ projectBased: true,
+ },
+ GroupsNew: {
+ import: () => import('./frontend/pages/GroupsNew'),
+ projectBased: true,
+ },
+ },
+ routes: {
+ '/groups/:groupTypeIndex': ['Groups', 'groups'],
+ '/groups/:groupTypeIndex/new': ['GroupsNew', 'groupsNew'],
+ '/groups/:groupTypeIndex/:groupKey': ['Group', 'group'],
+ '/groups/:groupTypeIndex/:groupKey/:groupTab': ['Group', 'groupWithTab'],
+ },
urls: {
groups: (groupTypeIndex: string | number): string => `/groups/${groupTypeIndex}`,
groupsNew: (groupTypeIndex: string | number): string => `/groups/${groupTypeIndex}/new`,
diff --git a/products/groups/package.json b/products/groups/package.json
index 5b854b3c6685..b640de4638c5 100644
--- a/products/groups/package.json
+++ b/products/groups/package.json
@@ -2,11 +2,18 @@
"name": "@posthog/products-groups",
"dependencies": {
"kea": "catalog:",
+ "kea-forms": "catalog:",
"kea-loaders": "catalog:",
- "kea-router": "catalog:"
+ "kea-router": "catalog:",
+ "posthog-js": "catalog:"
+ },
+ "devDependencies": {
+ "kea-test-utils": "catalog:"
},
"peerDependencies": {
"@posthog/icons": "catalog:",
+ "@posthog/react": "catalog:",
+ "@storybook/react": "catalog:",
"@types/react": "*",
"clsx": "*",
"fuse.js": "*",