From 27d15659a6d5441e76e4a061772e97abb0835de6 Mon Sep 17 00:00:00 2001 From: Simula_r <18093452+simula-r@users.noreply.github.com> Date: Tue, 20 Jan 2026 19:19:48 -0800 Subject: [PATCH] [backport core/1.37] feat: add isCloud guard to team workspaces feature flag (#8201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Backport of #8192 to core/1.37 - Ensures the team_workspaces_enabled feature flag only returns true when running in cloud environment - Prevents the feature from activating in local/desktop installations - Added team_workspaces_enabled type to RemoteConfig (required dependency for the feature) ## Conflict Resolution - **src/composables/useFeatureFlags.ts**: Added TEAM_WORKSPACES_ENABLED enum and teamWorkspacesEnabled getter with isCloud guard - **src/platform/assets/components/MediaAssetFilterBar.vue**: Accepted PR version with wrapper div and shorthand prop syntax - **src/platform/remoteConfig/types.ts**: Added team_workspaces_enabled type (required for TypeScript compilation) ## Test plan - Verify feature flag returns false when not in cloud environment - Verify feature flag works correctly in cloud environment ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8201-backport-core-1-37-feat-add-isCloud-guard-to-team-workspaces-feature-flag-2ef6d73d36508108be9acdeaf01b2da8) by [Unito](https://www.unito.io) Co-authored-by: Claude Opus 4.5 --- src/composables/useFeatureFlags.ts | 12 +++- .../assets/components/MediaAssetFilterBar.vue | 62 ++++++++++--------- src/platform/remoteConfig/types.ts | 1 + 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/composables/useFeatureFlags.ts b/src/composables/useFeatureFlags.ts index 3388140ad..2fd2d6137 100644 --- a/src/composables/useFeatureFlags.ts +++ b/src/composables/useFeatureFlags.ts @@ -1,5 +1,6 @@ import { computed, reactive, readonly } from 'vue' +import { isCloud } from '@/platform/distribution/types' import { remoteConfig } from '@/platform/remoteConfig/remoteConfig' import { api } from '@/scripts/api' @@ -16,7 +17,8 @@ export enum ServerFeatureFlag { PRIVATE_MODELS_ENABLED = 'private_models_enabled', ONBOARDING_SURVEY_ENABLED = 'onboarding_survey_enabled', HUGGINGFACE_MODEL_IMPORT_ENABLED = 'huggingface_model_import_enabled', - ASYNC_MODEL_UPLOAD_ENABLED = 'async_model_upload_enabled' + ASYNC_MODEL_UPLOAD_ENABLED = 'async_model_upload_enabled', + TEAM_WORKSPACES_ENABLED = 'team_workspaces_enabled' } /** @@ -85,6 +87,14 @@ export function useFeatureFlags() { false ) ) + }, + get teamWorkspacesEnabled() { + if (!isCloud) return false + + return ( + remoteConfig.value.team_workspaces_enabled ?? + api.getServerFeature(ServerFeatureFlag.TEAM_WORKSPACES_ENABLED, false) + ) } }) diff --git a/src/platform/assets/components/MediaAssetFilterBar.vue b/src/platform/assets/components/MediaAssetFilterBar.vue index 6a0fcdb93..a933bda84 100644 --- a/src/platform/assets/components/MediaAssetFilterBar.vue +++ b/src/platform/assets/components/MediaAssetFilterBar.vue @@ -5,36 +5,38 @@ :placeholder="$t('sideToolbar.searchAssets') + '...'" @update:model-value="handleSearchChange" /> - - - - - - - +
+ + + + + + + +
diff --git a/src/platform/remoteConfig/types.ts b/src/platform/remoteConfig/types.ts index f4e51115b..bd51e9af6 100644 --- a/src/platform/remoteConfig/types.ts +++ b/src/platform/remoteConfig/types.ts @@ -41,4 +41,5 @@ export type RemoteConfig = { onboarding_survey_enabled?: boolean huggingface_model_import_enabled?: boolean async_model_upload_enabled?: boolean + team_workspaces_enabled?: boolean }