Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UX: Gate the buttons behind a feature flag
  • Loading branch information
DrJKL committed Dec 1, 2025
commit 23d8ccd3948c2f6138bf96d41354ecfbdd24b12f
6 changes: 5 additions & 1 deletion src/composables/useFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export enum ServerFeatureFlag {
SUPPORTS_PREVIEW_METADATA = 'supports_preview_metadata',
MAX_UPLOAD_SIZE = 'max_upload_size',
MANAGER_SUPPORTS_V4 = 'extension.manager.supports_v4',
MODEL_UPLOAD_BUTTON_ENABLED = 'model_upload_button_enabled'
MODEL_UPLOAD_BUTTON_ENABLED = 'model_upload_button_enabled',
MODEL_EDIT_ENABLED = 'model_edit_enabled'
}

/**
Expand All @@ -31,6 +32,9 @@ export function useFeatureFlags() {
ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED,
false
)
},
get modelEditEnabled() {
return api.getServerFeature(ServerFeatureFlag.MODEL_EDIT_ENABLED, false)
}
})

Expand Down
3 changes: 3 additions & 0 deletions src/platform/assets/components/AssetCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<AssetBadgeGroup :badges="asset.badges" />
<IconGroup
v-if="flags.modelEditEnabled"
:class="
cn(
'absolute top-2 right-2 invisible group-hover:visible',
Expand Down Expand Up @@ -128,6 +129,7 @@ import IconTextButton from '@/components/button/IconTextButton.vue'
import MoreButton from '@/components/button/MoreButton.vue'
import EditableText from '@/components/common/EditableText.vue'
import { showConfirmDialog } from '@/components/dialog/confirm/confirmDialog'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import AssetBadgeGroup from '@/platform/assets/components/AssetBadgeGroup.vue'
import type { AssetDisplayItem } from '@/platform/assets/composables/useAssetBrowser'
import { assetService } from '@/platform/assets/services/assetService'
Expand All @@ -147,6 +149,7 @@ defineEmits<{
const { t } = useI18n()
const settingStore = useSettingStore()
const { closeDialog } = useDialogStore()
const { flags } = useFeatureFlags()

const dropdownMenuButton = useTemplateRef<InstanceType<typeof MoreButton>>(
'dropdown-menu-button'
Expand Down