: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(feature-flags): tighten flag list layout (#57875)
Dylan Martin7a80cd3862fb
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex d2a3a8cd7c5a..50a152de0603 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4183,9 +4183,9 @@ snapshots:scenes-app-feature-flags--feature-flag-not-found--light:hash: v1.k794b7964.484080c338426577cb9da75ff8bec71dd03bca1927dadfaf3b917d8f5cdc53d1.2Ifp1jtIRJ3OtTM1zSbdFi59x103xiikEmsdi26GTcwscenes-app-feature-flags--feature-flags-list--dark:- hash: v1.k794b7964.c3a17177fde3d99920a77cffffa67c2bd026ffaf54e0d0590a46bbe1e2aaafc4.-uE2rDJgTJxVwiwLeEMuZ5Hfz_64Sw-rLst4mRdaSoY+ hash: v1.k794b7964.d49a45911f1d4459fd02742638c167732191d0eb44de8a8c44d88f3df359d240.7hOsf3bhTTPZzFNrrupENw89fcSlKYdSn211aw1ExlMscenes-app-feature-flags--feature-flags-list--light:- hash: v1.k794b7964.87731849b4f4b2888755f9ee331b846a5c4c905dacb8d9008ac6d79f35381726.nYqNyfzpXQwPE-PkP9uhPuOKXBRVwdHC14Z9tFElg7U+ hash: v1.k794b7964.98dd2be71d80bc4fe2fc3a27aa327c5ad86d8711050200ab51362bfa47d9ca5c.L7DZ5LK7gorqIr0F6B--6hQbhLBK57dQ-OTEptAmm3kscenes-app-feature-flags--new-feature-flag--dark:hash: v1.k794b7964.4fde6fb028b96110a7ba260785fdb7739d57285129b1a5d2a78bbf6de0124ee5.9ZHWl5hLcjIh4iaVlBLPZwjFdMT8ih4esVB86IP5gKEscenes-app-feature-flags--new-feature-flag--light:diff --git a/frontend/src/scenes/feature-flags/FeatureFlags.tsx b/frontend/src/scenes/feature-flags/FeatureFlags.tsxindex 2f87c6f7f412..155bbcc805fb 100644--- a/frontend/src/scenes/feature-flags/FeatureFlags.tsx+++ b/frontend/src/scenes/feature-flags/FeatureFlags.tsx@@ -1,6 +1,6 @@import { useActions, useValues } from 'kea'import { combineUrl, router } from 'kea-router'-import { useState } from 'react'+import { useEffect, useRef, useState } from 'react'import { IconLock, IconPlusSmall, IconTrash } from '@posthog/icons'import { LemonButton, LemonDialog, LemonTag, lemonToast } from '@posthog/lemon-ui'@@ -63,6 +63,25 @@ import { flagSelectionLogic } from './flagSelectionLogic'import { OverlayForNewFeatureFlagMenu } from './NewFeatureFlagMenu'import ProjectsGrid from './projects-grid/ProjectsGrid'+function FlagDescription({ name }: { name: string }): JSX.Element {+ const ref = useRef<HTMLDivElement | null>(null)+ const [isTruncated, setIsTruncated] = useState(false)++ useEffect(() => {+ if (ref.current) {+ setIsTruncated(ref.current.scrollHeight > ref.current.clientHeight)+ }+ }, [name])++ return (+ <Tooltip title={isTruncated ? name : undefined} delayMs={500}>+ <div ref={ref} className="line-clamp-2 max-w-[30rem]">+ {name}+ </div>+ </Tooltip>+ )+}+// Component for rendering status cell with loading statefunction FeatureFlagStatusCell({ featureFlag }: { featureFlag: FeatureFlagType }): JSX.Element {const flagLogic = featureFlagsLogic({})@@ -375,7 +394,7 @@ export function OverviewTab({)}</>}- description={featureFlag.name}+ description={featureFlag.name ? <FlagDescription name={featureFlag.name} /> : undefined}/>)},@@ -396,15 +415,15 @@ export function OverviewTab({updatedAtColumn<FeatureFlagType>() as LemonTableColumn<FeatureFlagType, keyof FeatureFlagType | undefined>,{title: 'Release conditions',- width: 100,+ width: 280,render: function Render(_, featureFlag: FeatureFlagType) {const releaseText = groupFilters(featureFlag.filters, undefined, aggregationLabel)const variants = featureFlag.filters?.multivariate?.variantsconst isMultivariate = variants && variants.length > 0return (- <div className="space-y-1">- <div>+ <div className="max-w-[280px] space-y-1 overflow-x-auto">+ <div className="whitespace-nowrap">{typeof releaseText === 'string' && releaseText.startsWith('100% of') ? (<LemonTag type="highlight">{releaseText}</LemonTag>) : (@@ -412,7 +431,7 @@ export function OverviewTab({)}</div>{isMultivariate && (- <div className="flex flex-wrap gap-1">+ <div className="flex gap-1">{variants.map((variant) => (<span key={variant.key}><LemonTag type="muted" size="small">