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: components in their own folders (#92146)

Alex V578a43cc121a
diff --git a/AGENTS.md b/AGENTS.md
index ff511901105c..49be9a24031b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -279,6 +279,7 @@ ALWAYS invoke the matching skill **before** writing or reviewing code in these a
- `/implementing-mcp-tools` — adding/modifying endpoints or `tools.yaml`
- `/modifying-taxonomic-filter` — any TaxonomicFilter change
- `/placing-product-frontend-code` — adding a frontend file or directory for a product, or deciding between `products/<name>/frontend/` and `frontend/src/scenes/<name>/`
+- [`products/conversations/skills/organizing-conversations-code/SKILL.md`](products/conversations/skills/organizing-conversations-code/SKILL.md) — adding, moving, renaming, or reviewing files under `products/conversations/`
- `/integrating-with-posthog-ai` — making a product surface work with PostHog AI: injecting scene context or custom instructions, reacting to the agent's tool calls, or rendering your product's tool cards in a thread
- `/sending-notifications` — adding notification support
- `/writing-skills` — creating or updating skills in `.agents/skills/`
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeSupportTickets.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeSupportTickets.tsx
index ae6028690920..80f61505de8f 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeSupportTickets.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeSupportTickets.tsx
@@ -4,7 +4,7 @@ import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { teamLogic } from 'scenes/teamLogic'
-import { ConversationsDisabledBanner } from 'products/conversations/frontend/components/ConversationsDisabledBanner'
+import { ConversationsDisabledBanner } from 'products/conversations/frontend/components/ConversationsDisabledBanner/ConversationsDisabledBanner'
import {
SupportTicketsTable,
SupportTicketsTableFilters,
diff --git a/products/conversations/frontend/activityDescriber.test.tsx b/products/conversations/frontend/activityDescriber.test.tsx
index 1fda17e49237..0ff83df1d584 100644
--- a/products/conversations/frontend/activityDescriber.test.tsx
+++ b/products/conversations/frontend/activityDescriber.test.tsx
@@ -8,7 +8,7 @@ import { ticketActivityDescriber } from './activityDescriber'
// WorkflowActivityLink resolves the workflow name from workflowsLogic; stub it so the describer
// tests stay pure. Its own name-resolution behavior is covered in WorkflowActivityLink.test.tsx.
-jest.mock('./WorkflowActivityLink', () => ({
+jest.mock('./components/WorkflowActivityLink/WorkflowActivityLink', () => ({
WorkflowActivityLink: ({ id }: { id: string }) => <span>workflow-actor:{id}</span>,
}))
diff --git a/products/conversations/frontend/activityDescriber.tsx b/products/conversations/frontend/activityDescriber.tsx
index abbaedfd26ac..a282cc60b44c 100644
--- a/products/conversations/frontend/activityDescriber.tsx
+++ b/products/conversations/frontend/activityDescriber.tsx
@@ -11,7 +11,7 @@ import { TZLabel } from 'lib/components/TZLabel'
import { Link } from 'lib/lemon-ui/Link'
import { urls } from 'scenes/urls'
-import { WorkflowActivityLink } from './WorkflowActivityLink'
+import { WorkflowActivityLink } from './components/WorkflowActivityLink/WorkflowActivityLink'
const nameOrLinkToTicket = (
ticketNumber: string | undefined,
diff --git a/products/conversations/frontend/components/clearFilterButtonProps.tsx b/products/conversations/frontend/clearFilterButtonProps.tsx
similarity index 100%
rename from products/conversations/frontend/components/clearFilterButtonProps.tsx
rename to products/conversations/frontend/clearFilterButtonProps.tsx
diff --git a/products/conversations/frontend/components/Assignee/AssigneeMultiSelect.tsx b/products/conversations/frontend/components/Assignee/AssigneeMultiSelect.tsx
index a93adbd58c4f..3e8b9e89c3bd 100644
--- a/products/conversations/frontend/components/Assignee/AssigneeMultiSelect.tsx
+++ b/products/conversations/frontend/components/Assignee/AssigneeMultiSelect.tsx
@@ -6,7 +6,7 @@ import { LemonButton, LemonCheckbox, LemonDropdown, LemonInput } from '@posthog/
import { urls } from 'scenes/urls'
-import { clearFilterButtonProps } from '../clearFilterButtonProps'
+import { clearFilterButtonProps } from '../../clearFilterButtonProps'
import { AssigneeIconDisplay, AssigneeLabelDisplay, AssigneeResolver } from './AssigneeDisplay'
import { assigneeSelectLogic } from './assigneeSelectLogic'
import { Assignee, AssigneeFilterEntry, MAX_ASSIGNEE_FILTER_ENTRIES, toTicketAssignee } from './types'
diff --git a/products/conversations/frontend/components/ConversationsDisabledBanner.tsx b/products/conversations/frontend/components/ConversationsDisabledBanner/ConversationsDisabledBanner.tsx
similarity index 100%
rename from products/conversations/frontend/components/ConversationsDisabledBanner.tsx
rename to products/conversations/frontend/components/ConversationsDisabledBanner/ConversationsDisabledBanner.tsx
diff --git a/products/conversations/frontend/components/EmailForwardingAddress.tsx b/products/conversations/frontend/components/EmailForwardingAddress/EmailForwardingAddress.tsx
similarity index 100%
rename from products/conversations/frontend/components/EmailForwardingAddress.tsx
rename to products/conversations/frontend/components/EmailForwardingAddress/EmailForwardingAddress.tsx
diff --git a/products/conversations/frontend/components/SlaDisplay.test.tsx b/products/conversations/frontend/components/SlaDisplay/SlaDisplay.test.tsx
similarity index 100%
rename from products/conversations/frontend/components/SlaDisplay.test.tsx
rename to products/conversations/frontend/components/SlaDisplay/SlaDisplay.test.tsx
diff --git a/products/conversations/frontend/components/SlaDisplay.tsx b/products/conversations/frontend/components/SlaDisplay/SlaDisplay.tsx
similarity index 100%
rename from products/conversations/frontend/components/SlaDisplay.tsx
rename to products/conversations/frontend/components/SlaDisplay/SlaDisplay.tsx
diff --git a/products/conversations/frontend/WorkflowActivityLink.test.tsx b/products/conversations/frontend/components/WorkflowActivityLink/WorkflowActivityLink.test.tsx
similarity index 100%
rename from products/conversations/frontend/WorkflowActivityLink.test.tsx
rename to products/conversations/frontend/components/WorkflowActivityLink/WorkflowActivityLink.test.tsx
diff --git a/products/conversations/frontend/WorkflowActivityLink.tsx b/products/conversations/frontend/components/WorkflowActivityLink/WorkflowActivityLink.tsx
similarity index 100%
rename from products/conversations/frontend/WorkflowActivityLink.tsx
rename to products/conversations/frontend/components/WorkflowActivityLink/WorkflowActivityLink.tsx
diff --git a/products/conversations/frontend/scenes/settings/EmailSection.tsx b/products/conversations/frontend/scenes/settings/EmailSection.tsx
index 0a8b5cd46f39..f49c9b731b59 100644
--- a/products/conversations/frontend/scenes/settings/EmailSection.tsx
+++ b/products/conversations/frontend/scenes/settings/EmailSection.tsx
@@ -10,7 +10,7 @@ import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { SceneSection } from '~/layout/scenes/components/SceneSection'
-import { EmailForwardingAddress } from '../../components/EmailForwardingAddress'
+import { EmailForwardingAddress } from '../../components/EmailForwardingAddress/EmailForwardingAddress'
import { EmailConfigStatus, supportSettingsLogic } from './supportSettingsLogic'
interface DnsRecord {
diff --git a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
index 95ca73a67ddc..f8f61fb6cfea 100644
--- a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
+++ b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
@@ -28,7 +28,7 @@ import { AssigneeIconDisplay, AssigneeLabelDisplay, AssigneeSelect } from '../..
import { ChannelsTag, getChannelThreadUrl } from '../../components/Channels/ChannelsTag'
import { ChatView } from '../../components/Chat/ChatView'
import { IdentityBadge } from '../../components/IdentityBadge/IdentityBadge'
-import { SlaDisplay } from '../../components/SlaDisplay'
+import { SlaDisplay } from '../../components/SlaDisplay/SlaDisplay'
import { TicketTags } from '../../components/TicketTags'
import { type TicketPriority, type TicketStatus, priorityOptions, statusOptionsWithoutAll } from '../../types'
import { AIPanel } from './AIPanel'
diff --git a/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx b/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx
index 2488dd63678a..afbec162043a 100644
--- a/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx
+++ b/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx
@@ -30,8 +30,8 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import { tagsModel } from '~/models/tagsModel'
import { ProductKey } from '~/queries/schema/schema-general'
+import { clearFilterButtonProps } from '../../clearFilterButtonProps'
import { AssigneeMultiSelect } from '../../components/Assignee'
-import { clearFilterButtonProps } from '../../components/clearFilterButtonProps'
import { ComposeTicketButton } from '../../components/ComposeTicket'
import { SavedViewsButton } from '../../components/SavedViews/SavedViewsButton'
import { ScenesTabs } from '../../components/ScenesTabs'
diff --git a/products/conversations/frontend/scenes/tickets/ticketColumns.tsx b/products/conversations/frontend/scenes/tickets/ticketColumns.tsx
index 0b3b500284d7..ad2326ba74a2 100644
--- a/products/conversations/frontend/scenes/tickets/ticketColumns.tsx
+++ b/products/conversations/frontend/scenes/tickets/ticketColumns.tsx
@@ -11,7 +11,7 @@ import { PersonDisplay } from 'scenes/persons/PersonDisplay'
import { AssigneeDisplay, AssigneeResolver } from '../../components/Assignee'
import { ChannelsTag, getChannelThreadUrl } from '../../components/Channels/ChannelsTag'
import { IdentityBadge } from '../../components/IdentityBadge/IdentityBadge'
-import { SlaDisplay } from '../../components/SlaDisplay'
+import { SlaDisplay } from '../../components/SlaDisplay/SlaDisplay'
import { TicketPreviewPopover } from '../../components/TicketPreview/TicketPreviewPopover'
import {
type Ticket,
diff --git a/products/conversations/skills/organizing-conversations-code/SKILL.md b/products/conversations/skills/organizing-conversations-code/SKILL.md
new file mode 100644
index 000000000000..85a7b6df8a79
--- /dev/null
+++ b/products/conversations/skills/organizing-conversations-code/SKILL.md
@@ -0,0 +1,51 @@
+---
+name: organizing-conversations-code
+description: >
+ File layout for the conversations product. Use when adding, moving, renaming, or reviewing
+ files under products/conversations/ — especially frontend components, scenes, helpers, and
+ tests. Conversations React components live in their own folder under
+ products/conversations/frontend/components/, never as loose files in components/ or at the
+ frontend root. Expand this skill as more conversations layout rules land.
+---
+
+# Organizing conversations code
+
+Conversations-specific layout. Repo-wide UI rules still apply — read
+[writing-ui-components](../../../../.agents/skills/writing-ui-components/SKILL.md) for
+one-component-per-file, no barrels, and import sweeps. This skill owns _where in
+conversations_ a file goes.
+
+## Use this skill when
+
+- Creating, moving, or renaming a file under `products/conversations/`
+- Adding a React component, helper, or test to conversations frontend
+- Reviewing a conversations diff that adds files
+
+## Components
+
+Every React component lives in its own folder under `products/conversations/frontend/components/`.
+The file is named after the export.
+
+```text
+products/conversations/frontend/components/<Name>/<Name>.tsx
+products/conversations/frontend/components/<Name>/<Name>.test.tsx # colocated
+```
+
+Import the file, not the folder:
+
+```ts
+import { SlaDisplay } from '../../components/SlaDisplay/SlaDisplay'
+import { SlaDisplay } from 'products/conversations/frontend/components/SlaDisplay/SlaDisplay'
+```
+
+Do not:
+
+- Drop a component as a loose file in `frontend/components/`
+- Put a component at `products/conversations/frontend/` (the product frontend root)
+- Add an `index.ts` barrel so callers can import the folder
+
+A helper that returns props or data — not markup — is not a component. Keep it next to the
+feature or at `products/conversations/frontend/<name>.ts(x)` (see `clearFilterButtonProps.tsx`).
+
+When you move a component, `git mv`, point every consumer at the new path, and delete the old
+one. No re-export shim.
diff --git a/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx b/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx
index caa2d4342f29..c0bdb0b5ccac 100644
--- a/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx
+++ b/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx
@@ -4,7 +4,7 @@ import { LemonButton } from '@posthog/lemon-ui'
import { cn } from 'lib/utils/css-classes'
-import { SupportActivationButton } from 'products/conversations/frontend/components/ConversationsDisabledBanner'
+import { SupportActivationButton } from 'products/conversations/frontend/components/ConversationsDisabledBanner/ConversationsDisabledBanner'
import type { WidgetAvailabilityConfig } from '../../widget_types/widgetAvailability'
import { WIDGET_AVAILABILITY_PRESENTATION } from '../../widget_types/widgetAvailability'
diff --git a/products/dashboards/frontend/widgets/conversations/ConversationsWidgetTileFilters.tsx b/products/dashboards/frontend/widgets/conversations/ConversationsWidgetTileFilters.tsx
index 8ed9c4e3f392..3acf221f4aae 100644
--- a/products/dashboards/frontend/widgets/conversations/ConversationsWidgetTileFilters.tsx
+++ b/products/dashboards/frontend/widgets/conversations/ConversationsWidgetTileFilters.tsx
@@ -6,8 +6,8 @@ import { LemonDropdown } from 'lib/lemon-ui/LemonDropdown'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect'
import { teamLogic } from 'scenes/teamLogic'
+import { clearFilterButtonProps } from 'products/conversations/frontend/clearFilterButtonProps'
import { AssigneeMultiSelect, type AssigneeFilterEntry } from 'products/conversations/frontend/components/Assignee'
-import { clearFilterButtonProps } from 'products/conversations/frontend/components/clearFilterButtonProps'
import { priorityMultiselectOptions, statusOptions } from 'products/conversations/frontend/types'
import type { DashboardWidgetTileFiltersProps } from '../registry'
diff --git a/products/dashboards/frontend/widgets/conversations/conversationsWidgetUtils.tsx b/products/dashboards/frontend/widgets/conversations/conversationsWidgetUtils.tsx
index 540447b13736..42f31e47d17d 100644
--- a/products/dashboards/frontend/widgets/conversations/conversationsWidgetUtils.tsx
+++ b/products/dashboards/frontend/widgets/conversations/conversationsWidgetUtils.tsx
@@ -4,7 +4,7 @@ import { Tooltip } from '@posthog/lemon-ui'
import { dayjs } from 'lib/dayjs'
import type { TicketAssignee } from 'products/conversations/frontend/components/Assignee'
-import { getSlaState } from 'products/conversations/frontend/components/SlaDisplay'
+import { getSlaState } from 'products/conversations/frontend/components/SlaDisplay/SlaDisplay'
import type { TicketChannel } from 'products/conversations/frontend/types'
export type ConversationsWidgetTicket = {