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.

feat(links): remove the links product (#109618)

Paul D'Ambra3090d2de3d58
diff --git a/.semgrep/rules/devex/prefer-codegen-api-namespaced.yaml b/.semgrep/rules/devex/prefer-codegen-api-namespaced.yaml
index 757025b043e3..31c9a53d0b16 100644
--- a/.semgrep/rules/devex/prefer-codegen-api-namespaced.yaml
+++ b/.semgrep/rules/devex/prefer-codegen-api-namespaced.yaml
@@ -764,40 +764,6 @@ rules:
- '**/__mocks__/**'
- '**/mocks/**'
- - id: prefer-codegen-api-namespaced-links
- message: >-
- Manual `api.<namespace>.<method>(...)` call on a links namespace. The namespace
- builds its URL in `frontend/src/lib/api.ts`, and this product's generated client
- already covers that URL. Use `products/links/frontend/generated/api.ts`.
-
- Informational while the backlog is worked down, but a call this pull request adds
- fails the job. `hogli product:maturity --codegen links` lists the call sites.
-
- Agents: invoke the `adopting-generated-api-types` skill
- (`.agents/skills/adopting-generated-api-types/SKILL.md`) for the migration
- workflow.
-
- If no generated equivalent is available yet (endpoint missing OpenAPI tags,
- dynamic URL, etc.), add `// nosemgrep: prefer-codegen-api-namespaced-links`
- above this line - the maturity tooling continues to track tagged sites.
- severity: WARNING
- languages: [typescript, javascript]
- pattern-either:
- - pattern: api.links.$METHOD(...)
- - pattern: api.links.$MEMBER.$METHOD(...)
- paths:
- include:
- - '/products/links/frontend/'
- - '/frontend/src/'
- exclude:
- - '/frontend/src/lib/api.ts'
- - '**/generated/**'
- - '**/*.test.ts'
- - '**/*.test.tsx'
- - '**/*.stories.tsx'
- - '**/__mocks__/**'
- - '**/mocks/**'
-
- id: prefer-codegen-api-namespaced-logs
message: >-
Manual `api.<namespace>.<method>(...)` call on a logs namespace. The namespace
diff --git a/common/storybook/storybook-timings.json b/common/storybook/storybook-timings.json
index 45c01f325ab8..d07e08150507 100644
--- a/common/storybook/storybook-timings.json
+++ b/common/storybook/storybook-timings.json
@@ -1691,10 +1691,6 @@
"chromium": 35.165,
"webkit": 7.171
},
- "products/links/frontend/LinksScene.stories.tsx": {
- "chromium": 15.063,
- "webkit": 2.919
- },
"products/logs/frontend/LogsScene.stories.tsx": {
"chromium": 1.794,
"webkit": 1.145
diff --git a/frontend/package.json b/frontend/package.json
index 971754b61987..3a7f896c250f 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -118,7 +118,6 @@
"@posthog/products-groups": "workspace:*",
"@posthog/products-growth": "workspace:*",
"@posthog/products-legal-documents": "workspace:*",
- "@posthog/products-links": "workspace:*",
"@posthog/products-live-debugger": "workspace:*",
"@posthog/products-logs": "workspace:*",
"@posthog/products-managed-migrations": "workspace:*",
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index fe62e609c47b..08129705bd48 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2204,10 +2204,6 @@ snapshots:
hash: v1.k794b7964.1a7835b12a48c2b04c7a3bb1731c2582b45ec28a3042827ad9ff7fcee708e44c.1jIs0ZfSBza47nPWDk_DLIkvW9tlcFpvEonyVU_5FVs
components-product-empty-state--hog-layout-responsive-with-main-content-container-queries--light:
hash: v1.k794b7964.21032c000615555ecc02b4546fc2425c677f06c451b6b8d10307c4ec89faf6a0.1ZPt3gD7fOiCI28QnBWuHfoBz6EhHsDtdHBWv04lQMg
- components-product-empty-state--links-needs-setup--dark:
- hash: v1.k794b7964.8aa4e78c2d391e5ff0e41f7572ce783b831fc77f2f2a4e225f19c15ff4177b06.v5Wc6LWOLnbCMYl-dJv14jNVWhwPoyKfEAstg5vtC_4
- components-product-empty-state--links-needs-setup--light:
- hash: v1.k794b7964.e116bb54c7dd63ae6a935c348fed6f953f772a82206318d068707168f104add1.XtBQZyftHzjEwpZGccncDuCsRVGeGNaefqvGCg4xkFw
components-product-empty-state--llm-prompts-needs-setup--dark:
hash: v1.k794b7964.fdd99f387e7d5885faca819190788b78c604be9c25d72a234daac5782d00eb73.YY1FKMtEKT0kYnSd-BFzETTo38_Iz3420mOMtMSpzWc
components-product-empty-state--llm-prompts-needs-setup--light:
@@ -11530,18 +11526,6 @@ snapshots:
hash: v1.k794b7964.31a0028b1aec249c62bb2bfc14beded76ca5bfbfad2ebf33e8dcb302bb332289.Yi35_tk8BHxZcfmaIQ_nFCeXLD_gpOjWoVnastrSEvU
scenes-app-legal-documents--new-dpat-swift--light:
hash: v1.k794b7964.b7c73c4840b856b3234c0ccce705bf416a3cb1803296292a87aa4d0d1b679fa4.yVj5IsVOj8me-_oYo-HI_snNNqPIIBySKRd042e2R0U
- scenes-app-links--link-details--dark:
- hash: v1.k794b7964.204adf8c964225ca620bf31c7997e7ab56c3bb04ba9387eb66a2dcb9aa7698ad.v7vzMtO3hT0RGAfnYShb42OI7dTmCNx-iGzMaKyujLw
- scenes-app-links--link-details--light:
- hash: v1.k794b7964.c9ce37b5e2dc076c6d90da63434172866434b41c8286ab1b0b40a9497f069d4a.gxAEAoRmNhjXadzw9hjXb_OKL-IXrWXmFuRbP8i63Wo
- scenes-app-links--links-list--dark:
- hash: v1.k794b7964.0369ef608850e331cf6742803a02ce1022705eddc4e803201fec600f4640f1c6.mnm1_XmvO9T3vnaV7nKEPyub9jLNKFtW8kxO3Wg3_lo
- scenes-app-links--links-list--light:
- hash: v1.k794b7964.604e49f8f514dd6ba5db94bb18e4d67393660f2a33c15263bf0285bf7e0d6480.j5o4XC_MwRZrtR6nX2gfhs4pp52vAy7GpG0WL7nL5Q8
- scenes-app-links--new-link--dark:
- hash: v1.k794b7964.16253c58cc7e0f11bd32af653724cced02b42de025ce92acb041a2c7ce6a04d4.qu3iiFJrUI2Hiq-59roGNvGTqUInaL-mUS-u6XFYvJ8
- scenes-app-links--new-link--light:
- hash: v1.k794b7964.96b374104c35e53400745ac6a24686d195f42222e24d097dd1363983e6f43e8c.t4_adK3iuY98o2Ro0cnQGdfudgzw5wRasCqIsMs2wUc
scenes-app-llm-observability-categoricalevaluationconfig--default--dark:
hash: v1.k794b7964.5d13f8e4da4472d9afaa7bdaa4684b69e83d718b13ce996057ac181df792afec.QAvBIAMjHaItLYd-Zgj2X088lA-gxJadN8ijiqhGkIo
scenes-app-llm-observability-categoricalevaluationconfig--default--light:
diff --git a/frontend/src/layout/panel-layout/ProjectTree/ProjectTree.stories.tsx b/frontend/src/layout/panel-layout/ProjectTree/ProjectTree.stories.tsx
index 63a5edda0985..8a6cdfee9141 100644
--- a/frontend/src/layout/panel-layout/ProjectTree/ProjectTree.stories.tsx
+++ b/frontend/src/layout/panel-layout/ProjectTree/ProjectTree.stories.tsx
@@ -18,7 +18,6 @@ const meta: Meta<(props: StoryProps) => JSX.Element> = {
featureFlags: [
FEATURE_FLAGS.CUSTOMER_ANALYTICS,
FEATURE_FLAGS.DATA_WAREHOUSE_SCENE,
- FEATURE_FLAGS.LINKS,
FEATURE_FLAGS.LIVE_DEBUGGER,
FEATURE_FLAGS.WEB_ANALYTICS_MARKETING,
FEATURE_FLAGS.PRODUCT_TOURS,
diff --git a/frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx b/frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx
index c884181c6ac7..f2f5984a42c1 100644
--- a/frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx
+++ b/frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx
@@ -22,7 +22,6 @@ import {
IconDocument,
IconDownload,
IconEndpoints,
- IconExternal,
IconEye,
IconFeatures,
IconFilter,
@@ -240,10 +239,6 @@ const iconTypes: Record<FileSystemIconType, { icon: JSX.Element; iconColor?: Fil
icon: <IconDatabase />,
iconColor: ['var(--color-product-data-warehouse-light)', 'var(--color-product-data-warehouse-dark)'],
},
- link: {
- icon: <IconExternal />,
- iconColor: ['var(--color-product-links-light)', 'var(--color-product-links-dark)'],
- },
workflows: {
icon: <IconDecisionTree />,
iconColor: ['var(--color-product-workflows-light)', 'var(--color-product-workflows-dark)'],
diff --git a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts
index cf332dc47884..ca69a4455b21 100644
--- a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts
+++ b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts
@@ -92,7 +92,7 @@ describe('navProductsTabLogic', () => {
groupedItems: [],
})
const items = [
- { path: 'Links', category: 'Unreleased', href: '/links' },
+ { path: 'Pulse', category: 'Unreleased', href: '/pulse' },
{ path: 'Web analytics', category: 'Analytics', href: '/web' },
{
path: 'LLM analytics',
@@ -109,7 +109,7 @@ describe('navProductsTabLogic', () => {
['Analytics', ['Web analytics']],
['AI engineering', ['AI gateway', 'AI observability']],
['Monitoring', ['Logs']],
- ['Unreleased', ['Links']],
+ ['Unreleased', ['Pulse']],
])
expect(groupProducts(items, 'observability')[0].items[0].href).toEqual('/ai')
})
diff --git a/frontend/src/layout/panel-layout/sidebarProductMeta.ts b/frontend/src/layout/panel-layout/sidebarProductMeta.ts
index f38db0e8711b..2bf06f8af745 100644
--- a/frontend/src/layout/panel-layout/sidebarProductMeta.ts
+++ b/frontend/src/layout/panel-layout/sidebarProductMeta.ts
@@ -72,7 +72,6 @@ export const SIDEBAR_PRODUCTS_WITHOUT_DOCS = new Set<string>([
'Business knowledge',
'Engineering analytics',
'Identity matching',
- 'Links',
'Live Debugger',
'Product tours',
'Pulse',
@@ -112,7 +111,6 @@ const examples: Record<string, string> = {
Evaluations: 'Check whether AI responses meet your quality criteria.',
'Identity matching': 'Review how identities connect across your data.',
Inbox: 'Review a report about friction discovered in user sessions.',
- Links: 'Create a trackable link for a new campaign.',
'Live Debugger': 'Inspect the state of running code when a breakpoint fires.',
Logs: 'Search application logs around the time an error occurred.',
'MCP analytics': 'See which tools AI users call and what they are trying to achieve.',
diff --git a/frontend/src/lib/api-ratchet-baseline.txt b/frontend/src/lib/api-ratchet-baseline.txt
index db9a1613410b..225329ecdbf8 100644
--- a/frontend/src/lib/api-ratchet-baseline.txt
+++ b/frontend/src/lib/api-ratchet-baseline.txt
@@ -175,8 +175,6 @@ integrationTwilioPhoneNumbers projects/{}/integrations/{}/twilio_phone_numbers
integrations projects/{}/integrations
integrationsDomainConnectApplyUrl projects/{}/integrations/domain-connect/apply-url
integrationsDomainConnectCheck projects/{}/integrations/domain-connect/check
-link projects/{}/links/{}
-links projects/{}/links
logsExplainWithAI projects/{}/logs/explainLogWithAI
logsExport projects/{}/logs/export
logsHasLogs projects/{}/logs/has_logs
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index 362a0f010bd6..9897e343b470 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -27,7 +27,7 @@ import { SchemaPropertyGroup } from 'scenes/data-management/schema/schemaManagem
import { MaxBillingContext } from 'scenes/max/maxBillingContextLogic'
import { NotebookListItemType, NotebookNodeResource, NotebookType } from 'scenes/notebooks/types'
import { RecordingComment } from 'scenes/session-recordings/player/inspector/playerInspectorLogic'
-import { LINK_PAGE_SIZE, SURVEY_PAGE_SIZE } from 'scenes/surveys/constants'
+import { SURVEY_PAGE_SIZE } from 'scenes/surveys/constants'
import { getCurrentExporterData, isSharedView } from '~/exporter/exporterViewLogic'
import { OrganizationOAuthApplicationApi, ProjectSecretAPIKeyApi } from '~/generated/core/api.schemas'
@@ -148,7 +148,6 @@ import {
IntegrationType,
JiraProjectType,
LinearTeamType,
- LinkType,
LinkedInAdsAccountType,
LinkedInAdsConversionRuleType,
ListOrganizationMembersParams,
@@ -733,15 +732,6 @@ export class ApiRequest {
return this.hogFunctionTemplates(teamId).addPathComponent(id)
}
- // # Links
- public links(teamId?: TeamType['id']): ApiRequest {
- return this.projectsDetail(teamId).addPathComponent('links')
- }
-
- public link(id: LinkType['id'], teamId?: TeamType['id']): ApiRequest {
- return this.links(teamId).addPathComponent(id)
- }
-
// # Actions
public actions(teamId?: TeamType['id']): ApiRequest {
return this.projectsDetail(teamId).addPathComponent('actions')
@@ -4009,32 +3999,6 @@ const api = {
},
},
- links: {
- async list(
- args: {
- limit?: number
- offset?: number
- search?: string
- } = {
- limit: LINK_PAGE_SIZE,
- }
- ): Promise<CountedPaginatedResponse<LinkType>> {
- return await new ApiRequest().links().withQueryString(args).get()
- },
- async get(id: LinkType['id']): Promise<LinkType> {
- return await new ApiRequest().link(id).get()
- },
- async create(data: Partial<LinkType>): Promise<LinkType> {
- return await new ApiRequest().links().create({ data })
- },
- async update(id: LinkType['id'], data: Partial<LinkType>): Promise<LinkType> {
- return await new ApiRequest().link(id).update({ data })
- },
- async delete(id: LinkType['id']): Promise<void> {
- await new ApiRequest().link(id).delete()
- },
- },
-
annotations: {
async get(annotationId: RawAnnotationType['id']): Promise<RawAnnotationType> {
return await new ApiRequest().annotation(annotationId).get()
diff --git a/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx b/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx
index db499dee0ab2..38e94c387a03 100644
--- a/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx
+++ b/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx
@@ -30,7 +30,6 @@ import { engineeringAnalyticsEmptyState } from 'products/engineering_analytics/f
import { errorTrackingEmptyState } from 'products/error_tracking/frontend/emptyState/errorTrackingEmptyState'
import { experimentsEmptyState } from 'products/experiments/frontend/emptyState/experimentsEmptyState'
import { featureFlagsEmptyState } from 'products/feature_flags/frontend/emptyState/featureFlagsEmptyState'
-import { linksEmptyState } from 'products/links/frontend/emptyState/linksEmptyState'
import { logsEmptyState } from 'products/logs/frontend/emptyState/logsEmptyState'
import { marketingAnalyticsEmptyState } from 'products/marketing_analytics/frontend/emptyState/marketingAnalyticsEmptyState'
import { mcpAnalyticsEmptyState } from 'products/mcp_analytics/frontend/emptyState/mcpAnalyticsEmptyState'
@@ -188,10 +187,6 @@ export const EndpointsNeedsSetup: ProductEmptyStateStory = productEmptyStateStor
mocks: { get: { '/api/projects/:team_id/endpoints/': [200, emptyEntityList] } },
})
-export const LinksNeedsSetup: ProductEmptyStateStory = productEmptyStateStory(linksEmptyState, 'needs-setup', {
- mocks: { get: { '/api/projects/:team_id/links/': [200, emptyEntityList] } },
-})
-
export const ProductToursNeedsSetup: ProductEmptyStateStory = productEmptyStateStory(
productToursEmptyState,
'needs-setup',
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 093d3a80274e..5391d5e0a079 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -371,7 +371,6 @@ export const FEATURE_FLAGS = {
INSIGHT_SUBSCRIBE_PROMINENT_BUTTON: 'insight-subscribe-prominent-button', // owner: @mattp #team-analytics-platform multivariate=control,test
JS_SNIPPET_VERSIONING: 'js-snippet-versioning', // owner: #team-client-libraries
LEGACY_OAUTH_RECONNECT_WARNING: 'legacy-oauth-reconnect-warning', // owner: @jabahamondes #team-web-analytics — kill-switch for the retiring-OAuth-app reconnect banner
- LINKS: 'links', // owner: @marconlp #team-link (team doesn't exist for now, maybe will come back in the future)
LIVE_DEBUGGER: 'live-debugger', // owner: @marcecoll
LIVE_EVENTS_RICH_FILTERS: 'live-events-rich-filters', // owner: @jordanm-posthog #team-web-analytics
LIVESTREAM_HOGQL: 'livestream-hogql', // owner: @benjackwhite #team-replay, swaps livestream service calls for HogQL queries
diff --git a/frontend/src/productScenes.tsx b/frontend/src/productScenes.tsx
index c0daab427edd..52ae3ee61aeb 100644
--- a/frontend/src/productScenes.tsx
+++ b/frontend/src/productScenes.tsx
@@ -126,8 +126,6 @@ export const productScenes: Record<string, () => Promise<any>> = {
AIEnrichment: () => import('../../products/growth/frontend/aiEnrichment/AIEnrichmentScene'),
LegalDocuments: () => import('../../products/legal_documents/frontend/scenes/LegalDocumentsScene'),
LegalDocumentNew: () => import('../../products/legal_documents/frontend/scenes/LegalDocumentNewScene'),
- Links: () => import('../../products/links/frontend/LinksScene'),
- Link: () => import('../../products/links/frontend/LinkScene'),
LiveDebugger: () => import('../../products/live_debugger/frontend/LiveDebugger'),
Logs: () => import('../../products/logs/frontend/LogsScene'),
LogsAlertDetail: () => import('../../products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene'),
diff --git a/frontend/src/products.json b/frontend/src/products.json
index d6a7cfe5d81d..30393b066e90 100644
--- a/frontend/src/products.json
+++ b/frontend/src/products.json
@@ -169,7 +169,6 @@
"intents": ["marketing_analytics"]
},
{ "path": "Inbox", "category": "Tools", "iconType": null, "type": null, "intents": [] },
- { "path": "Links", "category": "Unreleased", "iconType": null, "type": "link", "intents": ["links"] },
{
"path": "Live Debugger",
"category": "Unreleased",
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index 5971f7ef418b..a84154bf60b8 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -210,8 +210,6 @@ export const productRoutes: Record<string, [string, string]> = {
'/ai-enrichment/:label': ['AIEnrichment', 'aiEnrichment'],
'/legal': ['LegalDocuments', 'legalDocuments'],
'/legal/new/:type': ['LegalDocumentNew', 'legalDocumentNew'],
- '/links': ['Links', 'links'],
- '/link/:id': ['Link', 'link'],
'/live-debugger': ['LiveDebugger', 'liveDebugger'],
'/logs': ['Logs', 'logs'],
'/logs/alerts/:id': ['LogsAlertDetail', 'logsAlertDetail'],
@@ -895,14 +893,6 @@ export const productConfiguration: Record<string, any> = {
description: 'Generate a Business Associate Agreement or Data Processing Agreement for your organization.',
},
LegalDocumentNew: { name: 'New legal document', organizationBased: true, activityScope: 'LegalDocument' },
- Links: {
- name: 'Links',
- projectBased: true,
- activityScope: 'Link',
- description: 'Start creating links for your marketing campaigns, referral programs, and more.',
- iconType: 'link',
- },
- Link: { name: 'Link', projectBased: true, activityScope: 'Link' },
LiveDebugger: {
name: 'Live debugger',
projectBased: true,
@@ -1563,8 +1553,6 @@ export const productUrls = {
aiEnrichment: (label?: string): string => `/ai-enrichment${label ? `/${encodeURIComponent(label)}` : ''}`,
legalDocuments: (): string => '/legal',
legalDocumentNew: (type: 'BAA' | 'DPA'): string => `/legal/new/${type.toLowerCase()}`,
- links: (): string => '/links',
- link: (id: string): string => `/link/${id}`,
liveDebugger: (): string => '/live-debugger',
logs: (): string => '/logs',
logsAlertDetail: (id: string, tab?: string): string =>
@@ -1869,14 +1857,6 @@ export const fileSystemTypes = {
iconColor: ['var(--color-product-product-analytics-light)'],
filterKey: 'insight',
},
- link: {
- name: 'Link',
- iconType: 'link' as FileSystemIconType,
- href: (ref: string) => urls.link(ref),
- iconColor: ['var(--color-product-links-light)', 'var(--color-product-links-dark)'],
- filterKey: 'link',
- flag: FEATURE_FLAGS.LINKS,
- },
live_debugger: {
name: 'Live Debugger',
iconType: 'live_debugger',
@@ -2086,14 +2066,6 @@ export const getTreeItemsNew = (): FileSystemImport[] => [
visualOrder: INSIGHT_VISUAL_ORDER.paths,
sceneKeys: ['Insight'],
},
- {
- path: `Link`,
- type: 'link',
- href: urls.link('new'),
- iconType: 'link' as FileSystemIconType,
- iconColor: ['var(--color-product-links-light)', 'var(--color-product-links-dark)'] as FileSystemIconColor,
- flag: FEATURE_FLAGS.LINKS,
- },
{ path: `Notebook`, type: 'notebook', href: urls.notebook('new'), iconType: 'notebook' },
{
path: `Product tour`,
@@ -2140,7 +2112,6 @@ export type ProductTreePath =
| 'Heatmaps'
| 'Identity matching'
| 'Inbox'
- | 'Links'
| 'Live Debugger'
| 'LLM analytics'
| 'Logs'
@@ -2586,17 +2557,6 @@ export const getTreeItemsProducts = (): FileSystemImport[] => [
'AIObservabilityCluster',
],
},
- {
- path: 'Links',
- intents: [ProductKey.LINKS],
- category: ProductItemCategory.UNRELEASED,
- type: 'link',
- href: urls.links(),
- flag: FEATURE_FLAGS.LINKS,
- tags: ['alpha'],
- sceneKey: 'Links',
- sceneKeys: ['Links', 'Link'],
- },
{
path: 'Live Debugger',
displayLabel: 'Live debugger',
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 7323ff53a6fd..ad1ee5d27f2f 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -27099,7 +27099,6 @@
"data_pipeline_metadata",
"data_warehouse",
"task",
- "link",
"live_debugger",
"logs",
"tracing",
@@ -40566,7 +40565,6 @@
"history",
"ingestion_warnings",
"integrations",
- "links",
"live_debugger",
"llm_clusters",
"llm_datasets",
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index 30152b5f7e7f..ff222b5f8fdd 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -5434,7 +5434,6 @@ export type FileSystemIconType =
| 'data_pipeline_metadata'
| 'data_warehouse'
| 'task'
- | 'link'
| 'live_debugger'
| 'logs'
| 'tracing'
@@ -9068,7 +9067,6 @@ export enum ProductKey {
HISTORY = 'history',
INGESTION_WARNINGS = 'ingestion_warnings',
INTEGRATIONS = 'integrations',
- LINKS = 'links',
LIVE_DEBUGGER = 'live_debugger',
LLM_CLUSTERS = 'llm_clusters',
LLM_DATASETS = 'llm_datasets',
diff --git a/frontend/src/scenes/sceneTypes.ts b/frontend/src/scenes/sceneTypes.ts
index 404ad4b5905e..36996d9df244 100644
--- a/frontend/src/scenes/sceneTypes.ts
+++ b/frontend/src/scenes/sceneTypes.ts
@@ -107,8 +107,6 @@ export enum Scene {
Views = 'Views',
ViewsNew = 'ViewsNew',
Tools = 'Tools',
- Link = 'Link',
- Links = 'Links',
LiveDebugger = 'LiveDebugger',
Activity = 'Activity',
LiveEvents = 'LiveEvents',
diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.ts
index 2ed46805db76..a9767d48c5b8 100644
--- a/frontend/src/scenes/scenes.ts
+++ b/frontend/src/scenes/scenes.ts
@@ -253,8 +253,6 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {
[Scene.InviteSignup]: { allowUnauthenticated: true, layout: 'plain' },
[Scene.LegacyPlugin]: { projectBased: true, name: 'Legacy plugin' },
[Scene.Coupons]: { name: 'Coupons', organizationBased: true, layout: 'app-container' },
- [Scene.Link]: { projectBased: true },
- [Scene.Links]: { projectBased: true, name: 'Links' },
[Scene.LiveEvents]: {
projectBased: true,
name: 'Live events',
@@ -927,8 +925,6 @@ export const routes: Record<string, [Scene | string, string]> = {
[urls.moveToPostHogCloud()]: [Scene.MoveToPostHogCloud, 'moveToPostHogCloud'],
[urls.advancedActivityLogs()]: [Scene.AdvancedActivityLogs, 'advancedActivityLogs'],
[urls.liveDebugger()]: [Scene.LiveDebugger, 'liveDebugger'],
- [urls.links()]: [Scene.Links, 'links'],
- [urls.link(':id')]: [Scene.Link, 'link'],
[urls.sessionAttributionExplorer()]: [Scene.SessionAttributionExplorer, 'sessionAttributionExplorer'],
[urls.coupons(':campaign')]: [Scene.Coupons, 'coupons'],
[urls.health()]: [Scene.Health, 'health'],
diff --git a/frontend/src/scenes/surveys/constants.tsx b/frontend/src/scenes/surveys/constants.tsx
index b1155f7cd11e..a55b2559286f 100644
--- a/frontend/src/scenes/surveys/constants.tsx
+++ b/frontend/src/scenes/surveys/constants.tsx
@@ -21,8 +21,6 @@ import { QuickSurveyContext, QuickSurveyType } from './quick-create/types'
export const SURVEY_PAGE_SIZE = 100
-export const LINK_PAGE_SIZE = 100
-
// Max recurring-survey iterations. Mirrors MAX_ITERATION_COUNT in products/surveys/backend/models.py,
// which caps the generated iteration windows (and the API enforces the same limit).
export const MAX_ITERATION_COUNT = 500
diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts
index 96475b303a16..2fad8f08746c 100644
--- a/frontend/src/scenes/urls.ts
+++ b/frontend/src/scenes/urls.ts
@@ -317,9 +317,6 @@ export const urls = {
projectFiles: (folder = ''): string => combineUrl('/files', folder ? { folder } : {}).url,
moveToPostHogCloud: (): string => '/move-to-cloud',
- links: (params?: string): string =>
- `/links${params ? `?${params.startsWith('?') ? params.slice(1) : params}` : ''}`,
- link: (id: string): string => `/link/${id}`,
tracing: (): string => '/tracing',
metrics: (): string => '/metrics',
sessionAttributionExplorer: (): string => '/web/session-attribution-explorer',
diff --git a/frontend/src/styles/base.scss b/frontend/src/styles/base.scss
index 26747dafc880..88a33aae76b9 100644
--- a/frontend/src/styles/base.scss
+++ b/frontend/src/styles/base.scss
@@ -356,8 +356,6 @@
--color-product-ai-gateway-dark: rgb(129 140 248);
--color-product-mcp-analytics-light: rgb(150 76 229);
--color-product-mcp-analytics-dark: rgb(181 124 249);
- --color-product-links-light: rgb(143 7 255);
- --color-product-links-dark: rgb(178 92 255);
--color-product-notebooks-light: rgb(239 68 68);
--color-product-notebooks-dark: rgb(252 165 165);
--color-product-tracing-light: rgb(6 182 212);
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 031ae468a333..49e39a7c86fb 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -7888,19 +7888,6 @@ export interface EmailSenderDomainStatus {
)[]
}
-// Representation of a `Link` model in our backend
-export type LinkType = {
- id: string
- redirect_url: string
- short_link_domain: string
- short_code: string
- description?: string
- created_by: UserBasicType
- created_at: string
- updated_at: string
- _create_in_folder?: string | null
-}
-
export interface DataWarehouseSourceRowCount {
breakdown_of_rows_by_source: Record<string, number>
billing_available: boolean
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6d589196ca28..1727f57fcaa8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -755,9 +755,6 @@ importers:
'@posthog/products-legal-documents':
specifier: workspace:*
version: link:../products/legal_documents
- '@posthog/products-links':
- specifier: workspace:*
- version: link:../products/links
'@posthog/products-live-debugger':
specifier: workspace:*
version: link:../products/live_debugger
@@ -3822,48 +3819,7 @@ importers:
specifier: 18.3.1
version: 18.3.1
- products/links:
- dependencies:
- '@posthog/brand':
- specifier: 'catalog:'
- version: 0.12.3([email protected])
- '@posthog/icons':
- specifier: 'catalog:'
- '@posthog/quill-charts':
- specifier: workspace:*
- version: link:../../packages/quill/packages/charts
- '@storybook/react':
- specifier: 'catalog:'
- '@types/react':
- specifier: 18.3.27
- version: 18.3.27
- clsx:
- specifier: '*'
- version: 1.2.1
- 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]))
- qrcode.react:
- specifier: ^4.2.0
- version: 4.2.0([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/links: {}
products/live_debugger:
dependencies:
@@ -20693,11 +20649,6 @@ packages:
(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
- resolution: {integrity: sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==}
- peerDependencies:
- react: 18.3.1
-
resolution: {integrity: sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==}
engines: {node: '>=0.6'}
@@ -43032,10 +42983,6 @@ snapshots:
- dependencies:
- react: 18.3.1
-
dependencies:
side-channel: 1.1.0
diff --git a/posthog/api/file_system/file_system.py b/posthog/api/file_system/file_system.py
index c5f60fc33adb..a06b1f1399c7 100644
--- a/posthog/api/file_system/file_system.py
+++ b/posthog/api/file_system/file_system.py
@@ -36,6 +36,7 @@ from posthog.api.shared import UserBasicSerializer
from posthog.api.utils import action
from posthog.decorators import disallow_if_impersonated
from posthog.exceptions import Conflict
+from posthog.models.file_system.constants import RETIRED_FILE_SYSTEM_TYPES
from posthog.models.file_system.file_system import (
DEFAULT_SURFACE,
FileSystem,
@@ -501,6 +502,8 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
def safely_get_queryset(self, queryset: QuerySet) -> QuerySet:
queryset = self._scope_by_project_and_environment(queryset)
+ if self.action in ("list", "retrieve"):
+ queryset = queryset.exclude(type__in=RETIRED_FILE_SYSTEM_TYPES)
depth_param = self.request.query_params.get("depth")
parent_param = self.request.query_params.get("parent")
@@ -706,10 +709,13 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
limit = max(1, min(limit, 1000))
not_type_param = request.query_params.get("not_type")
- exclude_types = [not_type_param] if not_type_param else None
+ # Drop retired types before the view-log limit, or their views take slots that hydration then empties.
+ exclude_types = [*RETIRED_FILE_SYSTEM_TYPES, *([not_type_param] if not_type_param else [])]
search_param = request.query_params.get("search")
- base_queryset = FileSystem.objects.filter(surface_q(self.file_system_surface), team_id=self.team.id)
+ base_queryset = FileSystem.objects.filter(surface_q(self.file_system_surface), team_id=self.team.id).exclude(
+ type__in=RETIRED_FILE_SYSTEM_TYPES
+ )
base_queryset = self._filter_by_access_control(base_queryset)
if search_param:
base_queryset = self._apply_search_to_queryset(
@@ -773,6 +779,10 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
stack.extend(descendants)
continue
+ # A retired row has no backing object to authorize or lock.
+ if current.type in RETIRED_FILE_SYSTEM_TYPES:
+ continue
+
entries_to_check.append(current)
if not entries_to_check:
@@ -863,6 +873,10 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
entry.delete()
return deleted_objects
+ if entry.type in RETIRED_FILE_SYSTEM_TYPES:
+ entry.delete()
+ return deleted_objects
+
if not is_file_system_type_registered(entry.type):
raise serializers.ValidationError({"detail": f"Cannot delete resources with type '{entry.type}'."})
@@ -911,20 +925,28 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
descendants = self._scope_by_project_and_environment(
FileSystem.objects.filter(path__startswith=f"{instance.path}/")
)
+ hidden_descendants = self._filter_by_access_control(
+ descendants.filter(type__in=RETIRED_FILE_SYSTEM_TYPES)
+ )
empty_folder = FileSystem.objects.filter(
pk=instance.pk, team_id=instance.team_id, path=instance.path, type="folder"
- ).filter(~Exists(descendants))
+ ).filter(~Exists(descendants.exclude(type__in=RETIRED_FILE_SYSTEM_TYPES)))
# Keep the emptiness predicate in the DELETE statement. Folders have no dependent rows,
# and the view-log cleanup signal only applies to files, so no collector is needed.
if not empty_folder._raw_delete(empty_folder.db):
raise Conflict("Folder is not empty.", code="directory_not_empty")
+ # The tree hides these rows, so a folder that holds only them looks empty to the user.
+ hidden_descendants.delete()
deleted_objects = []
else:
reaches_backing_object = self._ensure_can_delete(instance)
deleted_objects = self._delete_file_system_entry(instance, reaches_backing_object)
if instance.type == "folder":
- leftovers = self._scope_by_project(FileSystem.objects.filter(path__startswith=f"{original_path}/"))
+ # The tree hides retired rows, so a retired leftover needs no folder to sit in.
+ leftovers = self._scope_by_project(FileSystem.objects.filter(path__startswith=f"{original_path}/")).exclude(
+ type__in=RETIRED_FILE_SYSTEM_TYPES
+ )
first_leftover = leftovers.first()
if first_leftover:
created_by = first_leftover.created_by or instance_created_by or cast(User, self.request.user)
@@ -1126,7 +1148,7 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
return Response({"detail": "Count can only be called on folders"}, status=status.HTTP_400_BAD_REQUEST)
qs = FileSystem.objects.filter(path__startswith=f"{instance.path}/").order_by("depth", "path")
- qs = self._scope_by_project_and_environment(qs)
+ qs = self._scope_by_project_and_environment(qs).exclude(type__in=RETIRED_FILE_SYSTEM_TYPES)
qs = self._filter_by_access_control(qs)
total_count = qs.count()
@@ -1185,6 +1207,7 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
user_id=request.user.id,
surface=self.file_system_surface,
type=validated.get("type") or None,
+ exclude_types=RETIRED_FILE_SYSTEM_TYPES,
limit=validated.get("limit"),
)
@@ -1198,7 +1221,7 @@ class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
return Response({"detail": "path parameter is required"}, status=status.HTTP_400_BAD_REQUEST)
qs = FileSystem.objects.filter(path__startswith=f"{path_param}/").order_by("depth", "path")
- qs = self._scope_by_project_and_environment(qs)
+ qs = self._scope_by_project_and_environment(qs).exclude(type__in=RETIRED_FILE_SYSTEM_TYPES)
qs = self._filter_by_access_control(qs)
total_count = qs.count()
diff --git a/posthog/api/file_system/file_system_shortcut.py b/posthog/api/file_system/file_system_shortcut.py
index a86fde2ce33d..e576a713dd84 100644
--- a/posthog/api/file_system/file_system_shortcut.py
+++ b/posthog/api/file_system/file_system_shortcut.py
@@ -13,10 +13,16 @@ from rest_framework.response import Response
from posthog.api.file_system.access_levels import FileSystemAccessLevelSerializerMixin
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.models import User
-from posthog.models.file_system.constants import DEFAULT_SURFACE, surface_q
+from posthog.models.file_system.constants import DEFAULT_SURFACE, RETIRED_FILE_SYSTEM_TYPES, surface_q
from posthog.models.file_system.file_system_shortcut import FileSystemShortcut, lock_user_shortcuts
+def reject_retired_type(value: str) -> str:
+ if value in RETIRED_FILE_SYSTEM_TYPES:
+ raise serializers.ValidationError(f"Shortcuts of type '{value}' can no longer be created.")
+ return value
+
+
class FileSystemShortcutSerializer(FileSystemAccessLevelSerializerMixin, serializers.ModelSerializer):
class Meta:
model = FileSystemShortcut
@@ -45,6 +51,9 @@ class FileSystemShortcutSerializer(FileSystemAccessLevelSerializerMixin, seriali
"order": {"help_text": "Display order within the user's shortcut list, ascending."},
}
+ def validate_type(self, value: str) -> str:
+ return reject_retired_type(value)
+
def update(self, instance: FileSystemShortcut, validated_data: dict[str, Any]) -> FileSystemShortcut:
instance.team_id = self.context["team_id"]
instance.user = self.context["request"].user
@@ -105,6 +114,9 @@ class FileSystemShortcutBulkItemSerializer(serializers.Serializer):
help_text="Destination URL the shortcut opens. Null when the shortcut points at an item by ref.",
)
+ def validate_type(self, value: str) -> str:
+ return reject_retired_type(value)
+
class FileSystemShortcutBulkUpdateSerializer(serializers.Serializer):
add = serializers.ListField(
@@ -152,6 +164,9 @@ class FileSystemShortcutViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
def safely_get_queryset(self, queryset: QuerySet) -> QuerySet:
queryset = self._scope_by_project_and_environment(queryset).filter(user=self.request.user)
+ # Destroy keeps retired rows, so that a user can still remove a shortcut that no other action returns.
+ if self.action != "destroy":
+ queryset = queryset.exclude(type__in=RETIRED_FILE_SYSTEM_TYPES)
ordering_param = self.request.GET.get("ordering", "")
if ordering_param == "-created_at":
return queryset.order_by("-created_at")
diff --git a/posthog/api/file_system/registrations.py b/posthog/api/file_system/registrations.py
index 7352cdd1fe4d..736d59d7ef85 100644
--- a/posthog/api/file_system/registrations.py
+++ b/posthog/api/file_system/registrations.py
@@ -151,17 +151,6 @@ def _insight_post_restore(context: RestoreContext, insight: Any) -> None:
)
-def _link_post_delete(context: DeletionContext, link: Any) -> None:
- ref = context.entry.ref
- link_name = getattr(link, "short_code", None) or getattr(link, "redirect_url", None) or ref
- _log_deletion_activity(
- context,
- scope="Link",
- item_id=ref,
- name=link_name,
- )
-
-
def _playlist_post_restore(context: RestoreContext, playlist: Any) -> None:
# Deferred: session_recording_playlist_api pulls session_recording_api -> the session_summary
# temporal workflow (-> google-genai). This module is imported from AppConfig.ready(), so a
@@ -401,15 +390,6 @@ def register_core_file_system_types() -> None:
register_post_delete_hook("insight", _insight_post_delete)
register_post_restore_hook("insight", _insight_post_restore)
- register_file_system_type(
- "link",
- "links",
- "Link",
- allow_restore=False,
- undo_message="Create a new link with the same details.",
- )
- register_post_delete_hook("link", _link_post_delete)
-
register_file_system_type(
"session_recording_playlist",
"posthog",
diff --git a/posthog/api/file_system/test/test_file_system.py b/posthog/api/file_system/test/test_file_system.py
index 26c82cdfbeb7..df9e13eaff80 100644
--- a/posthog/api/file_system/test/test_file_system.py
+++ b/posthog/api/file_system/test/test_file_system.py
@@ -39,7 +39,6 @@ from products.dashboards.backend.models.dashboard import Dashboard
from products.early_access_features.backend.models import EarlyAccessFeature
from products.experiments.backend.models.experiment import Experiment
from products.feature_flags.backend.models.feature_flag import FeatureFlag
-from products.links.backend.models import Link
from products.notebooks.backend.models import Notebook
from products.product_analytics.backend.facade.models import Insight
from products.surveys.backend.models import Survey
@@ -293,6 +292,80 @@ class TestFileSystemAPI(APIBaseTest):
self.assertFalse(FileSystem.objects.filter(pk=file1_obj.pk).exists())
self.assertFalse(FileSystem.objects.filter(pk=file2_obj.pk).exists())
+ def _create_retired_row_in_folder(self) -> tuple[FileSystem, FileSystem]:
+ folder = FileSystem.objects.create(team=self.team, path="Unfiled/Links", type="folder", created_by=self.user)
+ retired = FileSystem.objects.create(
+ team=self.team,
+ path="Unfiled/Links/abc123",
+ type="link",
+ ref="0190a1b2-0000-7000-8000-000000000001",
+ href="/link/abc123",
+ created_by=self.user,
+ )
+ return folder, retired
+
+ @parameterized.expand(
+ [
+ ("file", False, ""),
+ ("parent_folder", True, ""),
+ ("parent_folder_without_cascading", True, "?recursive=false"),
+ ]
+ )
+ def test_delete_row_of_retired_type(self, _name: str, delete_parent: bool, query: str) -> None:
+ folder, retired = self._create_retired_row_in_folder()
+
+ target = folder if delete_parent else retired
+ response = self.client.delete(f"/api/projects/{self.team.id}/file_system/{target.pk}/{query}")
+
+ self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT, response.content)
+ self.assertFalse(FileSystem.objects.filter(pk=retired.pk).exists())
+ self.assertEqual(FileSystem.objects.filter(pk=folder.pk).exists(), not delete_parent)
+
+ def test_rows_of_retired_type_are_hidden_from_the_tree(self) -> None:
+ folder, retired = self._create_retired_row_in_folder()
+ base = f"/api/projects/{self.team.id}/file_system"
+
+ listed = self.client.get(f"{base}/?parent=Unfiled/Links").json()
+ searched = self.client.get(f"{base}/?search=abc123").json()
+ counted = self.client.post(f"{base}/{folder.pk}/count/").json()
+ retrieved = self.client.get(f"{base}/{retired.pk}/")
+
+ self.assertEqual([listed["results"], searched["results"], counted["count"]], [[], [], 0])
+ self.assertEqual(retrieved.status_code, status.HTTP_404_NOT_FOUND)
+
+ def test_recents_skip_views_of_retired_types(self) -> None:
+ _folder, retired = self._create_retired_row_in_folder()
+ dashboard = Dashboard.objects.create(team=self.team, name="Viewed earlier", created_by=self.user)
+ entry = FileSystem.objects.create(
+ team=self.team, path="Viewed earlier", type="dashboard", ref=str(dashboard.id), created_by=self.user
+ )
+ base = f"/api/projects/{self.team.id}/file_system"
+ self.client.post(
+ f"{base}/log_view/", {"type": "dashboard", "ref": entry.ref, "viewed_at": "2026-09-01T00:00:00Z"}
+ )
+ self.client.post(f"{base}/log_view/", {"type": "link", "ref": retired.ref, "viewed_at": "2026-09-02T00:00:00Z"})
+
+ recents = self.client.get(f"{base}/?order_by=-last_viewed_at&limit=1").json()
+
+ self.assertEqual([item["id"] for item in recents["results"]], [str(entry.id)])
+
+ def test_log_view_list_skips_views_of_retired_types(self) -> None:
+ _folder, retired = self._create_retired_row_in_folder()
+ dashboard = Dashboard.objects.create(team=self.team, name="Viewed earlier", created_by=self.user)
+ entry = FileSystem.objects.create(
+ team=self.team, path="Viewed earlier", type="dashboard", ref=str(dashboard.id), created_by=self.user
+ )
+ base = f"/api/projects/{self.team.id}/file_system"
+ self.client.post(
+ f"{base}/log_view/", {"type": "dashboard", "ref": entry.ref, "viewed_at": "2026-09-01T00:00:00Z"}
+ )
+ self.client.post(f"{base}/log_view/", {"type": "link", "ref": retired.ref, "viewed_at": "2026-09-02T00:00:00Z"})
+
+ response = self.client.get(f"{base}/log_view/")
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.content)
+ self.assertEqual([item["ref"] for item in response.json()], [entry.ref])
+
@parameterized.expand([("empty", False), ("child_added_before_delete", True)])
def test_delete_empty_folder_without_cascading(self, _name: str, add_child: bool) -> None:
folder = FileSystem.objects.create(team=self.team, path="Empty", type="folder", created_by=self.user)
@@ -1894,6 +1967,39 @@ class TestFileSystemAPIAdvancedPermissions(APIBaseTest):
dashboard.refresh_from_db()
self.assertFalse(dashboard.deleted)
+ @parameterized.expand(
+ [
+ ("retired_row_without_cascading", "link", "?recursive=false", False),
+ ("retired_row_with_cascading", "link", "", False),
+ ("live_row_with_cascading", "dashboard", "", True),
+ ]
+ )
+ @patch("posthoganalytics.feature_enabled", return_value=True)
+ def test_folder_delete_with_a_row_in_a_denied_environment(
+ self, _name: str, child_type: str, query: str, expect_repaired_folder: bool, mock_flag: MagicMock
+ ):
+ team2 = self._create_sibling_team()
+ membership = OrganizationMembership.objects.get(organization=self.organization, user=self.user)
+ self._create_access_control(
+ resource="project",
+ resource_id=str(team2.id),
+ access_level="none",
+ organization_member=membership,
+ team=team2,
+ )
+ folder = FileSystem.objects.create(team=self.team, path="Shared", type="folder", created_by=self.user)
+ denied_child = FileSystem.objects.create(
+ team=team2, path="Shared/abc123", type=child_type, ref="0190a1b2-0000-7000-8000-000000000002"
+ )
+
+ response = self.client.delete(f"/api/projects/{self.team.id}/file_system/{folder.pk}/{query}")
+
+ self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT, response.content)
+ self.assertTrue(FileSystem.objects.filter(pk=denied_child.pk).exists())
+ self.assertEqual(
+ FileSystem.objects.filter(team=team2, path="Shared", type="folder").exists(), expect_repaired_folder
+ )
+
@patch("posthoganalytics.feature_enabled", return_value=True)
def test_list_queries_do_not_scale_with_environment_count(self, mock_flag):
insight = Insight.objects.create(team=self.team, name="Denied insight", created_by=self.other_user)
@@ -2324,12 +2430,6 @@ class TestDestroyRepairsLeftoverHogFunctions(APIBaseTest):
"supports_restore": True,
"extra_restore_fields": ["enabled"],
},
- {
- "file_type": "link",
- "scope": "Link",
- "factory": self._prepare_link_case,
- "supports_restore": False,
- },
{
"file_type": "early_access_feature",
"scope": "EarlyAccessFeature",
@@ -2547,22 +2647,6 @@ class TestDestroyRepairsLeftoverHogFunctions(APIBaseTest):
"path": fs_entry.path,
}
- def _prepare_link_case(self):
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="hog.gg",
- short_code="abc123",
- created_by=self.user,
- )
- fs_entry = self._ensure_file_system_entry(file_type="link", ref=str(link.id), fallback_name=str(link.id))
- return {
- "fs_entry": fs_entry,
- "item_id": str(link.id),
- "ref": str(link.id),
- "path": fs_entry.path,
- }
-
def _prepare_early_access_feature_case(self):
feature = EarlyAccessFeature.objects.create(
team=self.team,
diff --git a/posthog/api/file_system/test/test_file_system_shortcut.py b/posthog/api/file_system/test/test_file_system_shortcut.py
index 7dc2a916a561..ac8e2de6c7fb 100644
--- a/posthog/api/file_system/test/test_file_system_shortcut.py
+++ b/posthog/api/file_system/test/test_file_system_shortcut.py
@@ -203,6 +203,68 @@ class TestFileSystemShortcutAPI(APIBaseTest):
self.assertEqual(response.json()[0]["id"], str(kept.id))
self.assertFalse(FileSystemShortcut.objects.filter(id=removed.id).exists())
+ def test_reorder_response_excludes_retired_shortcuts(self):
+ retired = FileSystemShortcut.objects.create(
+ team=self.team, path="Old link", type="link", user=self.user, order=0
+ )
+ kept = FileSystemShortcut.objects.create(
+ team=self.team, path="Dashboards", type="dashboard", user=self.user, order=1
+ )
+
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/file_system_shortcut/reorder/",
+ {"ordered_ids": [str(kept.id), str(retired.id)]},
+ format="json",
+ )
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
+ self.assertEqual([row["id"] for row in response.json()], [str(kept.id)])
+
+ def test_bulk_update_response_excludes_retired_shortcuts(self):
+ FileSystemShortcut.objects.create(team=self.team, path="Old link", type="link", user=self.user, order=0)
+
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/file_system_shortcut/bulk_update/",
+ {"add": [{"path": "Dashboards", "type": "dashboard", "href": "/dashboard"}]},
+ format="json",
+ )
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
+ self.assertEqual([row["path"] for row in response.json()], ["Dashboards"])
+
+ @parameterized.expand(
+ [
+ ("retrieve", "get", status.HTTP_404_NOT_FOUND, True),
+ ("update", "patch", status.HTTP_404_NOT_FOUND, True),
+ ("delete", "delete", status.HTTP_204_NO_CONTENT, False),
+ ]
+ )
+ def test_retired_shortcut_is_hidden_except_from_delete(
+ self, _name: str, method: str, expected_status: int, still_exists: bool
+ ) -> None:
+ retired = FileSystemShortcut.objects.create(team=self.team, path="Old link", type="link", user=self.user)
+
+ response = getattr(self.client, method)(
+ f"/api/projects/{self.team.id}/file_system_shortcut/{retired.pk}/", {"path": "Renamed"}, format="json"
+ )
+
+ self.assertEqual(response.status_code, expected_status)
+ self.assertEqual(FileSystemShortcut.objects.filter(pk=retired.pk, path="Old link").exists(), still_exists)
+
+ @parameterized.expand(
+ [
+ ("create", "", {"path": "Old link", "type": "link"}),
+ ("bulk_update", "bulk_update/", {"add": [{"path": "Old link", "type": "link"}]}),
+ ]
+ )
+ def test_rejects_new_shortcut_of_retired_type(self, _name: str, url_suffix: str, body: dict) -> None:
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/file_system_shortcut/{url_suffix}", body, format="json"
+ )
+
+ self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST, response.json())
+ self.assertFalse(FileSystemShortcut.objects.filter(type="link").exists())
+
def test_reorder_rejects_empty_list(self):
response = self.client.post(
f"/api/projects/{self.team.id}/file_system_shortcut/reorder/",
diff --git a/posthog/api/test/test_file_system.py b/posthog/api/test/test_file_system.py
index 4f203dcd777f..32c095fd7b29 100644
--- a/posthog/api/test/test_file_system.py
+++ b/posthog/api/test/test_file_system.py
@@ -31,7 +31,6 @@ from products.dashboards.backend.models.dashboard import Dashboard
from products.early_access_features.backend.models import EarlyAccessFeature
from products.experiments.backend.models.experiment import Experiment
from products.feature_flags.backend.models.feature_flag import FeatureFlag
-from products.links.backend.models import Link
from products.notebooks.backend.models import Notebook
from products.product_analytics.backend.facade.models import Insight
from products.surveys.backend.models import Survey
@@ -223,24 +222,6 @@ FILE_SYSTEM_ACTIVITY_CASES: list[tuple[str, FileSystemActivityCase]] = [
item_id_getter=lambda instance: str(instance.short_id),
),
),
- (
- "link",
- FileSystemActivityCase(
- type_string="link",
- scope="Link",
- create_instance=lambda test: Link.objects.create(
- team=test.team,
- redirect_url="https://posthog.com",
- short_link_domain="hog.gg",
- short_code=f"lnk-{uuid4().hex[:8]}",
- description="File system link",
- created_by=test.user,
- ),
- ref_getter=lambda instance: str(instance.id),
- item_id_getter=lambda instance: str(instance.id),
- supports_restore=False,
- ),
- ),
(
"survey",
FileSystemActivityCase(
diff --git a/posthog/models/file_system/constants.py b/posthog/models/file_system/constants.py
index 697b03a1979e..e0c107ebba90 100644
--- a/posthog/models/file_system/constants.py
+++ b/posthog/models/file_system/constants.py
@@ -4,6 +4,10 @@ from django.db.models import Q
# stored as NULL; they are read as the default ("web"). New rows always store an explicit value.
DEFAULT_SURFACE = "web"
+# Types of retired products. Their rows can stay in the database, but the type has no file system
+# registration and no page to open. The tree hides them, and a delete removes only the row.
+RETIRED_FILE_SYSTEM_TYPES: frozenset[str] = frozenset({"link"})
+
def surface_q(surface: str) -> Q:
"""Build the read filter for a surface. The default surface also matches legacy NULL rows."""
diff --git a/posthog/models/file_system/file_system_view_log.py b/posthog/models/file_system/file_system_view_log.py
index af8c8a6687db..a6348da58266 100644
--- a/posthog/models/file_system/file_system_view_log.py
+++ b/posthog/models/file_system/file_system_view_log.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from collections.abc import Sequence
+from collections.abc import Collection, Sequence
from dataclasses import is_dataclass
from datetime import datetime
from typing import TYPE_CHECKING, Optional, cast
@@ -109,7 +109,7 @@ def recent_view_logs(
user_id: int,
surface: str = DEFAULT_SURFACE,
type: Optional[str] = None,
- exclude_types: Optional[Sequence[str]] = None,
+ exclude_types: Optional[Collection[str]] = None,
limit: Optional[int] = None,
descending: bool = True,
) -> QuerySet[FileSystemViewLog]:
diff --git a/posthog/models/file_system/unfiled_file_saver.py b/posthog/models/file_system/unfiled_file_saver.py
index dc9a281523d1..9023309a4e36 100644
--- a/posthog/models/file_system/unfiled_file_saver.py
+++ b/posthog/models/file_system/unfiled_file_saver.py
@@ -18,7 +18,6 @@ from products.dashboards.backend.models.dashboard import Dashboard
from products.early_access_features.backend.models import EarlyAccessFeature
from products.experiments.backend.models.experiment import Experiment
from products.feature_flags.backend.models.feature_flag import FeatureFlag
-from products.links.backend.models import Link
from products.notebooks.backend.models import Notebook
from products.product_analytics.backend.facade.models import Insight
from products.surveys.backend.models import Survey
@@ -29,7 +28,6 @@ MIXIN_MODELS: dict[str, type[FileSystemSyncMixin]] = {
"experiment": Experiment,
"insight": Insight,
"dashboard": Dashboard,
- "link": Link,
"notebook": Notebook,
"early_access_feature": EarlyAccessFeature,
"session_recording_playlist": SessionRecordingPlaylist,
diff --git a/posthog/schema_enums.py b/posthog/schema_enums.py
index 1f78428da272..563337e395f9 100644
--- a/posthog/schema_enums.py
+++ b/posthog/schema_enums.py
@@ -1393,7 +1393,6 @@ class FileSystemIconType(StrEnum):
DATA_PIPELINE_METADATA = "data_pipeline_metadata"
DATA_WAREHOUSE = "data_warehouse"
TASK = "task"
- LINK = "link"
LIVE_DEBUGGER = "live_debugger"
LOGS = "logs"
TRACING = "tracing"
@@ -2460,7 +2459,6 @@ class ProductKey(StrEnum):
HISTORY = "history"
INGESTION_WARNINGS = "ingestion_warnings"
INTEGRATIONS = "integrations"
- LINKS = "links"
LIVE_DEBUGGER = "live_debugger"
LLM_CLUSTERS = "llm_clusters"
LLM_DATASETS = "llm_datasets"
diff --git a/posthog/scopes.py b/posthog/scopes.py
index daab6abdb1c1..280c5d8433be 100644
--- a/posthog/scopes.py
+++ b/posthog/scopes.py
@@ -81,7 +81,7 @@ APIScopeObject = Literal[
"interactive_run",
"internal_run",
"legal_document",
- "link",
+ "link", # Endpoints are gone; kept advertised until desktop OAuth clients stop requesting it.
"live_debugger",
"llm_analytics",
"ai_observability_clusters",
diff --git a/products/links/backend/admin.py b/products/links/backend/admin.py
deleted file mode 100644
index cc19e1a4e734..000000000000
--- a/products/links/backend/admin.py
+++ /dev/null
@@ -1,46 +0,0 @@
-from django.contrib import admin
-from django.urls import reverse
-from django.utils.html import format_html
-
-from products.links.backend.models import Link
-
-
-class LinkAdmin(admin.ModelAdmin):
- list_display = (
- "id",
- "redirect_url_display",
- "team_link",
- "created_at",
- "updated_at",
- )
- list_filter = ("created_at", "updated_at")
- search_fields = ("id", "redirect_url", "team__name")
- readonly_fields = ("id", "created_at", "updated_at")
- autocomplete_fields = ("team",)
- fieldsets = (
- (
- None,
- {
- "fields": (
- "id",
- "redirect_url",
- "short_link_domain",
- "short_code",
- "team",
- )
- },
- ),
- ("Dates", {"fields": ("created_at", "updated_at")}),
- ("Additional Info", {"fields": ("description",)}),
- )
-
- def redirect_url_display(self, obj: Link) -> str:
- return format_html('<a href="{}" target="_blank">{}</a>', obj.redirect_url, obj.redirect_url)
-
- def team_link(self, obj: Link) -> str:
- return format_html(
- '<a href="{}">{}</a>',
- reverse("admin:posthog_team_change", args=[obj.team.pk]),
- obj.team.name,
- )
diff --git a/products/links/backend/api.py b/products/links/backend/api.py
deleted file mode 100644
index 5e5cd9878045..000000000000
--- a/products/links/backend/api.py
+++ /dev/null
@@ -1,106 +0,0 @@
-from typing import Any
-
-from django.db.models import QuerySet
-
-import structlog
-from rest_framework import serializers, viewsets
-from rest_framework.permissions import IsAuthenticated
-from rest_framework.request import Request
-from rest_framework.response import Response
-
-from posthog.api.routing import TeamAndOrgViewSetMixin
-from posthog.api.shared import UserBasicSerializer
-from posthog.models.team.team import Team
-
-from products.links.backend.models import Link
-
-logger = structlog.get_logger(__name__)
-
-
-class LinkSerializer(serializers.ModelSerializer):
- created_by = UserBasicSerializer(
- read_only=True,
- allow_null=True,
- help_text="User who created the link. Null when that user was deleted.",
- )
- short_code = serializers.CharField(
- required=True,
- allow_null=False,
- max_length=255,
- help_text="The unique code/path that identifies the short link, e.g. 'abc123'",
- )
- _create_in_folder = serializers.CharField(
- required=False,
- allow_blank=True,
- write_only=True,
- help_text="Folder path to file the link under in the project tree.",
- )
-
- class Meta:
- model = Link
- fields = [
- "id",
- "redirect_url",
- "short_link_domain",
- "short_code",
- "description",
- "created_at",
- "updated_at",
- "created_by",
- "_create_in_folder",
- ]
- read_only_fields = ["id", "created_at", "updated_at"]
- extra_kwargs = {
- "redirect_url": {"help_text": "Destination the short link redirects to."},
- # The model's help text names hog.gg, which this serializer rejects. Overriding here keeps
- # the published schema honest without the migration a model change would need.
- "short_link_domain": {"help_text": "Domain the short link is hosted on. Only phog.gg is accepted."},
- "description": {"help_text": "Free-form note about what the link is for."},
- }
-
- def validate_short_link_domain(self, value: str) -> str:
- # Field-level so that create, PUT and PATCH all reject a bad domain. A check inside create()
- # covers only the create path.
- if value != "phog.gg":
- raise serializers.ValidationError("Only phog.gg is allowed as a short link domain")
- return value
-
- def create(self, validated_data: dict[str, Any]) -> Link:
- team = Team.objects.get(id=self.context["team_id"])
-
- link = Link.objects.create(
- team=team,
- created_by=self.context["request"].user,
- **validated_data,
- )
-
- logger.info("link_created", id=link.id, team_id=team.id)
- return link
-
-
-class LinkViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
- """
- Create, read, update, and delete links.
- """
-
- scope_object = "link"
- queryset = Link.objects.all()
- serializer_class = LinkSerializer
- lookup_field = "id"
- permission_classes = [IsAuthenticated]
-
- def safely_get_queryset(self, queryset: QuerySet) -> QuerySet:
- return queryset.filter(team_id=self.team_id).order_by("-created_at")
-
- # TODO: Call the /invalidate route on the Rust service
- def update(self, request: Request, *args: Any, **kwargs: Any) -> Response:
- return super().update(request, *args, **kwargs)
-
- # TODO: Call the /invalidate route on the Rust service
- # and wait for confirmation before we delete this link
- #
- # TODO: Consider implementing "archiving" rather than deletion
- def destroy(self, request: Request, *args: Any, **kwargs: Any) -> Response:
- instance = self.get_object()
- logger.info("link_deleted", id=instance.id, team_id=self.team_id)
- return super().destroy(request, *args, **kwargs)
diff --git a/products/links/backend/models.py b/products/links/backend/models.py
index 3f2a603c8d0b..678bdf545339 100644
--- a/products/links/backend/models.py
+++ b/products/links/backend/models.py
@@ -1,22 +1,16 @@
from django.db import models
-from django.db.models import QuerySet
-import structlog
-
-from posthog.models.file_system.constants import DEFAULT_SURFACE
-from posthog.models.file_system.file_system_mixin import FileSystemSyncMixin
-from posthog.models.file_system.file_system_representation import FileSystemRepresentation
from posthog.models.team import Team
from posthog.models.utils import CreatedMetaFields, UpdatedMetaFields, UUIDTModel
-logger = structlog.get_logger(__name__)
+# nosemgrep: no-new-uuidt-models -- a retired model, and a new primary key default would need a migration.
+class Link(CreatedMetaFields, UpdatedMetaFields, UUIDTModel):
+ """The links product is retired. The model stays so that Django keeps cascading team and user
+ deletes into its table. A later migration removes the model and drops the table.
-class Link(FileSystemSyncMixin, CreatedMetaFields, UpdatedMetaFields, UUIDTModel):
- """
- Links that redirect to a specified destination URL.
- These are used for sharing URLs across the application.
- """
+ The model does not use FileSystemSyncMixin. With the mixin, `link` would be a registered file
+ system type again and the unfiled saver would recreate tree rows for links."""
redirect_url = models.URLField(max_length=2048)
short_link_domain = models.CharField(max_length=255, help_text="Domain where the short link is hosted, e.g. hog.gg")
@@ -38,38 +32,3 @@ class Link(FileSystemSyncMixin, CreatedMetaFields, UpdatedMetaFields, UUIDTModel
)
]
db_table = "posthog_link"
-
- def __str__(self) -> str:
- return f"{self.id} -> {self.redirect_url}"
-
- @classmethod
- def get_links_for_team(cls, team_id: int, limit: int = 100, offset: int = 0) -> QuerySet["Link"]:
- """
- Get all links for a team with pagination.
- Args:
- team_id: The team ID to get links for
- limit: Maximum number of links to return
- offset: Offset for pagination
- Returns:
- A queryset of links for the team
- """
- return cls.objects.filter(team_id=team_id).order_by("-created_at")[offset : offset + limit]
-
- @classmethod
- def get_file_system_unfiled(cls, team: "Team", surface: str = DEFAULT_SURFACE) -> QuerySet["Link"]:
- base_qs = cls.objects.filter(team=team)
- return cls._filter_unfiled_queryset(base_qs, team, type="link", ref_field="id", surface=surface)
-
- def get_file_system_representation(self) -> FileSystemRepresentation:
- return FileSystemRepresentation(
- base_folder=self._get_assigned_folder("Unfiled/Links"),
- type="link", # sync with APIScopeObject in scopes.py
- ref=str(self.id),
- name=self.short_code or "Untitled",
- href=f"/link/{self.id}",
- meta={
- "created_at": str(self.created_at),
- "created_by": self.created_by_id,
- },
- should_delete=False,
- )
diff --git a/products/links/backend/routes.py b/products/links/backend/routes.py
deleted file mode 100644
index c00503107750..000000000000
--- a/products/links/backend/routes.py
+++ /dev/null
@@ -1,7 +0,0 @@
-from posthog.api.routing import RouterRegistry
-
-from products.links.backend.api import LinkViewSet
-
-
-def register_routes(routers: RouterRegistry) -> None:
- routers.projects.register(r"links", LinkViewSet, "project_links", ["team_id"])
diff --git a/products/links/backend/test/test_api.py b/products/links/backend/test/test_api.py
deleted file mode 100644
index 854da9c500ba..000000000000
--- a/products/links/backend/test/test_api.py
+++ /dev/null
@@ -1,205 +0,0 @@
-from posthog.test.base import APIBaseTest, ClickhouseTestMixin, QueryMatchingTest
-
-import structlog
-from parameterized import parameterized
-from rest_framework import status
-from rest_framework.test import APIClient
-
-from posthog.models.organization import Organization
-from posthog.models.team.team import Team
-
-from products.links.backend.models import Link
-
-logger = structlog.get_logger(__name__)
-
-
-class TestLink(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
- def test_create_link_success(self):
- data = {
- "redirect_url": "https://example.com",
- "short_link_domain": "phog.gg",
- "short_code": "test123",
- "description": "Test link",
- }
- response = self.client.post(
- f"/api/projects/{self.team.id}/links",
- data=data,
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- self.assertEqual(response.json()["short_code"], data["short_code"])
- self.assertEqual(response.json()["created_by"]["id"], self.user.pk)
-
- @parameterized.expand(["post", "put", "patch"])
- def test_write_rejects_invalid_domain(self, method: str):
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="phog.gg",
- short_code="test123",
- created_by=self.user,
- )
- data = {
- "redirect_url": "https://example.com",
- "short_link_domain": "invalid.com",
- "short_code": "test456",
- "description": "Test link",
- }
- url = f"/api/projects/{self.team.id}/links"
- if method != "post":
- url = f"{url}/{link.id}"
-
- response = getattr(self.client, method)(url, data=data)
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- json_response = str(response.json())
- self.assertIn("short_link_domain", json_response)
- self.assertIn("Only phog.gg is allowed as a short link domain", json_response)
- link.refresh_from_db()
- self.assertEqual(link.short_link_domain, "phog.gg")
-
- def test_list_links(self):
- # Create a link first
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="phog.gg",
- short_code="test123",
- description="Test link",
- created_by=self.user,
- )
-
- response = self.client.get(f"/api/projects/{self.team.id}/links")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(len(response.json()["results"]), 1)
- self.assertEqual(response.json()["results"][0]["short_code"], link.short_code)
-
- def test_retrieve_link(self):
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="phog.gg",
- short_code="test123",
- description="Test link",
- created_by=self.user,
- )
-
- response = self.client.get(f"/api/projects/{self.team.id}/links/{link.id}")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(response.json()["short_code"], link.short_code)
-
- def test_update_link(self):
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="phog.gg",
- short_code="test123",
- description="Test link",
- created_by=self.user,
- )
-
- data = {
- "redirect_url": "https://updated.com",
- "short_link_domain": "phog.gg",
- "short_code": link.short_code,
- "description": "Updated link",
- }
-
- response = self.client.patch(
- f"/api/projects/{self.team.id}/links/{link.id}",
- data=data,
- )
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(response.json()["redirect_url"], data["redirect_url"])
-
- def test_delete_link(self):
- link = Link.objects.create(
- team=self.team,
- redirect_url="https://example.com",
- short_link_domain="phog.gg",
- short_code="test123",
- description="Test link",
- created_by=self.user,
- )
-
- response = self.client.delete(f"/api/projects/{self.team.id}/links/{link.id}")
- self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
- self.assertFalse(Link.objects.filter(id=link.id).exists())
-
- def test_unauthorized_access(self):
- # Create a new client without authentication
- client = APIClient()
- response = client.get(f"/api/projects/{self.team.id}/links")
- self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
-
- def test_link_team_isolation(self):
- # Create a second team
- team2 = Team.objects.create(organization=self.organization, name="Team 2")
-
- # Create links in both teams
- link1 = Link.objects.create(
- team=self.team,
- redirect_url="https://example1.com",
- short_link_domain="phog.gg",
- short_code="test1",
- created_by=self.user,
- )
- link2 = Link.objects.create(
- team=team2,
- redirect_url="https://example2.com",
- short_link_domain="phog.gg",
- short_code="test2",
- created_by=self.user,
- )
-
- # Should only see links from current team
- response = self.client.get(f"/api/projects/{self.team.id}/links")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(len(response.json()["results"]), 1)
- self.assertEqual(str(response.json()["results"][0]["id"]), str(link1.id))
-
- # The project in the URL decides, not the caller's current team
- response = self.client.get(f"/api/projects/{team2.id}/links")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(len(response.json()["results"]), 1)
- self.assertEqual(str(response.json()["results"][0]["id"]), str(link2.id))
-
- def test_project_in_another_org_is_refused(self):
- foreign_org = Organization.objects.create(name="Foreign org")
- foreign_team = Team.objects.create(organization=foreign_org, name="Foreign team")
- foreign_link = Link.objects.create(
- team=foreign_team,
- redirect_url="https://foreign.example.com",
- short_link_domain="phog.gg",
- short_code="foreign1",
- )
-
- response = self.client.get(f"/api/projects/{foreign_team.id}/links")
-
- self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
- self.assertNotIn(str(foreign_link.id), response.content.decode())
- self.assertNotIn("foreign.example.com", response.content.decode())
-
- def test_create_link_in_specific_folder(self):
- response = self.client.post(
- f"/api/projects/{self.team.id}/links",
- data={
- "redirect_url": "https://example.com",
- "short_link_domain": "phog.gg",
- "short_code": "test123",
- "description": "Test link",
- "_create_in_folder": "Special Folder/Links",
- },
- format="json",
- )
- assert response.status_code == 201, response.json()
-
- link_id = response.json()["id"]
- assert link_id is not None
-
- from posthog.models.file_system.file_system import FileSystem
-
- fs_entry = FileSystem.objects.filter(team=self.team, ref=str(link_id), type="link").first()
- assert fs_entry is not None, "A FileSystem entry was not created for this Link."
- assert "Special Folder/Links" in fs_entry.path, (
- f"Expected path to include 'Special Folder/Links', got '{fs_entry.path}'."
- )
diff --git a/products/links/backend/test/test_link.py b/products/links/backend/test/test_link.py
deleted file mode 100644
index d0adfc987888..000000000000
--- a/products/links/backend/test/test_link.py
+++ /dev/null
@@ -1,83 +0,0 @@
-from posthog.test.base import BaseTest
-
-from posthog.models.team import Team
-from posthog.models.user import User
-
-from products.links.backend.models import Link
-
-
-class TestLinkModel(BaseTest):
- def setUp(self):
- super().setUp()
- org, team, user = User.objects.bootstrap("Test org", "[email protected]", None)
- self.team = team
- self.user = user
- self.org = org
- self.another_team = Team.objects.create(organization=self.org, name="Another Team")
-
- def test_get_links_for_team(self):
- # Create links for different teams
- for i in range(5):
- Link.objects.create(
- redirect_url=f"https://example{i}.com",
- short_link_domain="hog.gg",
- short_code=f"team1-{i}",
- team=self.team,
- )
-
- for i in range(3):
- Link.objects.create(
- redirect_url=f"https://anotherexample{i}.com",
- short_link_domain="hog.gg",
- short_code=f"team2-{i}",
- team=self.another_team,
- )
-
- # Test getting links for team 1
- team1_links = Link.get_links_for_team(self.team.id)
- self.assertEqual(len(team1_links), 5)
-
- # Test getting links for team 2
- team2_links = Link.get_links_for_team(self.another_team.id)
- self.assertEqual(len(team2_links), 3)
-
- # Test pagination
- team1_links_limited = Link.get_links_for_team(self.team.id, limit=2)
- self.assertEqual(len(team1_links_limited), 2)
-
- team1_links_offset = Link.get_links_for_team(self.team.id, offset=2)
- self.assertEqual(len(team1_links_offset), 3)
-
- def test_unique_constraint_violation(self):
- # Create a link
- Link.objects.create(
- redirect_url="https://example.com", short_link_domain="hog.gg", short_code="unique_test", team=self.team
- )
-
- # Try to create another link with the same domain and code
- with self.assertRaises(Exception):
- Link.objects.create(
- redirect_url="https://anotherexample.com",
- short_link_domain="hog.gg",
- short_code="unique_test",
- team=self.another_team,
- )
-
- def test_unique_constraint_valid_cases(self):
- # Create initial link
- Link.objects.create(
- redirect_url="https://example.com", short_link_domain="hog.gg", short_code="different_test", team=self.team
- )
-
- # Should be able to create with different domain
- Link.objects.create(
- redirect_url="https://example.com",
- short_link_domain="different.com",
- short_code="different_test",
- team=self.team,
- )
-
- # Should be able to create with different code
- Link.objects.create(
- redirect_url="https://example.com", short_link_domain="hog.gg", short_code="different_code", team=self.team
- )
diff --git a/products/links/frontend/LinkMetricSparkline.tsx b/products/links/frontend/LinkMetricSparkline.tsx
deleted file mode 100644
index fc7a8788d2ee..000000000000
--- a/products/links/frontend/LinkMetricSparkline.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { useValues } from 'kea'
-
-import { Sparkline, SparklineTimeSeries } from 'lib/components/Sparkline'
-
-import { linkMetricSparklineLogic } from './linkMetricSparklineLogic'
-
-interface Props {
- id: string
-}
-
-export function LinkMetricSparkline({ id }: Props): JSX.Element {
- const logic = linkMetricSparklineLogic({ id })
- const { sparklineData, sparklineDataLoading } = useValues(logic)
-
- const displayData: SparklineTimeSeries[] = [
- {
- color: 'success',
- name: 'Clicks',
- values: sparklineData?.data || [],
- },
- ]
-
- return (
- <Sparkline
- loading={sparklineDataLoading}
- labels={sparklineData?.labels}
- data={displayData}
- className="h-8 max-w-24"
- />
- )
-}
diff --git a/products/links/frontend/LinkScene.tsx b/products/links/frontend/LinkScene.tsx
deleted file mode 100644
index 6d2fa8ac76a0..000000000000
--- a/products/links/frontend/LinkScene.tsx
+++ /dev/null
@@ -1,301 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { Form } from 'kea-forms'
-import { router } from 'kea-router'
-import { QRCodeSVG } from 'qrcode.react'
-
-import { IconCopy, IconDownload } from '@posthog/icons'
-import {
- LemonButton,
- LemonDivider,
- LemonInput,
- LemonLabel,
- LemonSelect,
- LemonSelectOptions,
- LemonSkeleton,
- LemonTag,
- LemonTextArea,
- Link,
-} from '@posthog/lemon-ui'
-
-import { NotFound } from 'lib/components/NotFound'
-import { useFileSystemLogView } from 'lib/hooks/useFileSystemLogView'
-import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
-import { LemonField } from 'lib/lemon-ui/LemonField'
-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 { AVAILABLE_DOMAINS, AvailableDomain, LinkLogicProps, linkLogic } from './linkLogic'
-
-export const scene: SceneExport<LinkLogicProps> = {
- component: LinkScene,
- logic: linkLogic,
- paramsToProps: ({ params: { id } }) => ({ id: id && id !== 'new' ? id : 'new' }),
-}
-
-const SOON_TAG = (
- <LemonTag type="completion" size="small" className="ml-2">
- SOON
- </LemonTag>
-)
-
-const PAID_TAG = (
- <LemonTag type="success" size="small" className="ml-2">
- PAID
- </LemonTag>
-)
-
-const DomainLabelWithTag = ({
- domain,
- soon,
- paid,
-}: {
- domain: string
- soon?: boolean
- paid?: boolean
-}): JSX.Element => {
- return (
- <div>
- <span>{domain}</span>
- {soon && SOON_TAG}
- {paid && PAID_TAG}
- </div>
- )
-}
-
-const DOMAIN_OPTIONS: LemonSelectOptions<AvailableDomain> = AVAILABLE_DOMAINS.map((domain) => ({
- label: <DomainLabelWithTag domain={domain.label} soon={domain.soon} paid={domain.paid} />,
- value: domain.value,
- disabledReason: domain.soon ? 'Coming soon...' : undefined,
-}))
-
-export function LinkScene({ id }: LinkLogicProps): JSX.Element {
- const { link, linkLoading, isLinkSubmitting, isEditingLink, linkMissing } = useValues(linkLogic)
- const { submitLinkRequest, loadLink, editLink, deleteLink } = useActions(linkLogic)
-
- const linkId = link?.id && link?.id !== 'new' ? link.id : null
-
- useFileSystemLogView({
- type: 'link',
- ref: linkId,
- enabled: Boolean(linkId && !linkLoading),
- })
-
- if (linkMissing) {
- return <NotFound object="link" />
- }
-
- if (linkLoading) {
- return <LemonSkeleton active />
- }
-
- const isNewLink = id === 'new' || id === undefined
- const displayForm = isEditingLink || isNewLink
- const fullLink = `https://${link.short_link_domain}/${link.short_code}`
-
- return (
- <Form id="link" formKey="link" logic={linkLogic}>
- <SceneContent>
- <SceneTitleSection
- name={fullLink}
- description={null}
- resourceType={{
- type: 'link',
- }}
- actions={
- <>
- {!linkLoading ? (
- displayForm ? (
- <>
- <LemonButton
- type="secondary"
- data-attr="cancel-link"
- onClick={() => {
- if (isEditingLink) {
- editLink(false)
- loadLink()
- } else {
- router.actions.push(urls.links())
- }
- }}
- size="small"
- disabledReason={isLinkSubmitting ? 'Saving…' : undefined}
- >
- Cancel
- </LemonButton>
- <LemonButton
- type="primary"
- htmlType="submit"
- data-attr="save-link"
- onClick={() => {
- submitLinkRequest(link)
- }}
- loading={isLinkSubmitting}
- form="link"
- size="small"
- >
- Save
- </LemonButton>
- </>
- ) : (
- <>
- <LemonButton
- data-attr="delete-link"
- status="danger"
- type="secondary"
- size="small"
- onClick={() => {
- LemonDialog.open({
- title: 'Permanently delete link?',
- description:
- 'Doing so will remove the link and the existing redirect rules. You will NOT lose access to the `$clicklink` events.',
- primaryButton: {
- children: 'Delete',
- type: 'primary',
- status: 'danger',
- 'data-attr': 'confirm-delete-link',
- onClick: () => {
- // conditional above ensures link is not NewLink
- deleteLink(link?.id)
- },
- },
- secondaryButton: {
- children: 'Close',
- type: 'secondary',
- },
- })
- }}
- >
- Delete
- </LemonButton>
- <LemonButton
- type="secondary"
- onClick={() => editLink(true)}
- loading={false}
- data-attr="edit-link"
- size="small"
- >
- Edit
- </LemonButton>
- </>
- )
- ) : undefined}
- </>
- }
- />
-
- <div className="space-y-4">
- <div className="flex gap-8">
- <div className="flex-1 space-y-4">
- <div className="flex flex-col">
- <LemonLabel>Destination URL</LemonLabel>
- {displayForm ? (
- <div className="flex gap-1 items-center">
- <LemonField name="redirect_url">
- <LemonInput
- placeholder="https://loooooooooooooong.posthog.com/"
- fullWidth
- autoWidth={false}
- />
- </LemonField>
- </div>
- ) : (
- <Link to={link.redirect_url} className="text-muted" target="_blank">
- {link.redirect_url}
- </Link>
- )}
- </div>
-
- <div className="flex flex-col">
- <LemonLabel>Short Link</LemonLabel>
- {displayForm ? (
- <div className="flex gap-1 items-center">
- <LemonField name="short_link_domain">
- <LemonSelect<AvailableDomain>
- options={DOMAIN_OPTIONS}
- className="text-muted"
- />
- </LemonField>
- <span className="text-muted">/</span>
- <LemonField name="short_code" className="w-full">
- <LemonInput
- fullWidth
- placeholder="short"
- className="flex-1"
- autoWidth={false}
- />
- </LemonField>
- </div>
- ) : (
- <Link to={fullLink} target="_blank">
- {fullLink}
- </Link>
- )}
- </div>
-
- <div className="flex flex-col">
- <LemonLabel>Description (optional)</LemonLabel>
- {displayForm ? (
- <div className="flex gap-1 items-center">
- <LemonField name="description">
- <LemonTextArea
- placeholder="Add a description so that you can easily identify this link"
- minRows={2}
- />
- </LemonField>
- </div>
- ) : (
- <div>{link.description || <span className="text-muted">No description</span>}</div>
- )}
- </div>
- </div>
-
- <LemonDivider vertical />
-
- <div className="flex-1 space-y-6 max-w-80">
- <div>
- <div className="flex justify-between items-center">
- <LemonLabel>
- <span className="flex items-center gap-1">QR Code</span>
- </LemonLabel>
- <div className="flex flex-row">
- <LemonButton
- icon={<IconDownload />}
- size="xsmall"
- onClick={() => {}}
- tooltip="Download QR code"
- />
- <LemonButton
- icon={<IconCopy />}
- size="xsmall"
- onClick={() => {}}
- tooltip="Copy to clipboard"
- />
- </div>
- </div>
-
- <div className="border rounded-md p-4 mt-2 bg-bg-light flex items-center justify-center">
- <div className="text-center">
- <QRCodeSVG
- size={128}
- value={fullLink}
- level="H"
- imageSettings={{
- src: '/static/posthog-icon.svg',
- height: 35,
- width: 35,
- excavate: true,
- }}
- />
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </SceneContent>
- </Form>
- )
-}
diff --git a/products/links/frontend/LinksScene.stories.tsx b/products/links/frontend/LinksScene.stories.tsx
deleted file mode 100644
index b7c034f155ad..000000000000
--- a/products/links/frontend/LinksScene.stories.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-import { Meta, StoryObj } from '@storybook/react'
-
-import { App } from 'scenes/App'
-import { urls } from 'scenes/urls'
-
-import { mswDecorator } from '~/mocks/browser'
-import { LinkType } from '~/types'
-
-const LINKS_RESULT: LinkType[] = [
- {
- id: '0187c22c-06d9-0000-34fe-daa2e2afb503',
- redirect_url: 'https://www.google.com',
- short_link_domain: 'phog.gg',
- short_code: 'google',
- description: 'Test link for Google',
- created_at: '2023-04-27T11:29:30.798968Z',
- updated_at: '2023-04-27T11:29:30.798968Z',
- created_by: {
- id: 123456,
- uuid: '0187c22c-06d9-0000-34fe-daa2e2afb504',
- distinct_id: '0187c22c-06d9-0000-34fe-daa2e2afb505',
- first_name: 'John',
- email: '[email protected]',
- },
- },
- {
- id: '0187c22d-06d9-0000-34fe-daa2e2afb503',
- redirect_url: 'https://www.posthog.com',
- short_link_domain: 'phog.gg',
- short_code: 'posthog',
- description: 'Test link for PostHog',
- created_at: '2023-04-27T11:29:30.798968Z',
- updated_at: '2023-04-27T11:29:30.798968Z',
- created_by: {
- id: 123456,
- uuid: '0187c22c-06d9-0000-34fe-daa2e2afb504',
- distinct_id: '0187c22c-06d9-0000-34fe-daa2e2afb505',
- first_name: 'John',
- email: '[email protected]',
- },
- },
- {
- id: '0187c22e-06d9-0000-34fe-daa2e2afb503',
- redirect_url: 'https://www.verylooooonglink.com?utm_source=test',
- short_link_domain: 'phog.gg',
- short_code: 'short',
- description: 'Test link for a very long link',
- created_at: '2023-04-27T11:29:30.798968Z',
- updated_at: '2023-04-27T11:29:30.798968Z',
- created_by: {
- id: 123456,
- uuid: '0187c22c-06d9-0000-34fe-daa2e2afb504',
- distinct_id: '0187c22c-06d9-0000-34fe-daa2e2afb505',
- first_name: 'John',
- email: '[email protected]',
- },
- },
-]
-
-const meta: Meta = {
- component: App,
- title: 'Scenes-App/Links',
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- mockDate: '2023-01-28', // To stabilize relative dates
- pageUrl: urls.links(),
- },
- decorators: [
- mswDecorator({
- get: {
- '/api/projects/:team_id/links': {
- count: 2,
- results: LINKS_RESULT as any[],
- next: null,
- previous: null,
- },
- '/api/projects/:team_id/links/:linkId/': LINKS_RESULT[0],
- },
- }),
- ],
-}
-export default meta
-
-type Story = StoryObj<{}>
-export const LinksList: Story = {}
-
-export const NewLink: Story = {
- parameters: {
- pageUrl: urls.link('new'),
- },
-}
-
-export const LinkDetails: Story = {
- parameters: {
- pageUrl: urls.link('0187c22c-06d9-0000-34fe-daa2e2afb503'),
- },
-}
diff --git a/products/links/frontend/LinksScene.tsx b/products/links/frontend/LinksScene.tsx
deleted file mode 100644
index 9fbefaacba4c..000000000000
--- a/products/links/frontend/LinksScene.tsx
+++ /dev/null
@@ -1,159 +0,0 @@
-import { useValues } from 'kea'
-import { router } from 'kea-router'
-
-import { IconPlus } from '@posthog/icons'
-import { LemonBanner, LemonButton, LemonTable, LemonTableColumn, Link } from '@posthog/lemon-ui'
-
-import { Shortcut } from 'lib/components/Shortcuts/Shortcut'
-import { keyBinds } from 'lib/components/Shortcuts/shortcuts'
-import { More } from 'lib/lemon-ui/LemonButton/More'
-import { LemonMenuOverlay } from 'lib/lemon-ui/LemonMenu/LemonMenu'
-import { createdAtColumn, createdByColumn } from 'lib/lemon-ui/LemonTable/columnUtils'
-import { LemonTableLink } from 'lib/lemon-ui/LemonTable/LemonTableLink'
-import stringWithWBR from 'lib/utils/stringWithWBR'
-import { sceneConfigurations } from 'scenes/scenes'
-import { Scene, SceneExport } from 'scenes/sceneTypes'
-import { urls } from 'scenes/urls'
-
-import { SceneContent } from '~/layout/scenes/components/SceneContent'
-import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
-import { ProductKey } from '~/queries/schema/schema-general'
-import { LinkType } from '~/types'
-
-import { linksEmptyState } from './emptyState/linksEmptyState'
-import { LinkMetricSparkline } from './LinkMetricSparkline'
-import { linksLogic } from './linksLogic'
-
-export const scene: SceneExport = {
- component: LinksScene,
- logic: linksLogic,
- productKey: ProductKey.LINKS,
- emptyState: linksEmptyState,
-}
-
-export function LinksScene(): JSX.Element {
- const { links, linksLoading } = useValues(linksLogic)
-
- const columns = [
- {
- title: 'Key',
- sticky: true,
- width: '40%',
- render: function Render(_: any, record: LinkType) {
- return (
- <LemonTableLink
- to={record.id ? urls.link(record.id) : undefined}
- title={
- <>
- <span>
- {stringWithWBR(record?.short_link_domain + '/' + record?.short_code || '', 17)}
- </span>
- </>
- }
- description={record?.redirect_url}
- />
- )
- },
- },
- createdByColumn<LinkType>() as LemonTableColumn<LinkType, keyof LinkType | undefined>,
- createdAtColumn<LinkType>() as LemonTableColumn<LinkType, keyof LinkType | undefined>,
- {
- title: 'Last 7 days',
- render: function RenderLinkMetricSparkline(_: any, link: LinkType) {
- return (
- // TODO: Update URL to link to page with all `$linkclick` events
- // for this specific link
- <Link to="/insights">
- <LinkMetricSparkline id={link.id} />
- </Link>
- )
- },
- },
- {
- width: 0,
- render: function Render(_: any, link: LinkType) {
- return (
- <More
- overlay={
- <LemonMenuOverlay
- items={[
- {
- label: 'Edit link',
- onClick: () => router.actions.push(urls.link(link.id)),
- },
- {
- label: 'Delete link',
- status: 'danger' as const,
- disabledReason: 'Coming soon',
- onClick: () => {},
- },
- ]}
- />
- }
- />
- )
- },
- },
- ]
-
- return (
- <SceneContent>
- <SceneTitleSection
- name={sceneConfigurations[Scene.Links].name}
- description={sceneConfigurations[Scene.Links].description}
- resourceType={{
- type: sceneConfigurations[Scene.Links].iconType || 'default_icon_type',
- }}
- actions={
- <Shortcut
- name="NewLink"
- keybind={[keyBinds.new]}
- intent="Create link"
- interaction="click"
- scope={Scene.Links}
- >
- <LemonButton
- type="primary"
- icon={<IconPlus />}
- onClick={() => router.actions.push(urls.link('new'))}
- size="small"
- tooltip="Create link"
- sideAction={{
- dropdown: {
- overlay: (
- <>
- <LemonButton disabledReason="Coming soon" fullWidth>
- Import from Bit.ly
- </LemonButton>
- <LemonButton disabledReason="Coming soon" fullWidth>
- Import from Dub.co
- </LemonButton>
- <LemonButton disabledReason="Coming soon" fullWidth>
- Import from CSV
- </LemonButton>
- </>
- ),
- placement: 'bottom-end',
- },
- }}
- >
- Create link
- </LemonButton>
- </Shortcut>
- }
- />
-
- <LemonBanner type="error">
- <h2>Links are extremely WIP</h2>
- <p>
- Links were started on the Tulum 2025 hackathon, and are not currently in use. The UI and Django
- backend are fully functional, but there's no backend to actually track/redirect clicks. This should
- be implemented in the future, probably part of our NodeJS infrastructure - we've initially built it
- in Rust.
- </p>
- </LemonBanner>
-
- <LemonTable loading={linksLoading} columns={columns} dataSource={links} />
- </SceneContent>
- )
-}
diff --git a/products/links/frontend/emptyState/LinkPreview.scss b/products/links/frontend/emptyState/LinkPreview.scss
deleted file mode 100644
index e083d2f35539..000000000000
--- a/products/links/frontend/emptyState/LinkPreview.scss
+++ /dev/null
@@ -1,335 +0,0 @@
-@import '../../../../frontend/src/lib/components/ProductEmptyState/previewMixins';
-
-.LinkPreview {
- --link-preview-accent: var(--empty-state-accent, var(--color-primary-500));
-
- display: flex;
- flex-direction: column;
- gap: 0.75rem;
-
- // Hidden link state. Direct children of .LinkPreview so `:checked ~` reaches all cards.
- &__radio {
- position: absolute;
- width: 0;
- height: 0;
- pointer-events: none;
- opacity: 0;
- }
-
- &__panel,
- &__app,
- &__spark {
- overflow: hidden;
- background: var(--color-bg-surface-primary);
- border: 1px solid var(--color-border-primary);
- border-radius: var(--radius);
- }
-
- // Link variants are stacked on one grid cell and crossfaded, so switching links
- // never changes any element's size (no layout shift).
- &__swap {
- display: grid;
- }
-
- &__swap > * {
- grid-area: 1 / 1;
- min-width: 0;
- }
-
- &__on-a,
- &__on-b {
- @include preview-swap-hidden;
- }
-
- &__head {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0.5rem 0.75rem;
- border-bottom: 1px solid var(--color-border-primary);
- }
-
- &__title {
- font-size: 0.75rem;
- font-weight: 600;
- }
-
- &__rows {
- display: flex;
- flex-direction: column;
- padding: 0.25rem 0.5rem;
- }
-
- &__row {
- display: grid;
- grid-template-columns: auto 1fr auto auto;
- gap: 0.5rem;
- align-items: center;
- padding: 0.375rem 0.5rem;
- border: 1px solid transparent;
- border-radius: var(--radius);
- transition:
- background-color 150ms ease,
- border-color 150ms ease;
- }
-
- &__row--a,
- &__row--b {
- cursor: pointer;
- user-select: none;
- }
-
- &__row--a:hover,
- &__row--b:hover {
- background: var(--color-bg-fill-highlight-50);
- }
-
- // Radio dots make the selectable rows read as selectable; the static row keeps an
- // empty spacer so all rows align.
- &__vradio {
- position: relative;
- flex-shrink: 0;
- width: 12px;
- height: 12px;
- border: 1.5px solid var(--link-preview-accent);
- border-radius: 50%;
-
- &::after {
- position: absolute;
- inset: 2px;
- content: '';
- background: var(--link-preview-accent);
- border-radius: 50%;
- transition: transform 150ms ease;
- transform: scale(0);
- }
- }
-
- &__vradio--blank {
- visibility: hidden;
- }
-
- &__link {
- display: flex;
- flex-direction: column;
- min-width: 0;
- }
-
- &__key {
- overflow: hidden;
- font-family: var(--font-mono);
- font-size: 0.6875rem;
- font-weight: 600;
- color: var(--color-text-primary);
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- &__dest {
- overflow: hidden;
- font-size: 0.625rem;
- color: var(--color-text-tertiary);
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- &__row-spark {
- width: 40px;
- height: 12px;
-
- path {
- fill: none;
- stroke: color-mix(in oklab, var(--link-preview-accent) 55%, transparent);
- stroke-linecap: round;
- stroke-width: 1.5;
- }
- }
-
- &__clicks {
- min-width: 3rem;
- font-family: var(--font-mono);
- font-size: 0.6875rem;
- color: var(--color-text-secondary);
- text-align: right;
- }
-
- &__hint {
- padding: 0 0.75rem 0.5rem;
- font-size: 0.6875rem;
- color: var(--color-text-tertiary);
- }
-
- // Browser chrome for the landing-page card.
- &__chrome {
- display: flex;
- gap: 0.3125rem;
- align-items: center;
- padding: 0.4375rem 0.75rem;
- background: var(--color-bg-surface-secondary);
- border-bottom: 1px solid var(--color-border-primary);
- }
-
- &__url {
- margin-left: 0.375rem;
- font-family: var(--font-mono);
- font-size: 0.625rem;
- color: var(--color-text-tertiary);
- }
-
- &__redirect {
- display: flex;
- gap: 0.375rem;
- align-items: center;
- padding: 0.3125rem 0.75rem;
- font-size: 0.625rem;
- color: var(--color-text-secondary);
- border-bottom: 1px solid var(--color-border-primary);
- }
-
- &__redirect-arrow {
- font-weight: 700;
-
- @include preview-accent-text(var(--link-preview-accent));
- }
-
- &__screen {
- display: flex;
- flex-direction: column;
- gap: 0.4375rem;
- align-items: flex-start;
- padding: 0.875rem;
- }
-
- &__page-title {
- font-size: 0.9375rem;
- font-weight: 700;
- }
-
- &__page-sub {
- font-size: 0.6875rem;
- color: var(--color-text-secondary);
- }
-
- &__page-cta {
- margin-top: 0.125rem;
- font-size: 0.6875rem;
- font-weight: 600;
-
- > * {
- padding: 0.3125rem 0.625rem;
- color: var(--color-bg-surface-primary);
- text-align: center;
- background: var(--link-preview-accent);
- border-radius: var(--radius);
- }
- }
-
- // The podcast page's play button meeps (the inbox onboarding easter egg). The swap
- // mixins keep it out of reach, and out of the tab order, while its half is hidden.
- &__play {
- font: inherit;
- cursor: pointer;
- border: none;
-
- &:focus-visible {
- outline: 2px solid var(--link-preview-accent);
- outline-offset: 1px;
- }
- }
-
- // Clicks stat card for the selected link.
- &__spark {
- padding: 0.75rem 0.875rem 0.875rem;
- }
-
- &__spark-note {
- font-size: 0.6875rem;
- font-weight: 400;
- color: var(--color-text-tertiary);
- }
-
- &__spark-chart {
- margin-top: 0.5rem;
- }
-
- &__spark-g {
- transition: opacity 250ms ease;
- }
-
- &__spark-area {
- fill: color-mix(in oklab, var(--link-preview-accent) 13%, transparent);
- stroke: none;
- }
-
- &__spark-line {
- fill: none;
- stroke: color-mix(in oklab, var(--link-preview-accent) 32%, transparent);
- stroke-width: 2;
- }
-
- // The moving bit: a short bright segment cycling along the line.
- &__spark-trace {
- fill: none;
- stroke: var(--link-preview-accent);
- stroke-dasharray: 16 84;
- stroke-linecap: round;
- stroke-width: 2;
- animation: LinkPreview__trace 3.2s linear infinite;
- }
-
- @include preview-chrome-dot;
- @include preview-sparkline;
-}
-
-// Selected link, driven purely by the hidden radios.
-
-#link-preview-a:checked ~ * .LinkPreview__on-a,
-#link-preview-b:checked ~ * .LinkPreview__on-b {
- @include preview-swap-visible;
-}
-
-#link-preview-a:checked ~ .LinkPreview__panel .LinkPreview__row--a,
-#link-preview-b:checked ~ .LinkPreview__panel .LinkPreview__row--b {
- background: color-mix(in oklab, var(--link-preview-accent) 8%, transparent);
- border-color: color-mix(in oklab, var(--link-preview-accent) 40%, transparent);
-}
-
-#link-preview-a:checked ~ .LinkPreview__panel .LinkPreview__vradio--a::after,
-#link-preview-b:checked ~ .LinkPreview__panel .LinkPreview__vradio--b::after {
- transform: scale(1);
-}
-
-// The radios stay keyboard-focusable while visually hidden, so the link row they
-// label needs a visible focus indicator (WCAG 2.4.7).
-#link-preview-a:focus-visible ~ .LinkPreview__panel .LinkPreview__row--a,
-#link-preview-b:focus-visible ~ .LinkPreview__panel .LinkPreview__row--b {
- outline: 2px solid var(--link-preview-accent);
- outline-offset: 1px;
-}
-
-// Nudge attention at the unselected link's radio until it's been picked.
-.LinkPreview:not(.LinkPreview--static) #link-preview-b:not(:checked) ~ .LinkPreview__panel .LinkPreview__vradio--b {
- animation: LinkPreview__nudge 2.4s ease-in-out infinite;
-}
-
-@keyframes LinkPreview__nudge {
- 0%,
- 100% {
- box-shadow: 0 0 0 0 color-mix(in oklab, var(--link-preview-accent) 45%, transparent);
- }
-
- 50% {
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--link-preview-accent) 20%, transparent);
- }
-}
-
-// pathLength is normalized to 100, so the dash offset loops cleanly regardless of length.
-@keyframes LinkPreview__trace {
- to {
- stroke-dashoffset: -100;
- }
-}
-
-// Storybook snapshots and reduced motion drop all ambient motion; picking a link
-// still works (transitions only).
-@include preview-motion-guards('LinkPreview');
diff --git a/products/links/frontend/emptyState/LinkPreview.tsx b/products/links/frontend/emptyState/LinkPreview.tsx
deleted file mode 100644
index 3526e350590d..000000000000
--- a/products/links/frontend/emptyState/LinkPreview.tsx
+++ /dev/null
@@ -1,177 +0,0 @@
-import './LinkPreview.scss'
-
-import { LemonTag } from 'lib/lemon-ui/LemonTag'
-import { cn } from 'lib/utils/css-classes'
-import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'
-
-import { playMeep } from 'products/signals/frontend/inbox/components/onboarding/meep'
-
-// Hand-authored 7-day click series: one tiny sparkline per link row, plus a pair of
-// larger series for the stat card (one per selectable link).
-const ROW_SPARKS = [
- 'M 0 10 L 6.6 8.5 L 13.3 9 L 20 7 L 26.6 7.6 L 33.3 5 L 40 3',
- 'M 0 9 L 6.6 9.5 L 13.3 7.5 L 20 8 L 26.6 6 L 33.3 6.6 L 40 4.5',
- 'M 0 8 L 6.6 8.6 L 13.3 7.8 L 20 8.4 L 26.6 7.4 L 33.3 8 L 40 7',
-]
-const LINE_A = 'M 0 32 L 10 30 L 20 30.8 L 30 27 L 40 27.8 L 50 24 L 60 25 L 70 20.5 L 80 19 L 90 15.5 L 100 13'
-const LINE_B = 'M 0 33 L 10 32 L 20 32.4 L 30 30 L 40 30.8 L 50 28 L 60 28.8 L 70 26 L 80 25 L 90 22.5 L 100 21'
-
-function areaPath(line: string): string {
- return `${line} L 100 40 L 0 40 Z`
-}
-
-/**
- * Example-data preview for the links empty state: the link list wired to a mini
- * browser and a clicks stat card, so picking a link shows the page its visitors land
- * on. The whole interaction is two hidden radios driving `:checked ~` styles - no
- * timers or state, per the preview rules in the `building-product-empty-states`
- * skill. Link variants are stacked in `__swap` grids and crossfaded, so switching
- * never changes the layout's size.
- */
-export function LinkPreview(): JSX.Element {
- const isStatic = inStorybook() || inStorybookTestRunner()
-
- return (
- <div className={cn('LinkPreview', isStatic && 'LinkPreview--static')}>
- {/* Link selection, before all three cards so `:checked ~` can style them. */}
- <input
- type="radio"
- name="link-preview-link"
- id="link-preview-a"
- defaultChecked
- className="LinkPreview__radio"
- />
- <input type="radio" name="link-preview-link" id="link-preview-b" className="LinkPreview__radio" />
-
- <div className="LinkPreview__panel">
- <div className="LinkPreview__head">
- <span className="LinkPreview__title">Links</span>
- <LemonTag size="small">example data</LemonTag>
- </div>
-
- <div className="LinkPreview__rows">
- <label htmlFor="link-preview-a" className="LinkPreview__row LinkPreview__row--a">
- <span className="LinkPreview__vradio LinkPreview__vradio--a" aria-hidden="true" />
- <span className="LinkPreview__link">
- <span className="LinkPreview__key">phog.gg/spring-sale</span>
- <span className="LinkPreview__dest">yourstore.com/spring-sale</span>
- </span>
- <svg className="LinkPreview__row-spark" viewBox="0 0 40 12" aria-hidden="true">
- <path d={ROW_SPARKS[0]} vectorEffect="non-scaling-stroke" />
- </svg>
- <span className="LinkPreview__clicks">1,284</span>
- </label>
- <label htmlFor="link-preview-b" className="LinkPreview__row LinkPreview__row--b">
- <span className="LinkPreview__vradio LinkPreview__vradio--b" aria-hidden="true" />
- <span className="LinkPreview__link">
- <span className="LinkPreview__key">phog.gg/podcast</span>
- <span className="LinkPreview__dest">yourshow.fm/episode-42</span>
- </span>
- <svg className="LinkPreview__row-spark" viewBox="0 0 40 12" aria-hidden="true">
- <path d={ROW_SPARKS[1]} vectorEffect="non-scaling-stroke" />
- </svg>
- <span className="LinkPreview__clicks">967</span>
- </label>
- <div className="LinkPreview__row LinkPreview__row--static">
- <span className="LinkPreview__vradio LinkPreview__vradio--blank" aria-hidden="true" />
- <span className="LinkPreview__link">
- <span className="LinkPreview__key">phog.gg/qr-menu</span>
- <span className="LinkPreview__dest">yourcafe.com/menu</span>
- </span>
- <svg className="LinkPreview__row-spark" viewBox="0 0 40 12" aria-hidden="true">
- <path d={ROW_SPARKS[2]} vectorEffect="non-scaling-stroke" />
- </svg>
- <span className="LinkPreview__clicks">412</span>
- </div>
- </div>
-
- <div className="LinkPreview__hint">Pick a link to preview where it takes people.</div>
- </div>
-
- <div className="LinkPreview__app">
- <div className="LinkPreview__chrome">
- <span className="LinkPreview__chrome-dot" />
- <span className="LinkPreview__chrome-dot" />
- <span className="LinkPreview__chrome-dot" />
- <span className="LinkPreview__swap LinkPreview__url">
- <span className="LinkPreview__on-a">phog.gg/spring-sale</span>
- <span className="LinkPreview__on-b">phog.gg/podcast</span>
- </span>
- </div>
- <div className="LinkPreview__redirect">
- <span className="LinkPreview__redirect-arrow" aria-hidden="true">
- →
- </span>
- <span className="LinkPreview__swap">
- <span className="LinkPreview__on-a">Redirects to yourstore.com/spring-sale</span>
- <span className="LinkPreview__on-b">Redirects to yourshow.fm/episode-42</span>
- </span>
- </div>
- <div className="LinkPreview__screen">
- <span className="LinkPreview__swap LinkPreview__page-title">
- <span className="LinkPreview__on-a">Spring sale</span>
- <span className="LinkPreview__on-b">Episode 42</span>
- </span>
- <span className="LinkPreview__swap LinkPreview__page-sub">
- <span className="LinkPreview__on-a">20% off sitewide, this week only</span>
- <span className="LinkPreview__on-b">How small teams ship faster</span>
- </span>
- <span className="LinkPreview__swap LinkPreview__page-cta">
- <span className="LinkPreview__on-a">Shop the sale</span>
- <button type="button" className="LinkPreview__on-b LinkPreview__play" onClick={playMeep}>
- Play episode
- </button>
- </span>
- </div>
- </div>
-
- <div className="LinkPreview__spark">
- <div className="LinkPreview__spark-head">
- <span className="LinkPreview__swap LinkPreview__spark-title">
- <span className="LinkPreview__on-a">Clicks · phog.gg/spring-sale · 7 days</span>
- <span className="LinkPreview__on-b">Clicks · phog.gg/podcast · 7 days</span>
- </span>
- <LemonTag size="small">example data</LemonTag>
- </div>
-
- <div className="LinkPreview__spark-value">
- <span className="LinkPreview__swap">
- <span className="LinkPreview__on-a">1,284</span>
- <span className="LinkPreview__on-b">967</span>
- </span>
- <span className="LinkPreview__spark-note">total clicks</span>
- </div>
-
- <div className="LinkPreview__spark-chart">
- <svg
- className="LinkPreview__spark-svg"
- viewBox="0 0 100 40"
- preserveAspectRatio="none"
- aria-hidden="true"
- >
- <g className="LinkPreview__spark-g LinkPreview__on-a">
- <path className="LinkPreview__spark-area" d={areaPath(LINE_A)} />
- <path className="LinkPreview__spark-line" d={LINE_A} vectorEffect="non-scaling-stroke" />
- <path
- className="LinkPreview__spark-trace"
- d={LINE_A}
- pathLength={100}
- vectorEffect="non-scaling-stroke"
- />
- </g>
- <g className="LinkPreview__spark-g LinkPreview__on-b">
- <path className="LinkPreview__spark-area" d={areaPath(LINE_B)} />
- <path className="LinkPreview__spark-line" d={LINE_B} vectorEffect="non-scaling-stroke" />
- <path
- className="LinkPreview__spark-trace"
- d={LINE_B}
- pathLength={100}
- vectorEffect="non-scaling-stroke"
- />
- </g>
- </svg>
- </div>
- </div>
- </div>
- )
-}
diff --git a/products/links/frontend/emptyState/linksEmptyState.tsx b/products/links/frontend/emptyState/linksEmptyState.tsx
deleted file mode 100644
index 51993b3fd1cd..000000000000
--- a/products/links/frontend/emptyState/linksEmptyState.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import * as megaphonePng from '@posthog/brand/hoggies/png/megaphone'
-import { IconExternal } from '@posthog/icons'
-
-import { pngHoggie } from 'lib/brand/hoggies'
-import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { urls } from 'scenes/urls'
-
-import { ProductKey } from '~/queries/schema/schema-general'
-
-import { LinkPreview } from './LinkPreview'
-import { linksSetupLogic } from './linksSetupLogic'
-
-const HedgehogMegaphone = pngHoggie(megaphonePng)
-
-export const linksEmptyState: SceneProductEmptyState = {
- statusLogic: linksSetupLogic,
- // The whole product is behind this flag (nav-gated); flag-off users never reach the scene.
- featureFlag: FEATURE_FLAGS.LINKS,
- config: {
- productKey: ProductKey.LINKS,
- productName: 'Links',
- icon: <IconExternal />,
- accentColor: 'var(--color-product-links-light)',
- accentColorDark: 'var(--color-product-links-dark)',
- hedgehog: HedgehogMegaphone,
- text: {
- 'needs-setup': {
- headline: 'Short links you control after sharing them',
- lead: 'Turn long URLs into short links for emails, social posts, referral programs, and QR codes. Each link redirects to whatever destination you choose, and you can change that destination at any time without re-sharing the link.',
- },
- },
- primaryAction: { label: 'Create your first link', to: urls.link('new') },
- skippable: false,
- previewLabel: 'Your links, once created',
- Preview: LinkPreview,
- },
-}
diff --git a/products/links/frontend/emptyState/linksSetupLogic.test.ts b/products/links/frontend/emptyState/linksSetupLogic.test.ts
deleted file mode 100644
index afab02f22406..000000000000
--- a/products/links/frontend/emptyState/linksSetupLogic.test.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { expectLogic } from 'kea-test-utils'
-
-import api from 'lib/api'
-import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'
-
-import { ProductKey } from '~/queries/schema/schema-general'
-import { initKeaTests } from '~/test/init'
-
-import { linksSetupLogic } from './linksSetupLogic'
-
-// Guards the connect + mapping into the app-wide setup-status layer: if either
-// breaks, the scene empty-state gate strands on its spinner or shows the wrong surface.
-describe('linksSetupLogic', () => {
- let listSpy: jest.SpyInstance
-
- beforeEach(() => {
- listSpy = jest.spyOn(api.links, 'list')
- initKeaTests()
- })
-
- afterEach(() => {
- listSpy.mockRestore()
- })
-
- it.each([
- [0, 'needs-setup'],
- [1, 'has-data'],
- [23, 'has-data'],
- ])('pushes a link count of %i as status %s', async (count, expected) => {
- listSpy.mockResolvedValue({ count, results: [] })
- const logic = linksSetupLogic()
- logic.mount()
- await expectLogic(logic).toFinishAllListeners()
- expect(productSetupStatusLogic({ productKey: ProductKey.LINKS }).values.status).toBe(expected)
- })
-
- it('fails open to unknown when the count query fails before any answer', async () => {
- listSpy.mockRejectedValue(new Error('network down'))
- const logic = linksSetupLogic()
- logic.mount()
- await expectLogic(logic).toFinishAllListeners()
- expect(productSetupStatusLogic({ productKey: ProductKey.LINKS }).values.status).toBe('unknown')
- })
-})
diff --git a/products/links/frontend/emptyState/linksSetupLogic.ts b/products/links/frontend/emptyState/linksSetupLogic.ts
deleted file mode 100644
index 0c32a48461c4..000000000000
--- a/products/links/frontend/emptyState/linksSetupLogic.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'
-import { loaders } from 'kea-loaders'
-
-import api from 'lib/api'
-import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'
-import type { ProductSetupStatus } from 'lib/components/ProductEmptyState/types'
-
-import { ProductKey } from '~/queries/schema/schema-general'
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linksSetupLogicValues {
- setupStatus: ProductSetupStatus // productSetupStatusLogic
- linkCount: number | null
- linkCountLoading: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linksSetupLogicActions {
- setDetectedStatus: (status: ProductSetupStatus) => {
- status: ProductSetupStatus
- } // productSetupStatusLogic
- loadLinkCount: (_: void) => void
- loadLinkCountFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadLinkCountSuccess: (
- linkCount: number,
- payload?: void
- ) => {
- linkCount: number
- payload?: void
- }
-}
-
-export type linksSetupLogicType = MakeLogicType<linksSetupLogicValues, linksSetupLogicActions>
-
-/**
- * Setup detection for the links empty state. Links are a creation-first product,
- * so "set up" simply means the project has at least one link - no event or traffic
- * signal involved. Re-checks on every mount (the scene gate mounts it), which
- * covers returning from the link creation page.
- */
-export const linksSetupLogic = kea<linksSetupLogicType>([
- path(['products', 'links', 'frontend', 'emptyState', 'linksSetupLogic']),
- connect(() => ({
- actions: [productSetupStatusLogic({ productKey: ProductKey.LINKS }), ['setDetectedStatus']],
- values: [productSetupStatusLogic({ productKey: ProductKey.LINKS }), ['status as setupStatus']],
- })),
- loaders({
- linkCount: [
- null as number | null,
- {
- loadLinkCount: async (_: void, breakpoint): Promise<number> => {
- const response = await api.links.list({ limit: 1 })
- breakpoint()
- return response.count
- },
- },
- ],
- }),
- listeners(({ actions, values }) => ({
- loadLinkCountSuccess: ({ linkCount }) => {
- actions.setDetectedStatus(linkCount !== null && linkCount > 0 ? 'has-data' : 'needs-setup')
- },
- loadLinkCountFailure: () => {
- // Never strand the gate on its spinner: if nothing has answered yet, fail
- // open to the real scene. Don't downgrade an existing answer on a blip.
- if (values.setupStatus === 'loading') {
- actions.setDetectedStatus('unknown')
- }
- },
- })),
- afterMount(({ actions }) => {
- actions.loadLinkCount()
- }),
-])
diff --git a/products/links/frontend/generated/api.schemas.ts b/products/links/frontend/generated/api.schemas.ts
deleted file mode 100644
index 0190d7b86678..000000000000
--- a/products/links/frontend/generated/api.schemas.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * Auto-generated from the Django backend OpenAPI schema.
- * To modify these types, update the Django serializers or views, then run:
- * hogli build:openapi
- * Questions or issues? #team-devex on Slack
- *
- * PostHog API - generated
- * OpenAPI spec version: 1.0.0
- */
-/**
- * * `engineering` - Engineering
- * * `data` - Data
- * * `product` - Product Management
- * * `founder` - Founder
- * * `leadership` - Leadership
- * * `marketing` - Marketing
- * * `sales` - Sales / Success
- * * `student` - Student
- * * `other` - Other
- */
-export type RoleAtOrganizationEnumApi = (typeof RoleAtOrganizationEnumApi)[keyof typeof RoleAtOrganizationEnumApi]
-
-export const RoleAtOrganizationEnumApi = {
- Engineering: 'engineering',
- Data: 'data',
- Product: 'product',
- Founder: 'founder',
- Leadership: 'leadership',
- Marketing: 'marketing',
- Sales: 'sales',
- Student: 'student',
- Other: 'other',
-} as const
-
-export type BlankEnumApi = (typeof BlankEnumApi)[keyof typeof BlankEnumApi]
-
-export const BlankEnumApi = {
- '': '',
-} as const
-
-/**
- * @nullable
- */
-export type UserBasicApiHedgehogConfig = { [key: string]: unknown } | null
-
-export interface UserBasicApi {
- readonly id: number
- readonly uuid: string
- /**
- * @maxLength 200
- * @nullable
- */
- distinct_id?: string | null
- /** @maxLength 150 */
- first_name?: string
- /** @maxLength 150 */
- last_name?: string
- /** @maxLength 254 */
- email: string
- /** @nullable */
- is_email_verified?: boolean | null
- /** @nullable */
- readonly hedgehog_config: UserBasicApiHedgehogConfig
- role_at_organization?: RoleAtOrganizationEnumApi | BlankEnumApi | null
-}
-
-export interface LinkApi {
- readonly id: string
- /**
- * Destination the short link redirects to.
- * @maxLength 2048
- */
- redirect_url: string
- /**
- * Domain the short link is hosted on. Only phog.gg is accepted.
- * @maxLength 255
- */
- short_link_domain: string
- /**
- * The unique code/path that identifies the short link, e.g. 'abc123'
- * @maxLength 255
- */
- short_code: string
- /**
- * Free-form note about what the link is for.
- * @nullable
- */
- description?: string | null
- readonly created_at: string
- /** @nullable */
- readonly updated_at: string | null
- /** User who created the link. Null when that user was deleted. */
- readonly created_by: UserBasicApi | null
- /** Folder path to file the link under in the project tree. */
- _create_in_folder?: string
-}
-
-export interface PaginatedLinkListApi {
- count: number
- /** @nullable */
- next?: string | null
- /** @nullable */
- previous?: string | null
- results: LinkApi[]
-}
-
-export interface PatchedLinkApi {
- readonly id?: string
- /**
- * Destination the short link redirects to.
- * @maxLength 2048
- */
- redirect_url?: string
- /**
- * Domain the short link is hosted on. Only phog.gg is accepted.
- * @maxLength 255
- */
- short_link_domain?: string
- /**
- * The unique code/path that identifies the short link, e.g. 'abc123'
- * @maxLength 255
- */
- short_code?: string
- /**
- * Free-form note about what the link is for.
- * @nullable
- */
- description?: string | null
- readonly created_at?: string
- /** @nullable */
- readonly updated_at?: string | null
- /** User who created the link. Null when that user was deleted. */
- readonly created_by?: UserBasicApi | null
- /** Folder path to file the link under in the project tree. */
- _create_in_folder?: string
-}
-
-export type LinksListParams = {
- /**
- * Number of results to return per page.
- */
- limit?: number
- /**
- * The initial index from which to return the results.
- */
- offset?: number
-}
diff --git a/products/links/frontend/generated/api.ts b/products/links/frontend/generated/api.ts
deleted file mode 100644
index 2d989b7eef36..000000000000
--- a/products/links/frontend/generated/api.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-import { apiMutator } from '../../../../frontend/src/lib/api-orval-mutator'
-/**
- * Auto-generated from the Django backend OpenAPI schema.
- * To modify these types, update the Django serializers or views, then run:
- * hogli build:openapi
- * Questions or issues? #team-devex on Slack
- *
- * PostHog API - generated
- * OpenAPI spec version: 1.0.0
- */
-import type { LinkApi, LinksListParams, PaginatedLinkListApi, PatchedLinkApi } from './api.schemas'
-
-// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
-type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B
-
-type WritableKeys<T> = {
- [P in keyof T]-?: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P>
-}[keyof T]
-
-type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never
-type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never
-
-type Writable<T> = Pick<T, WritableKeys<T>>
-type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
- ? {
- [P in keyof Writable<T>]: T[P] extends object ? NonReadonly<NonNullable<T[P]>> : T[P]
- }
- : DistributeReadOnlyOverUnions<T>
-
-export const getLinksListUrl = (projectId: string, params?: LinksListParams) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/links/?${stringifiedParams}`
- : `/api/projects/${projectId}/links/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksList = async (
- projectId: string,
- params?: LinksListParams,
- options?: RequestInit
-): Promise<PaginatedLinkListApi> => {
- return apiMutator<PaginatedLinkListApi>(getLinksListUrl(projectId, params), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getLinksCreateUrl = (projectId: string) => {
- return `/api/projects/${projectId}/links/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksCreate = async (
- projectId: string,
- linkApi: NonReadonly<LinkApi>,
- options?: RequestInit
-): Promise<LinkApi> => {
- return apiMutator<LinkApi>(getLinksCreateUrl(projectId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(linkApi),
- })
-}
-
-export const getLinksRetrieveUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/links/${id}/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksRetrieve = async (projectId: string, id: string, options?: RequestInit): Promise<LinkApi> => {
- return apiMutator<LinkApi>(getLinksRetrieveUrl(projectId, id), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getLinksUpdateUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/links/${id}/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksUpdate = async (
- projectId: string,
- id: string,
- linkApi: NonReadonly<LinkApi>,
- options?: RequestInit
-): Promise<LinkApi> => {
- return apiMutator<LinkApi>(getLinksUpdateUrl(projectId, id), {
- ...options,
- method: 'PUT',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(linkApi),
- })
-}
-
-export const getLinksPartialUpdateUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/links/${id}/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksPartialUpdate = async (
- projectId: string,
- id: string,
- patchedLinkApi?: NonReadonly<PatchedLinkApi>,
- options?: RequestInit
-): Promise<LinkApi> => {
- return apiMutator<LinkApi>(getLinksPartialUpdateUrl(projectId, id), {
- ...options,
- method: 'PATCH',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(patchedLinkApi),
- })
-}
-
-export const getLinksDestroyUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/links/${id}/`
-}
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
- return apiMutator<void>(getLinksDestroyUrl(projectId, id), {
- ...options,
- method: 'DELETE',
- })
-}
diff --git a/products/links/frontend/generated/api.zod.ts b/products/links/frontend/generated/api.zod.ts
deleted file mode 100644
index 4b0d83f2d651..000000000000
--- a/products/links/frontend/generated/api.zod.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Auto-generated Zod validation schemas from the Django backend OpenAPI schema.
- * To modify these schemas, update the Django serializers or views, then run:
- * hogli build:openapi
- * Questions or issues? #team-devex on Slack
- *
- * PostHog API - generated
- * OpenAPI spec version: 1.0.0
- */
-import * as zod from 'zod'
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksCreateBodyRedirectUrlMax = 2048
-
-export const linksCreateBodyShortLinkDomainMax = 255
-
-export const linksCreateBodyShortCodeMax = 255
-
-export const LinksCreateBody = /* @__PURE__ */ zod.object({
- redirect_url: zod.url().max(linksCreateBodyRedirectUrlMax).describe('Destination the short link redirects to.'),
- short_link_domain: zod
- .string()
- .max(linksCreateBodyShortLinkDomainMax)
- .describe('Domain the short link is hosted on. Only phog.gg is accepted.'),
- short_code: zod
- .string()
- .max(linksCreateBodyShortCodeMax)
- .describe("The unique code\/path that identifies the short link, e.g. 'abc123'"),
- description: zod.string().nullish().describe('Free-form note about what the link is for.'),
- _create_in_folder: zod.string().optional().describe('Folder path to file the link under in the project tree.'),
-})
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksUpdateBodyRedirectUrlMax = 2048
-
-export const linksUpdateBodyShortLinkDomainMax = 255
-
-export const linksUpdateBodyShortCodeMax = 255
-
-export const LinksUpdateBody = /* @__PURE__ */ zod.object({
- redirect_url: zod.url().max(linksUpdateBodyRedirectUrlMax).describe('Destination the short link redirects to.'),
- short_link_domain: zod
- .string()
- .max(linksUpdateBodyShortLinkDomainMax)
- .describe('Domain the short link is hosted on. Only phog.gg is accepted.'),
- short_code: zod
- .string()
- .max(linksUpdateBodyShortCodeMax)
- .describe("The unique code\/path that identifies the short link, e.g. 'abc123'"),
- description: zod.string().nullish().describe('Free-form note about what the link is for.'),
- _create_in_folder: zod.string().optional().describe('Folder path to file the link under in the project tree.'),
-})
-
-/**
- * Create, read, update, and delete links.
- */
-export const linksPartialUpdateBodyRedirectUrlMax = 2048
-
-export const linksPartialUpdateBodyShortLinkDomainMax = 255
-
-export const linksPartialUpdateBodyShortCodeMax = 255
-
-export const LinksPartialUpdateBody = /* @__PURE__ */ zod.object({
- redirect_url: zod
- .url()
- .max(linksPartialUpdateBodyRedirectUrlMax)
- .optional()
- .describe('Destination the short link redirects to.'),
- short_link_domain: zod
- .string()
- .max(linksPartialUpdateBodyShortLinkDomainMax)
- .optional()
- .describe('Domain the short link is hosted on. Only phog.gg is accepted.'),
- short_code: zod
- .string()
- .max(linksPartialUpdateBodyShortCodeMax)
- .optional()
- .describe("The unique code\/path that identifies the short link, e.g. 'abc123'"),
- description: zod.string().nullish().describe('Free-form note about what the link is for.'),
- _create_in_folder: zod.string().optional().describe('Folder path to file the link under in the project tree.'),
-})
diff --git a/products/links/frontend/linkLogic.ts b/products/links/frontend/linkLogic.ts
deleted file mode 100644
index 46ebb5a23948..000000000000
--- a/products/links/frontend/linkLogic.ts
+++ /dev/null
@@ -1,288 +0,0 @@
-import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
-import { forms } from 'kea-forms'
-import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
-import { loaders } from 'kea-loaders'
-import { router, urlToAction } from 'kea-router'
-
-import { lemonToast } from '@posthog/lemon-ui'
-
-import api from 'lib/api'
-import { teamLogic } from 'scenes/teamLogic'
-import { urls } from 'scenes/urls'
-
-import { deleteFromTree } from '~/layout/panel-layout/ProjectTree/projectTreeLogic'
-import type { LinkType } from '~/types'
-import { Breadcrumb, ProjectTreeRef } from '~/types'
-
-import { linksLogic } from './linksLogic'
-
-export type AvailableDomain = 'phog.gg' | 'postho.gg' | 'hog.gg' | 'custom'
-export type DomainDefinition = {
- label: string
- value: AvailableDomain
- soon?: boolean
- paid?: boolean
-}
-
-export const AVAILABLE_DOMAINS: DomainDefinition[] = [
- { label: 'phog.gg', value: 'phog.gg' },
- { label: 'postho.gg', value: 'postho.gg', soon: true },
- { label: 'hog.gg', value: 'hog.gg', soon: true },
- { label: 'Custom (BYOD)', value: 'custom', soon: true, paid: true },
-]
-
-export const DEFAULT_SHORT_LINK_DOMAIN = 'phog.gg'
-export const NEW_LINK: Partial<LinkType> = {
- id: 'new',
- short_link_domain: DEFAULT_SHORT_LINK_DOMAIN,
- short_code: '',
- redirect_url: '',
- description: '',
-}
-
-export interface LinkLogicProps {
- /** Either a UUID or "new". */
- id: string
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkLogicValues {
- links: LinkType[] // linksLogic
- currentTeamId: number | null // teamLogic
- breadcrumbs: Breadcrumb[]
- isEditingLink: boolean
- isLinkSubmitting: boolean
- isLinkValid: boolean
- link: LinkType
- linkAllErrors: Record<string, any>
- linkChanged: boolean
- linkErrors: DeepPartialMap<LinkType, ValidationErrorType>
- linkHasErrors: boolean
- linkLoading: boolean
- linkManualErrors: Record<string, any>
- linkMissing: boolean
- linkTouched: boolean
- linkTouches: Record<string, boolean>
- linkValidationErrors: DeepPartialMap<LinkType, ValidationErrorType>
- mode: 'edit' | 'view'
- projectTreeRef: ProjectTreeRef
- showLinkErrors: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkLogicActions {
- loadLinks: () => any // linksLogic
- loadLinksSuccess: (
- links: LinkType[],
- payload?: any
- ) => {
- links: LinkType[]
- payload?: any
- } // linksLogic
- deleteLink: (linkId: LinkType['id']) => {
- linkId: string
- }
- editLink: (editing: boolean) => {
- editing: boolean
- }
- loadLink: () => any
- loadLinkFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadLinkSuccess: (
- link: LinkType,
- payload?: any
- ) => {
- link: LinkType
- payload?: any
- }
- resetLink: (values?: LinkType) => {
- values?: LinkType
- }
- saveLink: (updatedLink: Partial<LinkType>) => Partial<LinkType>
- saveLinkFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- saveLinkSuccess: (
- link: LinkType,
- payload?: Partial<LinkType>
- ) => {
- link: LinkType
- payload?: Partial<LinkType>
- }
- setLinkManualErrors: (errors: Record<string, any>) => {
- errors: Record<string, any>
- }
- setLinkMissing: () => {
- value: true
- }
- setLinkValue: (
- key: FieldName,
- value: any
- ) => {
- name: FieldName
- value: any
- }
- setLinkValues: (values: DeepPartial<LinkType>) => {
- values: DeepPartial<LinkType>
- }
- submitLink: () => {
- value: boolean
- }
- submitLinkFailure: (
- error: Error,
- errors: Record<string, any>
- ) => {
- error: Error
- errors: Record<string, any>
- }
- submitLinkRequest: (link: LinkType) => {
- link: LinkType
- }
- submitLinkSuccess: (link: LinkType) => {
- link: LinkType
- }
- touchLinkField: (key: string) => {
- key: string
- }
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkLogicMeta {
- key: string
- __keaTypeGenInternalSelectorTypes: {
- mode: (id: string) => 'edit' | 'view'
- breadcrumbs: (link: LinkType) => Breadcrumb[]
- projectTreeRef: (arg: string) => ProjectTreeRef
- }
-}
-
-export type linkLogicType = MakeLogicType<linkLogicValues, linkLogicActions, LinkLogicProps, linkLogicMeta>
-
-export const linkLogic = kea<linkLogicType>([
- path(['products', 'links', 'frontend', 'linkLogic']),
- props({} as LinkLogicProps),
- key(({ id }) => id),
- connect(() => ({
- values: [teamLogic, ['currentTeamId'], linksLogic, ['links']],
- actions: [linksLogic, ['loadLinks', 'loadLinksSuccess']],
- })),
- actions({
- setLinkMissing: true,
- editLink: (editing: boolean) => ({ editing }),
- deleteLink: (linkId: LinkType['id']) => ({ linkId }),
- }),
- loaders(({ props, actions }) => ({
- link: {
- loadLink: async () => {
- if (props.id && props.id !== 'new') {
- try {
- const response = await api.links.get(props.id)
- return response
- } catch (error) {
- actions.setLinkMissing()
- throw error
- }
- }
-
- return NEW_LINK as LinkType
- },
- saveLink: async (updatedLink: Partial<LinkType>) => {
- const result: LinkType = await (props.id === 'new'
- ? api.links.create(updatedLink)
- : api.links.update(props.id, updatedLink))
- if (props.id === 'new') {
- router.actions.replace(urls.link(result.id))
- }
-
- return result
- },
- },
- })),
- forms(({ actions, props }) => ({
- link: {
- defaults: { ...NEW_LINK } as LinkType,
- errors: (payload) => ({
- redirect_url: !payload?.redirect_url ? 'Must include a destination url' : undefined,
- short_code: !payload?.short_code ? 'Must include a short code' : undefined,
- }),
- submit: async (payload) => {
- if (props.id && props.id !== 'new') {
- actions.saveLink(payload)
- } else {
- actions.saveLink({ ...payload, _create_in_folder: 'Unfiled/Links' })
- }
- },
- },
- })),
- reducers({
- linkMissing: [false, { setLinkMissing: () => true }],
- isEditingLink: [false, { editLink: (_, { editing }) => editing }],
- }),
- selectors({
- mode: [(_, p) => [p.id], (id: string): 'view' | 'edit' => (id === 'new' ? 'edit' : 'view')],
- breadcrumbs: [
- (s) => [s.link],
- (link: LinkType): Breadcrumb[] => [
- {
- key: 'Link',
- name: 'Link Management',
- path: urls.links(),
- iconType: 'link',
- },
- {
- key: ['Link', link.id || 'new'],
- name: `${link.short_code} (${link.redirect_url})`,
- iconType: 'link',
- },
- ],
- ],
- projectTreeRef: [
- () => [(_, props: LinkLogicProps) => props.id],
- (id: string): ProjectTreeRef => ({ type: 'link', ref: id === 'new' ? null : String(id) }),
- ],
- }),
- listeners(({ actions, values }) => ({
- saveLinkSuccess: ({ link }) => {
- lemonToast.success('Link saved')
- actions.loadLinks()
- link.id && router.actions.replace(urls.link(link.id))
- actions.editLink(false)
- },
- deleteLink: async ({ linkId }) => {
- try {
- await api.links.delete(linkId)
- lemonToast.info('Link deleted. Existing `$linkclick` events will be kept for future analysis')
- actions.loadLinksSuccess(values.links.filter((link) => link.id !== linkId))
- deleteFromTree('link', linkId)
- router.actions.push(urls.links())
- } catch (e) {
- lemonToast.error(`Error deleting Link: ${e}`)
- }
- },
- })),
- urlToAction(({ actions, props }) => ({
- [urls.link(props.id ?? 'new')]: (_, __, ___, { method }) => {
- // If the URL was pushed (user clicked on a link), reset the scene's data.
- // This avoids resetting form fields if you click back/forward.
- if (method === 'PUSH') {
- if (props.id) {
- actions.loadLink()
- }
- }
- },
- })),
- afterMount(({ props, actions }) => {
- if (props.id !== 'new') {
- actions.loadLink()
- }
- }),
-])
diff --git a/products/links/frontend/linkMetricSparklineLogic.ts b/products/links/frontend/linkMetricSparklineLogic.ts
deleted file mode 100644
index 477a19e06687..000000000000
--- a/products/links/frontend/linkMetricSparklineLogic.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
-import { loaders } from 'kea-loaders'
-
-import api from 'lib/api'
-
-import { NodeKind, TrendsQuery } from '~/queries/schema/schema-general'
-import { setLatestVersionsOnQuery } from '~/queries/utils'
-import { ChartDisplayType } from '~/types'
-
-export type Props = {
- id: string
-}
-
-export type SparklineDataResponse = {
- data: number[]
- labels: string[]
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkMetricSparklineLogicValues {
- sparklineData: SparklineDataResponse | null
- sparklineDataLoading: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkMetricSparklineLogicActions {
- loadSparklineData: () => any
- loadSparklineDataFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadSparklineDataSuccess: (
- sparklineData: SparklineDataResponse,
- payload?: any
- ) => {
- sparklineData: SparklineDataResponse
- payload?: any
- }
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linkMetricSparklineLogicMeta {
- key: string
-}
-
-export type linkMetricSparklineLogicType = MakeLogicType<
- linkMetricSparklineLogicValues,
- linkMetricSparklineLogicActions,
- Props,
- linkMetricSparklineLogicMeta
->
-
-export const linkMetricSparklineLogic = kea<linkMetricSparklineLogicType>([
- props({} as Props),
- key(({ id }: Props) => id),
- path(['scenes', 'links', 'linkMetricSparklineLogic', 'id']),
- loaders({
- sparklineData: [
- null as SparklineDataResponse | null,
- {
- loadSparklineData: async () => {
- const query: TrendsQuery = setLatestVersionsOnQuery({
- kind: NodeKind.TrendsQuery,
- filterTestAccounts: false,
- trendsFilter: {
- display: ChartDisplayType.ActionsBar,
- },
-
- // TODO: Update to $linkclick event once ready
- series: [
- {
- kind: NodeKind.EventsNode,
- event: '$pageview',
- name: '$pageview',
- },
- ],
- })
- const response = await api.query(query)
- return response.results[0] as SparklineDataResponse
- },
- },
- ],
- }),
- afterMount(({ actions }) => {
- actions.loadSparklineData()
- }),
-])
diff --git a/products/links/frontend/linksLogic.ts b/products/links/frontend/linksLogic.ts
deleted file mode 100644
index b2914ad36aae..000000000000
--- a/products/links/frontend/linksLogic.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { MakeLogicType, afterMount, kea, path } from 'kea'
-import { loaders } from 'kea-loaders'
-
-import api from 'lib/api'
-
-import { LinkType } from '~/types'
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linksLogicValues {
- links: LinkType[]
- linksLoading: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface linksLogicActions {
- loadLinks: () => any
- loadLinksFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadLinksSuccess: (
- links: LinkType[],
- payload?: any
- ) => {
- links: LinkType[]
- payload?: any
- }
-}
-
-export type linksLogicType = MakeLogicType<linksLogicValues, linksLogicActions>
-
-export const linksLogic = kea<linksLogicType>([
- path(() => ['scenes', 'links', 'linksLogic']),
- loaders(() => ({
- links: [
- [] as LinkType[],
- {
- loadLinks: async () => {
- const response = await api.links.list()
- return response.results
- },
- },
- ],
- })),
-
- afterMount(({ actions }) => {
- actions.loadLinks()
- }),
-])
diff --git a/products/links/manifest.tsx b/products/links/manifest.tsx
deleted file mode 100644
index 9976bb07d567..000000000000
--- a/products/links/manifest.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { FEATURE_FLAGS } from 'lib/constants'
-import { urls } from 'scenes/urls'
-
-import { FileSystemIconType, ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'
-import { FileSystemIconColor, ProductManifest } from '~/types'
-
-export const manifest: ProductManifest = {
- name: 'Links',
- scenes: {
- Links: {
- name: 'Links',
- import: () => import('./frontend/LinksScene'),
- projectBased: true,
- activityScope: 'Link',
- description: 'Start creating links for your marketing campaigns, referral programs, and more.',
- iconType: 'link',
- },
- Link: {
- name: 'Link',
- import: () => import('./frontend/LinkScene'),
- projectBased: true,
- activityScope: 'Link',
- },
- },
- routes: {
- '/links': ['Links', 'links'],
- '/link/:id': ['Link', 'link'],
- },
- urls: {
- links: (): string => '/links',
- link:
- /** @param id A UUID or 'new'. ':id' for routing. */
- (id: string): string => `/link/${id}`,
- },
- fileSystemTypes: {
- link: {
- name: 'Link',
- iconType: 'link' as FileSystemIconType,
- href: (ref: string) => urls.link(ref),
- iconColor: ['var(--color-product-links-light)', 'var(--color-product-links-dark)'],
- filterKey: 'link',
- flag: FEATURE_FLAGS.LINKS,
- },
- },
- treeItemsNew: [
- {
- path: `Link`,
- type: 'link',
- href: urls.link('new'),
- iconType: 'link' as FileSystemIconType,
- iconColor: ['var(--color-product-links-light)', 'var(--color-product-links-dark)'] as FileSystemIconColor,
- flag: FEATURE_FLAGS.LINKS,
- },
- ],
- treeItemsProducts: [
- {
- path: 'Links',
- intents: [ProductKey.LINKS],
- category: ProductItemCategory.UNRELEASED,
- type: 'link',
- href: urls.links(),
- flag: FEATURE_FLAGS.LINKS,
- tags: ['alpha'],
- sceneKey: 'Links',
- },
- ],
-}
diff --git a/products/links/package.json b/products/links/package.json
index 88de167e6257..8b01ee9be27a 100644
--- a/products/links/package.json
+++ b/products/links/package.json
@@ -1,25 +1,6 @@
{
"name": "@posthog/products-links",
"scripts": {
- "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short"
- },
- "dependencies": {
- "@posthog/quill-charts": "workspace:*",
- "kea": "catalog:",
- "kea-forms": "catalog:",
- "kea-loaders": "catalog:",
- "kea-router": "catalog:",
- "qrcode.react": "^4.2.0"
- },
- "devDependencies": {
- "kea-test-utils": "catalog:"
- },
- "peerDependencies": {
- "@posthog/brand": "catalog:",
- "@posthog/icons": "catalog:",
- "@storybook/react": "catalog:",
- "@types/react": "*",
- "clsx": "*",
- "react": "*"
+ "backend:test": "echo 'vestigial app — no tests'"
}
}
diff --git a/products/ruff.toml b/products/ruff.toml
index 7c7049502378..89d730278b0d 100644
--- a/products/ruff.toml
+++ b/products/ruff.toml
@@ -98,7 +98,6 @@ extend-select = ["ANN001", "ANN201", "ANN202", "ANN204"]
"feature_flags/**" = ["PLC0415"]
"growth/**" = ["PLC0415"]
"legal_documents/**" = ["PLC0415"]
-"links/**" = ["PLC0415"]
"live_debugger/**" = ["PLC0415"]
"ai_observability/**" = ["PLC0415"]
"logs/**" = ["PLC0415"]
diff --git a/pyproject.toml b/pyproject.toml
index c3e1d9f46366..d1c55c56912f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -800,7 +800,6 @@ ignore_imports = [
"products.growth.backend.routes -> products.growth.backend.api.ai_enrichment",
"products.growth.backend.routes -> products.growth.backend.api.identity_matching",
"products.growth.backend.routes -> products.growth.backend.api.product_push",
- "products.links.backend.routes -> products.links.backend.api",
"products.live_debugger.backend.routes -> products.live_debugger.backend.api",
"products.managed_migrations.backend.routes -> products.managed_migrations.backend.api.batch_imports",
"products.managed_migrations.backend.routes -> products.managed_migrations.backend.api.support_batch_imports",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 8d4871007ae7..48f24959d766 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -59123,37 +59123,6 @@ export namespace Schemas {
teams: LinearTeam[];
}
- export interface Link {
- readonly id: string;
- /**
- * Destination the short link redirects to.
- * @maxLength 2048
- */
- redirect_url: string;
- /**
- * Domain the short link is hosted on. Only phog.gg is accepted.
- * @maxLength 255
- */
- short_link_domain: string;
- /**
- * The unique code/path that identifies the short link, e.g. 'abc123'
- * @maxLength 255
- */
- short_code: string;
- /**
- * Free-form note about what the link is for.
- * @nullable
- */
- description?: string | null;
- readonly created_at: string;
- /** @nullable */
- readonly updated_at: string | null;
- /** User who created the link. Null when that user was deleted. */
- readonly created_by: UserBasic | null;
- /** Folder path to file the link under in the project tree. */
- _create_in_folder?: string;
- }
-
/**
* Minimal inbox `SignalReport` projection for the scout reverse lookup — just enough
* for the scout UI to render a clickable chip and deep-link into the inbox, which loads
@@ -67474,15 +67443,6 @@ export namespace Schemas {
results: LegalDocumentDTO[];
}
- export interface PaginatedLinkList {
- count: number;
- /** @nullable */
- next?: string | null;
- /** @nullable */
- previous?: string | null;
- results: Link[];
- }
-
export interface PaginatedListOutputList {
count: number;
/** @nullable */
@@ -77878,37 +77838,6 @@ export namespace Schemas {
version_description?: string;
}
- export interface PatchedLink {
- readonly id?: string;
- /**
- * Destination the short link redirects to.
- * @maxLength 2048
- */
- redirect_url?: string;
- /**
- * Domain the short link is hosted on. Only phog.gg is accepted.
- * @maxLength 255
- */
- short_link_domain?: string;
- /**
- * The unique code/path that identifies the short link, e.g. 'abc123'
- * @maxLength 255
- */
- short_code?: string;
- /**
- * Free-form note about what the link is for.
- * @nullable
- */
- description?: string | null;
- readonly created_at?: string;
- /** @nullable */
- readonly updated_at?: string | null;
- /** User who created the link. Null when that user was deleted. */
- readonly created_by?: UserBasic | null;
- /** Folder path to file the link under in the project tree. */
- _create_in_folder?: string;
- }
-
export interface PatchedLiveDebuggerBreakpoint {
readonly id?: string;
/** @nullable */
@@ -119556,17 +119485,6 @@ export namespace Schemas {
export type JsSnippetVersionPartialUpdate200 = { [key: string]: unknown };
- export type LinksListParams = {
- /**
- * Number of results to return per page.
- */
- limit?: number;
- /**
- * The initial index from which to return the results.
- */
- offset?: number;
- };
-
export type LiveDebuggerBreakpointsListParams = {
filename?: string;
/**
diff --git a/services/mcp/src/tools/links/app-url-manifest.json b/services/mcp/src/tools/links/app-url-manifest.json
index 6ac2e6114911..0d7872b9fa8c 100644
--- a/services/mcp/src/tools/links/app-url-manifest.json
+++ b/services/mcp/src/tools/links/app-url-manifest.json
@@ -1059,16 +1059,6 @@
"params": [],
"scope": "project"
},
- "link": {
- "template": "/link/{id}",
- "params": ["id"],
- "scope": "project"
- },
- "links": {
- "template": "/links",
- "params": [],
- "scope": "project"
- },
"liveDebugger": {
"template": "/live-debugger",
"params": [],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json
index 9b80b23645cd..4e679c20ce6e 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json
@@ -13,7 +13,7 @@
"type": "object"
},
"url": {
- "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/link/{id}\n/links\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/scout-trials\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/views\n/views/new\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",
+ "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/scout-trials\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/views\n/views/new\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",
"type": "string"
}
},
diff --git a/tach.toml b/tach.toml
index 74cc95e14567..3a05c0804090 100644
--- a/tach.toml
+++ b/tach.toml
@@ -516,10 +516,10 @@ depends_on = [
layer = "modules"
[[modules]]
+# Retired product. The app keeps its model and migration history so that Django keeps
+# cascading deletes into its table until a later migration drops it.
path = "products.links"
-depends_on = [
- "posthog",
-]
+depends_on = ["posthog"]
layer = "modules"
[[modules]]