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(feature-flags): move duplicate/remove into kebab on collapsed condition row (#57232)

Dylan Martinf9d64f3a2719
diff --git a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx
index bd0a9fd94ac2..97463c2b0df7 100644
--- a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx
+++ b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditionsCollapsible.tsx
@@ -19,6 +19,7 @@ import {
IconBalance,
IconCollapse,
IconCopy,
+ IconEllipsis,
IconExpand,
IconInfo,
IconLaptop,
@@ -28,7 +29,16 @@ import {
IconTrash,
IconCheckCircle,
} from '@posthog/icons'
-import { LemonBanner, LemonButton, LemonInput, LemonLabel, LemonSelect, Spinner, Tooltip } from '@posthog/lemon-ui'
+import {
+ LemonBanner,
+ LemonButton,
+ LemonInput,
+ LemonLabel,
+ LemonMenu,
+ LemonSelect,
+ Spinner,
+ Tooltip,
+} from '@posthog/lemon-ui'
import { allOperatorsToHumanName } from 'lib/components/DefinitionPopover/utils'
import { EditableField } from 'lib/components/EditableField/EditableField'
@@ -171,28 +181,33 @@ function ConditionHeader({
({rollout}%{group.variant && ` · ${group.variant}`}
{countSummary !== null && ` · ${countSummary}`})
</span>
- <LemonButton
- icon={<IconCopy />}
- size="xsmall"
- noPadding
- tooltip="Duplicate condition set"
- onClick={(e) => {
- e.stopPropagation()
- onDuplicate()
- }}
- />
- {totalGroups > 1 && (
+ <LemonMenu
+ items={[
+ {
+ label: 'Duplicate condition set',
+ icon: <IconCopy />,
+ onClick: onDuplicate,
+ },
+ ...(totalGroups > 1
+ ? [
+ {
+ label: 'Remove condition set',
+ icon: <IconTrash />,
+ onClick: onRemove,
+ status: 'danger' as const,
+ },
+ ]
+ : []),
+ ]}
+ >
<LemonButton
- icon={<IconTrash />}
+ icon={<IconEllipsis />}
size="xsmall"
noPadding
- tooltip="Remove condition set"
- onClick={(e) => {
- e.stopPropagation()
- onRemove()
- }}
+ aria-label="Condition set actions"
+ onClick={(e) => e.stopPropagation()}
/>
- )}
+ </LemonMenu>
</div>
</div>
)