From 02ee94c38f7615811aec4c58e40e05989015276d Mon Sep 17 00:00:00 2001 From: "unleash-bot[bot]" <194219037+unleash-bot[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 12:43:43 +0000 Subject: [PATCH] chore(AI): createFlagDialogCache flag cleanup (#10509) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR cleans up the createFlagDialogCache flag. These changes were automatically generated by AI and should be reviewed carefully. Fixes #10504 ## ๐Ÿงน AI Flag Cleanup Summary This change removes the `createFlagDialogCache` feature flag, making its functionality permanent. The create-feature-flag dialog will now always cache its state in local storage. ### ๐Ÿšฎ Removed - **TypeScript Definitions** - Removed `createFlagDialogCache` from `UiFlags` in `frontend/src/interfaces/uiConfig.ts`. - Removed `createFlagDialogCache` from `IFlagKey` in `src/lib/types/experimental.ts`. - **Flag Configuration** - Removed the `createFlagDialogCache` flag definition from `src/lib/types/experimental.ts`. - **Conditional Logic** - Removed the `useUiFlag` hook and conditional logic for caching in `frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFe atureTogglesHeader/CreateFeatureDialog.tsx`. ### ๐Ÿ›  Kept - **Feature Functionality** - The feature of caching the create-flag dialog's form state in local storage is now always enabled. ### ๐Ÿ“ Why The `createFlagDialogCache` feature has been successfully rolled out and is now considered stable. This cleanup removes the obsolete feature flag and hardcodes the enabled behavior, simplifying the codebase. Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com> Co-authored-by: Thomas Heartman --- .../ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx | 4 +--- frontend/src/interfaces/uiConfig.ts | 1 - src/lib/types/experimental.ts | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx index 37ccb9d528..60025759fd 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx @@ -33,7 +33,6 @@ import { useFlagLimits } from './useFlagLimits.tsx'; import { useFeatureCreatedFeedback } from './hooks/useFeatureCreatedFeedback.ts'; import { formatTag } from 'utils/format-tag'; import { useLocalStorageState } from 'hooks/useLocalStorageState.ts'; -import { useUiFlag } from 'hooks/useUiFlag.ts'; interface ICreateFeatureDialogProps { open: boolean; @@ -112,9 +111,8 @@ const CreateFeatureDialogContent = ({ {}, 60 * 60 * 1000, // <- 1 hour ); - const useFlagCreationCache = useUiFlag('createFlagDialogCache'); - const initialData = useFlagCreationCache ? storedFlagConfig : {}; + const initialData = storedFlagConfig; const { type, diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 4b818877f1..3701ac3696 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -86,7 +86,6 @@ export type UiFlags = { consumptionModelUI?: boolean; edgeObservability?: boolean; customMetrics?: boolean; - createFlagDialogCache?: boolean; impactMetrics?: boolean; changeRequestApproverEmails?: boolean; reportUnknownFlags?: boolean; diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 4a12f31830..9790f7458a 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -56,7 +56,6 @@ export type IFlagKey = | 'reportUnknownFlags' | 'customMetrics' | 'impactMetrics' - | 'createFlagDialogCache' | 'changeRequestApproverEmails' | 'paygTrialEvents' | 'paygInstanceStatsEvents' @@ -260,10 +259,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS, false, ), - createFlagDialogCache: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_CREATE_FLAG_DIALOG_CACHE, - false, - ), changeRequestApproverEmails: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_APPROVER_EMAILS, false,