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.

fix(scenes): show release stage tag only on product-named titles (#110552)

Paul D'Ambra7920c122ce92
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index b5ce1e45f939..dbb70237ec84 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -9467,9 +9467,9 @@ snapshots:
scenes-app-engineering-analytics-team--team--light:
hash: v1.k794b7964.e3e2163a7c066bc26f1b3e7f80541d5c5bf1419d8a503d35a554ed72d048ee82.Ov31vsxKog4PRQOFXFyXMS-QrY6UhgMxAqqtaJWocWM
scenes-app-engineering-analytics-team--team-narrow--dark:
- hash: v1.k794b7964.db1bfd583a977538b914123eae7871fcafccfbadf09ec8501883f41a1f1d4943.t3ureTsYDrzqTS9vnP8gBs8YRrOWevCGTmJ6u7lV-SM
+ hash: v1.k794b7964.6de8ee5eac265b4472c96f92c8e082ac9cea49406503cec0021e8dcdbe7d927d.mOg79dFV_FrNp_7sqO6ohCyZMfuWDwbOpdE5esKnjjk
scenes-app-engineering-analytics-team--team-narrow--light:
- hash: v1.k794b7964.1d90a143e7072e6e561578c9a88fffa59a6d0fd02b5c82e398c1602b2aaa6b03.vsPsezqKfK5Pu71RJxTrkJ-Lp4UFD07ajlKzcclTMdU
+ hash: v1.k794b7964.0150502cfbac0b95b123c0e37f806559babbd5501547b0259566f8aad52cb08a.YFoPIcTeQqzV_19qbyRbDN2tEJCviQxRF0MlSJyC0ss
scenes-app-engineering-analytics-team--team-quarantine-load-error--dark:
hash: v1.k794b7964.1c6be5bb3f64f79843d2befde083faec26e3b4ad6dd7d2867a99b599d2943324.hFMUrz-ggVkoUYAZ_UL5sx4qeN-_zFWPHOXyg7GP1CU
scenes-app-engineering-analytics-team--team-quarantine-load-error--light:
diff --git a/frontend/src/layout/scenes/components/SceneTitleSection.tsx b/frontend/src/layout/scenes/components/SceneTitleSection.tsx
index 1cbf7bf9ab04..0fb8f609536c 100644
--- a/frontend/src/layout/scenes/components/SceneTitleSection.tsx
+++ b/frontend/src/layout/scenes/components/SceneTitleSection.tsx
@@ -283,7 +283,10 @@ export function SceneTitleSection({
const { zenMode } = useValues(navigation3000Logic)
const { activeSceneId } = useValues(sceneLogic)
const releaseStageSceneId = sceneId ?? activeSceneId
- const releaseStageProduct = useMemo(() => releaseStageProductForScene(releaseStageSceneId), [releaseStageSceneId])
+ const releaseStageProduct = useMemo(
+ () => releaseStageProductForScene(releaseStageSceneId, name),
+ [releaseStageSceneId, name]
+ )
const { showDescription } = useValues(sceneLayoutLogic)
const { toggleShowDescription } = useActions(sceneLayoutLogic)
const willShowBreadcrumbs = forceBackTo || breadcrumbs.length > 2
diff --git a/frontend/src/lib/components/ReleaseStageTag/releaseStage.test.ts b/frontend/src/lib/components/ReleaseStageTag/releaseStage.test.ts
index 667c50f59b7b..445c00a2761c 100644
--- a/frontend/src/lib/components/ReleaseStageTag/releaseStage.test.ts
+++ b/frontend/src/lib/components/ReleaseStageTag/releaseStage.test.ts
@@ -13,17 +13,22 @@ describe('releaseStage', () => {
expect(releaseStage(product)).toEqual(expected)
})
- test.each<[string | null, ReleaseStage | null]>([
- ['Pulse', 'internal'],
- ['DataCatalog', 'beta'],
- ['Inbox', 'beta'],
- ['Dashboard', null],
- ['AIObservability', null],
- ['AIObservabilityTags', 'alpha'],
- ['SQLEditor', null],
- [null, null],
- ])('the %s scene shows %s', (sceneId, expected) => {
- const product = releaseStageProductForScene(sceneId)
+ test.each<[string | null, string | null | undefined, ReleaseStage | null]>([
+ ['Pulse', 'Pulse', 'internal'],
+ ['DataCatalog', 'Data catalog', 'beta'],
+ ['DataCatalog', 'Weekly active users', null],
+ ['Inbox', 'Self-driving inbox', 'beta'],
+ ['CustomerAnalytics', 'Customer analytics', 'beta'],
+ ['CustomerAnalyticsAccount', 'Acme Inc', null],
+ ['LiveDebugger', 'Live debugger', 'internal'],
+ ['Dashboard', 'Dashboard', null],
+ ['AIObservability', 'AI observability', null],
+ ['AIObservabilityTags', 'Taggers', 'alpha'],
+ ['SQLEditor', 'SQL editor', null],
+ ['Pulse', undefined, null],
+ [null, 'Pulse', null],
+ ])('the %s scene titled %s shows %s', (sceneId, title, expected) => {
+ const product = releaseStageProductForScene(sceneId, title)
expect(product ? releaseStage(product) : null).toEqual(expected)
})
})
diff --git a/frontend/src/lib/components/ReleaseStageTag/releaseStage.ts b/frontend/src/lib/components/ReleaseStageTag/releaseStage.ts
index 06a010b4e180..9d13c6390651 100644
--- a/frontend/src/lib/components/ReleaseStageTag/releaseStage.ts
+++ b/frontend/src/lib/components/ReleaseStageTag/releaseStage.ts
@@ -1,3 +1,4 @@
+import { productsItemName } from '~/layout/panel-layout/navbar/tabs/productsCatalog'
import { getTreeItemsProducts } from '~/products'
import { FileSystemImport, ProductItemCategory } from '~/queries/schema/schema-general'
@@ -12,14 +13,23 @@ export function releaseStage(product: ReleaseStageProduct): ReleaseStage | null
return product.tags?.[0] ?? null
}
-/** The product that owns a scene, when that product has a release stage to show in the scene title. */
-export function releaseStageProductForScene(sceneId: string | null): FileSystemImport | undefined {
- if (!sceneId) {
+/**
+ * The product that owns a scene, when that product has a release stage to show in the scene title.
+ * The title must be the product name, so a record title (such as a customer name) does not get the tag.
+ */
+export function releaseStageProductForScene(
+ sceneId: string | null,
+ title: string | null | undefined
+): FileSystemImport | undefined {
+ if (!sceneId || !title) {
return undefined
}
const products = getTreeItemsProducts()
const owners = products.filter((product) => product.sceneKey === sceneId)
// Many products list scenes they do not own in `sceneKeys`, so a scene listed by more than one has no clear owner.
const candidates = owners.length > 0 ? owners : products.filter((product) => product.sceneKeys?.includes(sceneId))
- return candidates.length === 1 && releaseStage(candidates[0]) !== null ? candidates[0] : undefined
+ const [product] = candidates
+ return candidates.length === 1 && releaseStage(product) !== null && productsItemName(product) === title
+ ? product
+ : undefined
}
diff --git a/products/ai_observability/frontend/tags/AIObservabilityTagsScene.tsx b/products/ai_observability/frontend/tags/AIObservabilityTagsScene.tsx
index e128656e4991..02d59c890081 100644
--- a/products/ai_observability/frontend/tags/AIObservabilityTagsScene.tsx
+++ b/products/ai_observability/frontend/tags/AIObservabilityTagsScene.tsx
@@ -338,7 +338,7 @@ export function AIObservabilityTagsScene(): JSX.Element {
return (
<SceneContent>
<SceneTitleSection
- name="Tags"
+ name="Taggers"
description="Set up taggers to automatically add custom tags to your AI generations."
resourceType={{ type: 'llm_tags' }}
actions={