Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 0 additions & 17 deletions browser_tests/tests/dialogs/shareWorkflowDialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ const PRIVATE_ASSET: AssetInfo = {

const test = comfyPageFixture

/**
* Enable the workflow_sharing_enabled server feature flag at runtime.
* FeatureFlagHelper.mockServerFeatures() intercepts `/api/features` but the
* flags are already loaded by the time tests run, so direct mutation of the
* reactive ref is the only reliable approach for server-side flags.
*/
async function enableWorkflowSharing(page: Page): Promise<void> {
await page.evaluate(() => {
const api = window.app!.api
api.serverFeatureFlags.value = {
...api.serverFeatureFlags.value,
workflow_sharing_enabled: true
}
})
}

async function mockPublishStatus(
page: Page,
record: PublishRecord | null
Expand Down Expand Up @@ -150,7 +134,6 @@ async function saveAndWait(
}

async function openShareDialog(page: Page): Promise<void> {
await enableWorkflowSharing(page)
await dismissOverlays(page)
const shareButton = page.getByRole('button', { name: 'Share workflow' })
await shareButton.click()
Expand Down
6 changes: 2 additions & 4 deletions src/components/TopMenuSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
/>
</Button>
<Button
v-if="isCloud && flags.workflowSharingEnabled"
v-if="isCloud"
v-tooltip.bottom="shareTooltipConfig"
variant="secondary"
size="icon"
Expand Down Expand Up @@ -194,7 +194,6 @@ import { useQueueUIStore } from '@/stores/queueStore'
import { useRightSidePanelStore } from '@/stores/workspace/rightSidePanelStore'
import { useWorkspaceStore } from '@/stores/workspaceStore'
import { isCloud } from '@/platform/distribution/types'
import { useFeatureFlags } from '@/composables/useFeatureFlags'
import {
openShareDialog,
prefetchShareDialog
Expand All @@ -214,7 +213,6 @@ const isActionBarsHidden = computed(
)
const managerState = useManagerState()
const managerSurveyDialog = useManagerSurveyDialog()
const { flags } = useFeatureFlags()
const { isLoggedIn } = useCurrentUser()
const { t } = useI18n()
const { toastErrorHandler } = useErrorHandling()
Expand Down Expand Up @@ -244,7 +242,7 @@ const hasDockedButtons = computed(() => {
if (hasLegacyContent.value) return true
if (!isIntegratedTabBar.value) return true
if (managerState.shouldShowExtensionsButton.value) return true
if (isCloud && flags.workflowSharingEnabled) return true
if (isCloud) return true
if (!isRightSidePanelOpen.value) return true
return false
})
Expand Down
1 change: 0 additions & 1 deletion src/composables/__mocks__/useFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const defaultFlags: FeatureFlags = {
userSecretsEnabled: false,
nodeReplacementsEnabled: false,
nodeLibraryEssentialsEnabled: false,
workflowSharingEnabled: false,
comfyHubUploadEnabled: false,
comfyHubProfileGateEnabled: false,
hostedBillingDestination: 'stripe',
Expand Down
4 changes: 2 additions & 2 deletions src/composables/useFeatureFlags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,14 +1157,14 @@ describe('useFeatureFlags', () => {

it('applies a false override instead of falling through to an enabled server value', () => {
vi.mocked(getSessionOverride).mockImplementation((flagKey) =>
flagKey === ServerFeatureFlag.WORKFLOW_SHARING_ENABLED
flagKey === ServerFeatureFlag.NODE_LIBRARY_ESSENTIALS_ENABLED
? false
: undefined
)
vi.mocked(api.getServerFeature).mockReturnValue(true)

const { flags } = useFeatureFlags()
expect(flags.workflowSharingEnabled).toBe(false)
expect(flags.nodeLibraryEssentialsEnabled).toBe(false)
})

it('turns the linear toggle off against an enabled remote config', () => {
Expand Down
12 changes: 0 additions & 12 deletions src/composables/useFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export enum ServerFeatureFlag {
USER_SECRETS_ENABLED = 'user_secrets_enabled',
NODE_REPLACEMENTS = 'node_replacements',
NODE_LIBRARY_ESSENTIALS_ENABLED = 'node_library_essentials_enabled',
WORKFLOW_SHARING_ENABLED = 'workflow_sharing_enabled',
COMFYHUB_UPLOAD_ENABLED = 'comfyhub_upload_enabled',
COMFYHUB_PROFILE_GATE_ENABLED = 'comfyhub_profile_gate_enabled',
HOSTED_BILLING_DESTINATION = 'hosted_billing_destination',
Expand Down Expand Up @@ -241,15 +240,6 @@ export function useFeatureFlags() {
isNightly || import.meta.env.DEV
)
},
get workflowSharingEnabled() {
// UI is also gated on `isCloud` in TopMenuSection; default false
// to match other flags' opt-in convention.
return resolveFlag(
ServerFeatureFlag.WORKFLOW_SHARING_ENABLED,
remoteConfig.value.workflow_sharing_enabled,
false
)
},
get comfyHubUploadEnabled() {
return resolveFlag(
ServerFeatureFlag.COMFYHUB_UPLOAD_ENABLED,
Expand Down Expand Up @@ -440,8 +430,6 @@ export function startFeatureFlagTelemetry() {
[ServerFeatureFlag.NODE_REPLACEMENTS]: flags.nodeReplacementsEnabled,
[ServerFeatureFlag.NODE_LIBRARY_ESSENTIALS_ENABLED]:
flags.nodeLibraryEssentialsEnabled,
[ServerFeatureFlag.WORKFLOW_SHARING_ENABLED]:
flags.workflowSharingEnabled,
[ServerFeatureFlag.COMFYHUB_UPLOAD_ENABLED]: flags.comfyHubUploadEnabled,
[ServerFeatureFlag.COMFYHUB_PROFILE_GATE_ENABLED]:
flags.comfyHubProfileGateEnabled,
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useWorkflowActionsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function useWorkflowActionsMenu(
label: t('breadcrumbsMenu.share'),
icon: 'icon-[comfy--send]',
command: () => openShareDialog().catch(toastErrorHandler),
visible: isCloud && flags.workflowSharingEnabled
visible: isCloud
})

addItem({
Expand Down
1 change: 0 additions & 1 deletion src/platform/remoteConfig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export type RemoteConfig = Partial<GetFeaturesResponses[200]> & {
free_tier_credits?: number
free_tier_job_allowance_enabled?: boolean
new_free_tier_subscriptions?: boolean
workflow_sharing_enabled?: boolean
comfyhub_upload_enabled?: boolean
comfyhub_profile_gate_enabled?: boolean
// Raw, unvalidated wire value ('stripe' | 'billing_web' by contract). Always
Expand Down
1 change: 0 additions & 1 deletion src/storybook/mocks/useFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export enum ServerFeatureFlag {
USER_SECRETS_ENABLED = 'user_secrets_enabled',
NODE_REPLACEMENTS = 'node_replacements',
NODE_LIBRARY_ESSENTIALS_ENABLED = 'node_library_essentials_enabled',
WORKFLOW_SHARING_ENABLED = 'workflow_sharing_enabled',
COMFYHUB_UPLOAD_ENABLED = 'comfyhub_upload_enabled',
COMFYHUB_PROFILE_GATE_ENABLED = 'comfyhub_profile_gate_enabled',
HOSTED_BILLING_DESTINATION = 'hosted_billing_destination',
Expand Down
6 changes: 3 additions & 3 deletions src/utils/sessionFeatureFlagOverride.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ describe('getSessionOverride', () => {
})

it('applies every flag in a repeated query param', () => {
visit('/?ff=workflow_sharing_enabled&ff=signup_turnstile:shadow')
visit('/?ff=user_secrets_enabled&ff=signup_turnstile:shadow')

expect(getSessionOverride('workflow_sharing_enabled')).toBe(true)
expect(getSessionOverride('user_secrets_enabled')).toBe(true)
expect(getSessionOverride('signup_turnstile')).toBe('shadow')
})

it('returns undefined for a flag nobody requested', () => {
visit('/?ff=onboarding_tour_enabled')

expect(getSessionOverride('workflow_sharing_enabled')).toBeUndefined()
expect(getSessionOverride('user_secrets_enabled')).toBeUndefined()
})

it('survives navigation away from the ?ff= URL', () => {
Expand Down
Loading