: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(flags): clarify rollout match copy into two lines (#63643)
Kim Svatos Dugan86a8f9ba3a9e
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 731fb58bbe4c..9700c4d92dd3 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5015,13 +5015,13 @@ snapshots:scenes-app-feature-flags--feature-flags-list--light:hash: v1.k794b7964.9f31458f9371ccf1f6ba09cd3728a71c1b1d496b951cc942d6a173d10fa5786d.KAGRvF0AJDFLtof4mRa3aEXUcIc_B0eHSqpDoTHvKwsscenes-app-feature-flags--new-feature-flag--dark:- hash: v1.k794b7964.d3ad7126db272d6c5f913b57613dd05c2905ad54dcab5c4f81990db62b8032bd.4uhRQatdSXUiizTQYFr39754aP5csbzqmFOptTht6AE+ hash: v1.k794b7964.fbe1869305bc7cb75866454247654b1bec61b46ca26ac6376e9052d32b6008d9.kQNTnuUjC2fI5L50CuYD4L-pvJjmSa5J3sIlkPGj8F4scenes-app-feature-flags--new-feature-flag--light:- hash: v1.k794b7964.63566204766059c48090fffa57eec90fb5f74ed1cca5af5cce1c7c8a9781b72e.ZRYamuqsGVeQ0nscA25I3oOi_WBdlww-W46LxkHWz5s+ hash: v1.k794b7964.428e115f0cdaf9187601fd0cded2264fe1a2b0ad961d96725363111cbed14080.zGGEmRNDB5cmA4WOBvo4te_t74JEF4mqyh6uBAdvt1Yscenes-app-feature-flags--new-multivariate-flag-variant-key-error--dark:- hash: v1.k794b7964.d3c9931145a8f8ace63ea132512d519d78a85a67dd240f6978275b4cd5b269df.NDuEC4W0EOjPnLDHX5_6ZSy3071842JD3PKOtjXOHks+ hash: v1.k794b7964.6bf331c87f3e9992a61d1ab0de73f4d8d63e934babe13dcb86785671eabe1ff6.yoyUCLmuP9Zkaoxs_vv-pxwjAOGWeGimjduIvd6tVXEscenes-app-feature-flags--new-multivariate-flag-variant-key-error--light:- hash: v1.k794b7964.b0a781441fb47fa9f7af28aee007358fbb8fe8fc5cd194ca8e5eeb99e592608e.BCH25hWyTwCgoTS6Uh4QqQ0MNU_hwvHzoAGYb6ro-tA+ hash: v1.k794b7964.f0939cdee3029fff00d99ad5ce42ee9484f5524772b8e00406bff5a021363c17.E9A9rajD-mTXy6F-rSk_XnLmArs_P-P5mMpajr1jLksscenes-app-feature-flags--new-remote-config-flag-payload-error--dark:hash: v1.k794b7964.1af099f2e9f8811e94353c341bcf179757201966841c188ec9e81de48dab7a0b.VbS43TXKb_YBiGph4kYhjf-kfrelIfJT7eUthuLvLhYscenes-app-feature-flags--new-remote-config-flag-payload-error--light:@@ -5319,17 +5319,17 @@ snapshots:scenes-app-insights-trendspie--trends-world-map-edit--light:hash: v1.k794b7964.cd2f689b29e28b06f897a4bca768113926233988efb3fb4e600291b8af8324c0.5_HLaGKeRiEv5DpRKhp_wZ8UDLEGlx6s4LNsZMnY34Yscenes-app-insights-trendsslopegraph--trends-slope-graph--dark:- hash: v1.k794b7964.90656a3ab0e0e884066438fe2010a954ca4f2324429a4fb223020be5d007bc8d.7NM5eEo9QQRZpP0UtTsJokSUnhjM-2iNUQ1aZxMtK3s+ hash: v1.k794b7964.48989106b5363c0de2cba1dc49be30ca9d08906788482b96db2e779f148c079e.kEunmHq6Qkeq3fmklqMDIN8dtEHg6kCsjTAOnBiic5Iscenes-app-insights-trendsslopegraph--trends-slope-graph--light:- hash: v1.k794b7964.5ca06a070c6d7243e27caa9237342d54e06caf8cdbd207058c92a879280c192a.6YEtfvAGfLl4rHMwTvGr7d9g5_1FBijsuOJ0uDsqFvo+ hash: v1.k794b7964.8dd7e63cf599a016800a08cb7e85247f3b827697042dd344985e69229ae74c78.Frt6VOYHI-8e6yP855Vh_xSaUmteqyjFVo9UYU7wNQsscenes-app-insights-trendsslopegraph--trends-slope-graph-edit--dark:hash: v1.k794b7964.aa3925af9ff963c9a4ff078d763eefc4f431bfcb76743620d3aed87f5b34c6a2.pCD2J9ELy9nn_T3zZUkmdHqAhRQ2MwZR68H89gl5-1kscenes-app-insights-trendsslopegraph--trends-slope-graph-edit--light:hash: v1.k794b7964.f9f2e752c608d8934b6b7e4b67f350f27a36bb74f9fc40ecb5421b3bb7b1efe2.wnKSU54WQ7spstUfSvqqSE54kdOaY5dZ2-tAJgyCVqQscenes-app-insights-trendsslopegraph--trends-slope-graph-incomplete-period--dark:- hash: v1.k794b7964.6f48e3b26fa1dbcf874be5762183c59636a377033cabe4576701713a19fdb59d.yZOisLKz7E1FMLYJPW3JbH95A6ROCnbK-fdqHGd53MA+ hash: v1.k794b7964.0b0b0901ea567cda20eb8700107a3ebdfb06f928ee57b11c224678db35fb01b0.stir7AFfGaPYkrvLWRlNSVttOyjXhmFEAhPjeAcCo5wscenes-app-insights-trendsslopegraph--trends-slope-graph-incomplete-period--light:- hash: v1.k794b7964.9f0d760ee25679e5b817dc81b7df7ef326983eeef514c093d10cf8a08fc7679f.XmDKnPfkcpkFOYvnFDfh6gvJiKM0JL5HZS0Lj5SOkpI+ hash: v1.k794b7964.ac434dcd23914321f47c0dc7331c158a5d291593a1ae4de63a4273c700a7f522.0nlQFAvZYxBhRNNF5XHBbXi12JxZ0S-v2A973K0aU_Iscenes-app-insights-trendsslopegraph--trends-slope-graph-with-legend--dark:hash: v1.k794b7964.828419ff8c260e3794e58b96e316dce5eea4f7577c269e7f337ac22a94f66a35.SEgHO0d83_dMCXDlDXyvs6thyJKeOwg9RWrve5PtTNkscenes-app-insights-trendsslopegraph--trends-slope-graph-with-legend--light:@@ -6247,9 +6247,9 @@ snapshots:scenes-app-surveys--new-survey-customisation-section--light:hash: v1.k794b7964.c8a77d09dddf9313dd30abdf4efaca272659a218796dcefd52d39ddd62bf6fc5.DroPH2PZyADyGtp6e0Hbb7KoTkn4YZatjzWp15VZBYwscenes-app-surveys--new-survey-targeting-section--dark:- hash: v1.k794b7964.291b22007c1e8f4fd06d46e9c7d1f87ae70ebd3ec766328340ad89ea3f2ab16b.xS2De9yYBV2JVrvQlzbqMjD2i3HpALi7iVI7TczcfdI+ hash: v1.k794b7964.a887aac9d5fd267f3d075a0b5a748ac0a73c524bdc8193a562af39cd117af55d.f0-FQf7LxVCSdLWkj_fP7C3NAVU5SmDAaNSd-bMDTwIscenes-app-surveys--new-survey-targeting-section--light:- hash: v1.k794b7964.428c3041d4d8a23ad1faa0c885f06cb34a166c344f7b74c39450107279a68b69.SYss9mta5gXUBO6hDBww3B8CJc0HtI-8EoCgtobBtO0+ hash: v1.k794b7964.0f929dd6be0e5ee3cf4aa20c91e3577b722dc91ceeae64b59535b28a3a0439e7.LcWWtsGpXF7d3Kc_6F9T1vsbxoDxXk6exc7gskunhRwscenes-app-surveys--new-survey-with-html-question-description--dark:hash: v1.k794b7964.70d82e0de54aa3a0982efc2faed7b69936d09f4d24571e270fc6291130ac7af4.SK36SUGAETwqhQUwRQp_oZ8E4AgSWRrZSN5pt-H9xKUscenes-app-surveys--new-survey-with-html-question-description--light:diff --git a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsxindex 5f5a7c5c3f4c..728013907942 100644--- a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx+++ b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx@@ -26,7 +26,7 @@ import { LemonRadio } from 'lib/lemon-ui/LemonRadio'import { LemonSlider } from 'lib/lemon-ui/LemonSlider'import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag'import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'-import { capitalizeFirstLetter, clamp, dateFilterToText, dateStringToComponents, humanFriendlyNumber } from 'lib/utils'+import { capitalizeFirstLetter, clamp, dateFilterToText, dateStringToComponents, pluralize } from 'lib/utils'import { FeatureFlagConditionWarning } from 'scenes/feature-flags/FeatureFlagConditionWarning'import { PercentageInput } from 'scenes/feature-flags/PercentageInput'import { urls } from 'scenes/urls'@@ -126,7 +126,6 @@ export function FeatureFlagReleaseConditions({const {taxonomicGroupTypes,propertySelectErrors,- computeBlastRadiusPercentage,affectedCounts,totalCounts,filtersTaxonomicOptions,@@ -454,50 +453,45 @@ export function FeatureFlagReleaseConditions({propertySelectErrors?.[index]?.rollout_percentage ? 'basis-full h-0' : '')}/>- of <b>{aggregationTargetName(group.aggregation_group_type_index)}</b> in this set. Will- match approximately{' '}- {group.sort_key && affectedCounts[group.sort_key] !== undefined ? (- <b className="tabular-nums">- {`${- Math.max(- computeBlastRadiusPercentage(- Number.isNaN(group.rollout_percentage)- ? 0- : group.rollout_percentage,- group.sort_key- ).toPrecision(2) * 1,- 0- )- // Multiplying by 1 removes trailing zeros after the decimal- // point added by toPrecision- }% `}- </b>- ) : (- <Spinner className="mr-1" />- )}{' '}+ of <b>{aggregationTargetName(group.aggregation_group_type_index)}</b> in this set.{(() => {+ const targetIndex = group.aggregation_group_type_index+ const pluralName = aggregationTargetName(targetIndex)+ const singularName = aggregationLabel(+ targetIndex ?? filters.aggregation_group_type_index,+ true+ ).singularconst affected = group.sort_key ? affectedCounts[group.sort_key] : undefinedconst total = group.sort_key ? totalCounts[group.sort_key] : undefined- if (affected !== undefined && affected >= 0 && total !== undefined) {- const rolloutPct = Number.isNaN(group.rollout_percentage)- ? 0- : (group.rollout_percentage ?? 100)+ if (affected === undefined || affected < 0 || total === undefined) {return (- <span className="tabular-nums">- {`(${humanFriendlyNumber(- Math.floor((affected * clamp(rolloutPct, 0, 100)) / 100)- )} / ${humanFriendlyNumber(total)})`}- </span>+ <div className="basis-full flex items-center mt-1">+ <Spinner />+ </div>)}- return ''- })()}{' '}- <span>of total {aggregationTargetName(group.aggregation_group_type_index)}.</span>- {filters.aggregation_group_type_index == null && (- <Tooltip title={MATCHING_ESTIMATE_TOOLTIP} interactive>- <IconInfo className="text-muted text-xs ml-0.5" />- </Tooltip>- )}+ const rolloutPct = Number.isNaN(group.rollout_percentage)+ ? 0+ : (group.rollout_percentage ?? 100)+ const receivingFlag = Math.floor((affected * clamp(rolloutPct, 0, 100)) / 100)+ return (+ <div className="basis-full flex flex-col mt-1 text-secondary tabular-nums">+ <span>+ Filters match: <b>~{pluralize(affected, singularName, pluralName)}</b>+ {filters.aggregation_group_type_index == null && (+ <Tooltip title={MATCHING_ESTIMATE_TOOLTIP} interactive>+ <IconInfo className="text-muted text-xs ml-0.5" />+ </Tooltip>+ )}+ </span>+ <span>+ Rollout will be to{' '}+ <b>~{pluralize(receivingFlag, singularName, pluralName)}</b> -{' '}+ <b>{rolloutPct}%</b>+ </span>+ </div>+ )+ })()}</div></div>)}diff --git a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsxindex 8036f24d1362..6c8561f59c67 100644--- a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx+++ b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx@@ -54,9 +54,9 @@ import { LemonSlider } from 'lib/lemon-ui/LemonSlider'import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag'import { Link } from 'lib/lemon-ui/Link'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'-import { humanFriendlyNumber } from 'lib/utils'-import { clamp } from 'lib/utils'+import { clamp, humanFriendlyNumber, pluralize } from 'lib/utils'+import { groupsModel } from '~/models/groupsModel'import {AnyPropertyFilter,FeatureFlagBucketingIdentifier,@@ -435,6 +435,7 @@ const ConditionContent = ({}): JSX.Element => {const [originalWidth, setOriginalWidth] = useState<number | undefined>(undefined)const realtimeCohortFlagTargeting = useFeatureFlag('REALTIME_COHORT_FLAG_TARGETING')+ const { aggregationLabel } = useValues(groupsModel)// Combined ref callbackconst combinedRef = (element: HTMLDivElement | null): void => {@@ -475,6 +476,10 @@ const ConditionContent = ({}const resolvedTargetName = aggregationTargetName(group.aggregation_group_type_index)+ const resolvedSingularTargetName = aggregationLabel(+ group.aggregation_group_type_index ?? releaseFilters.aggregation_group_type_index,+ true+ ).singularreturn (<div@@ -665,45 +670,44 @@ const ConditionContent = ({const receivingFlag = Math.floor((affected * clamp(rolloutPct, 0, 100)) / 100)- if (rolloutPct === 100) {- return (- <>+ return (+ <div className="flex flex-col">+ <span>+ Filters match:{' '}+ <b className="tabular-nums">+ ~+ {pluralize(+ affected,+ resolvedSingularTargetName,+ resolvedTargetName+ )}+ </b>+ {(group.aggregation_group_type_index ??+ releaseFilters.aggregation_group_type_index) ==+ null && (+ <Tooltip+ title={MATCHING_ESTIMATE_TOOLTIP}+ interactive+ >+ <IconInfo className="text-muted text-xs ml-0.5" />+ </Tooltip>+ )}+ </span>+ <span>+ Rollout will be to{' '}<b className="tabular-nums">- {humanFriendlyNumber(affected)}+ ~+ {pluralize(+ receivingFlag,+ resolvedSingularTargetName,+ resolvedTargetName+ )}</b>{' '}- of{' '}- <span className="tabular-nums">- {humanFriendlyNumber(total)}- </span>{' '}- {resolvedTargetName} match these filters- </>- )- }- return (- <>- Will match ~- <b className="tabular-nums">- {humanFriendlyNumber(receivingFlag)}- </b>{' '}- of{' '}- <span className="tabular-nums">- {humanFriendlyNumber(total)}- </span>{' '}- {resolvedTargetName} (- <span className="tabular-nums">{rolloutPct}%</span> of{' '}- <span className="tabular-nums">- {humanFriendlyNumber(affected)}- </span>{' '}- matching the filters)- </>+ - <b className="tabular-nums">{rolloutPct}%</b>+ </span>+ </div>)})()}- {(group.aggregation_group_type_index ??- releaseFilters.aggregation_group_type_index) == null && (- <Tooltip title={MATCHING_ESTIMATE_TOOLTIP} interactive>- <IconInfo className="text-muted text-xs ml-0.5" />- </Tooltip>- )}</div>) : (<div className="text-xs text-muted mt-2 flex items-center gap-1">