From 8ddeed09fb2862446632f536bf138190f55a1c9d Mon Sep 17 00:00:00 2001 From: "unleash-bot[bot]" <194219037+unleash-bot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 09:01:59 +0100 Subject: [PATCH] chore(AI): projectListViewToggle flag cleanup (#10527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR cleans up the projectListViewToggle flag. These changes were automatically generated by AI and should be reviewed carefully. Fixes #10526 ## ๐Ÿงน AI Flag Cleanup Summary This change removes the `projectListViewToggle` feature flag and hardcodes its behavior. The feature, which allows toggling between card and list views for projects, is now permanently enabled. ### ๐Ÿšฎ Removed - **Flag Definitions** - Removed `projectListViewToggle` from `src/server-dev.ts`, `src/lib/types/experimental.ts`, and `frontend/src/interfaces/uiConfig.ts`. - **Hooks & Conditionals** - Removed `useUiFlag('projectListViewToggle')` calls from `ProjectGroup.tsx` and `ProjectList.tsx`. - Removed conditional rendering logic based on the flag in `ProjectGroup.tsx` and `ProjectList.tsx`. ### ๐Ÿ›  Kept - **Project List View** - The project list view functionality is now always available for non-OSS versions of Unleash. - The `ProjectsListViewToggle` component is now always rendered when not in an OSS environment. ### ๐Ÿ“ Why The `projectListViewToggle` feature flag was marked as completed and its intended outcome was to be kept. The code has been updated to reflect this by removing the flag and making the feature a permanent part of the application. This simplifies the codebase by removing dead code paths and feature flag checks. Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com> --- .../project/ProjectList/ProjectGroup.tsx | 4 +--- .../project/ProjectList/ProjectList.tsx | 19 ++++++++----------- frontend/src/interfaces/uiConfig.ts | 1 - src/lib/types/experimental.ts | 5 ----- src/server-dev.ts | 1 - 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/frontend/src/component/project/ProjectList/ProjectGroup.tsx b/frontend/src/component/project/ProjectList/ProjectGroup.tsx index 5bbfb0f3ad..11b3651d1a 100644 --- a/frontend/src/component/project/ProjectList/ProjectGroup.tsx +++ b/frontend/src/component/project/ProjectList/ProjectGroup.tsx @@ -8,7 +8,6 @@ import { UpgradeProjectCard } from '../ProjectCard/UpgradeProjectCard.tsx'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import type { ProjectsListView } from './hooks/useProjectsListState.ts'; import { ProjectsListTable } from './ProjectsListTable/ProjectsListTable.tsx'; -import { useUiFlag } from 'hooks/useUiFlag.ts'; const StyledGridContainer = styled('div')(({ theme }) => ({ display: 'grid', @@ -47,11 +46,10 @@ export const ProjectGroup = ({ }: ProjectGroupProps) => { const ProjectCard = ProjectCardComponent ?? DefaultProjectCard; const { isOss } = useUiConfig(); - const projectListViewToggleEnabled = useUiFlag('projectListViewToggle'); const projectsToRender = loading ? loadingData : projects; - if (!isOss() && projectListViewToggleEnabled && view === 'list') { + if (!isOss() && view === 'list') { return ; } diff --git a/frontend/src/component/project/ProjectList/ProjectList.tsx b/frontend/src/component/project/ProjectList/ProjectList.tsx index 33ddfaa8a7..580b3261a6 100644 --- a/frontend/src/component/project/ProjectList/ProjectList.tsx +++ b/frontend/src/component/project/ProjectList/ProjectList.tsx @@ -19,7 +19,6 @@ import { ProjectArchiveLink } from './ProjectArchiveLink/ProjectArchiveLink.tsx' import { ProjectsListHeader } from './ProjectsListHeader/ProjectsListHeader.tsx'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { TablePlaceholder } from 'component/common/Table/index.ts'; -import { useUiFlag } from 'hooks/useUiFlag.ts'; import { ProjectsListViewToggle } from './ProjectsListViewToggle/ProjectsListViewToggle.tsx'; const StyledApiError = styled(ApiError)(({ theme }) => ({ @@ -36,7 +35,6 @@ const StyledContainer = styled('div')(({ theme }) => ({ export const ProjectList = () => { const { projects, loading, error, refetch } = useProjects(); const { isOss } = useUiConfig(); - const projectListViewToggleEnabled = useUiFlag('projectListViewToggle'); const isSmallScreen = useMediaQuery(theme.breakpoints.down('md')); @@ -130,15 +128,14 @@ export const ProjectList = () => { helpText='Favorite projects, projects you own, and projects you are a member of' actions={ <> - {projectListViewToggleEnabled && - !isOss() && ( - - setState({ view }) - } - /> - )} + {!isOss() && ( + + setState({ view }) + } + /> + )} diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 3701ac3696..fad9a1f7f0 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -92,7 +92,6 @@ export type UiFlags = { lifecycleGraphs?: boolean; addConfiguration?: boolean; filterFlagsToArchive?: boolean; - projectListViewToggle?: boolean; }; export interface IVersionInfo { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 94e77e7258..7257b00f85 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -60,7 +60,6 @@ export type IFlagKey = | 'lifecycleGraphs' | 'addConfiguration' | 'filterFlagsToArchive' - | 'projectListViewToggle' | 'fetchMode' | 'etagByEnv'; @@ -278,10 +277,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_FILTER_FLAGS_TO_ARCHIVE, false, ), - projectListViewToggle: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_PROJECT_LIST_VIEW_TOGGLE, - false, - ), fetchMode: { name: 'disabled', feature_enabled: false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 497fb0773b..7fc9690898 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -56,7 +56,6 @@ process.nextTick(async () => { impactMetrics: true, lifecycleGraphs: true, addConfiguration: true, - projectListViewToggle: true, }, }, authentication: {