mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Move feature flag to setting
This commit is contained in:
@@ -63,7 +63,6 @@ import { useWorkflowTemplateSelectorDialog } from './useWorkflowTemplateSelector
|
|||||||
const { isActiveSubscription, showSubscriptionDialog } = useSubscription()
|
const { isActiveSubscription, showSubscriptionDialog } = useSubscription()
|
||||||
|
|
||||||
const moveSelectedNodesVersionAdded = '1.22.2'
|
const moveSelectedNodesVersionAdded = '1.22.2'
|
||||||
|
|
||||||
export function useCoreCommands(): ComfyCommand[] {
|
export function useCoreCommands(): ComfyCommand[] {
|
||||||
const workflowService = useWorkflowService()
|
const workflowService = useWorkflowService()
|
||||||
const workflowStore = useWorkflowStore()
|
const workflowStore = useWorkflowStore()
|
||||||
@@ -75,6 +74,7 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
const executionStore = useExecutionStore()
|
const executionStore = useExecutionStore()
|
||||||
const telemetry = useTelemetry()
|
const telemetry = useTelemetry()
|
||||||
const { staticUrls, buildDocsUrl } = useExternalLink()
|
const { staticUrls, buildDocsUrl } = useExternalLink()
|
||||||
|
const settingStore = useSettingStore()
|
||||||
|
|
||||||
const bottomPanelStore = useBottomPanelStore()
|
const bottomPanelStore = useBottomPanelStore()
|
||||||
|
|
||||||
@@ -82,6 +82,14 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
useSelectedLiteGraphItems()
|
useSelectedLiteGraphItems()
|
||||||
const getTracker = () => workflowStore.activeWorkflow?.changeTracker
|
const getTracker = () => workflowStore.activeWorkflow?.changeTracker
|
||||||
|
|
||||||
|
function isQueuePanelV2Enabled() {
|
||||||
|
return settingStore.get('Comfy.Queue.QPOV2')
|
||||||
|
}
|
||||||
|
|
||||||
|
async function toggleQueuePanelV2() {
|
||||||
|
await settingStore.set('Comfy.Queue.QPOV2', !isQueuePanelV2Enabled())
|
||||||
|
}
|
||||||
|
|
||||||
const moveSelectedNodes = (
|
const moveSelectedNodes = (
|
||||||
positionUpdater: (pos: Point, gridSize: number) => Point
|
positionUpdater: (pos: Point, gridSize: number) => Point
|
||||||
) => {
|
) => {
|
||||||
@@ -1175,6 +1183,12 @@ export function useCoreCommands(): ComfyCommand[] {
|
|||||||
await useWorkflowService().reloadCurrentWorkflow() // ensure changes take effect immediately
|
await useWorkflowService().reloadCurrentWorkflow() // ensure changes take effect immediately
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'Comfy.ToggleQPOV2',
|
||||||
|
icon: 'pi pi-list',
|
||||||
|
label: 'Toggle Queue Panel V2',
|
||||||
|
function: toggleQueuePanelV2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'Comfy.ToggleLinear',
|
id: 'Comfy.ToggleLinear',
|
||||||
icon: 'pi pi-database',
|
icon: 'pi pi-database',
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export const isQPOV2Enabled = false
|
|
||||||
@@ -260,6 +260,9 @@
|
|||||||
"Comfy_ToggleLinear": {
|
"Comfy_ToggleLinear": {
|
||||||
"label": "toggle linear mode"
|
"label": "toggle linear mode"
|
||||||
},
|
},
|
||||||
|
"Comfy_ToggleQPOV2": {
|
||||||
|
"label": "Toggle Queue Panel V2"
|
||||||
|
},
|
||||||
"Comfy_ToggleTheme": {
|
"Comfy_ToggleTheme": {
|
||||||
"label": "Toggle Theme (Dark/Light)"
|
"label": "Toggle Theme (Dark/Light)"
|
||||||
},
|
},
|
||||||
@@ -324,4 +327,4 @@
|
|||||||
"label": "Toggle Workflows Sidebar",
|
"label": "Toggle Workflows Sidebar",
|
||||||
"tooltip": "Workflows"
|
"tooltip": "Workflows"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,16 +32,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</AssetSortButton>
|
</AssetSortButton>
|
||||||
<MediaAssetViewModeToggle
|
<MediaAssetViewModeToggle
|
||||||
v-if="isQPOV2Enabled"
|
v-if="isQueuePanelV2Enabled"
|
||||||
v-model:view-mode="viewMode"
|
v-model:view-mode="viewMode"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue'
|
||||||
|
|
||||||
import SearchBox from '@/components/common/SearchBox.vue'
|
import SearchBox from '@/components/common/SearchBox.vue'
|
||||||
import { isQPOV2Enabled } from '@/config/uiFeatureFlags'
|
|
||||||
import { isCloud } from '@/platform/distribution/types'
|
import { isCloud } from '@/platform/distribution/types'
|
||||||
|
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||||
|
|
||||||
import MediaAssetFilterButton from './MediaAssetFilterButton.vue'
|
import MediaAssetFilterButton from './MediaAssetFilterButton.vue'
|
||||||
import MediaAssetFilterMenu from './MediaAssetFilterMenu.vue'
|
import MediaAssetFilterMenu from './MediaAssetFilterMenu.vue'
|
||||||
@@ -64,6 +66,11 @@ const emit = defineEmits<{
|
|||||||
const sortBy = defineModel<SortBy>('sortBy', { required: true })
|
const sortBy = defineModel<SortBy>('sortBy', { required: true })
|
||||||
const viewMode = defineModel<'list' | 'grid'>('viewMode', { required: true })
|
const viewMode = defineModel<'list' | 'grid'>('viewMode', { required: true })
|
||||||
|
|
||||||
|
const settingStore = useSettingStore()
|
||||||
|
const isQueuePanelV2Enabled = computed(() =>
|
||||||
|
settingStore.get('Comfy.Queue.QPOV2')
|
||||||
|
)
|
||||||
|
|
||||||
const handleSearchChange = (value: string | undefined) => {
|
const handleSearchChange = (value: string | undefined) => {
|
||||||
emit('update:searchQuery', value ?? '')
|
emit('update:searchQuery', value ?? '')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1139,5 +1139,13 @@ export const CORE_SETTINGS: SettingParams[] = [
|
|||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
versionAdded: '1.34.1'
|
versionAdded: '1.34.1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'Comfy.Queue.QPOV2',
|
||||||
|
name: 'Queue Panel V2',
|
||||||
|
type: 'hidden',
|
||||||
|
tooltip: 'Enable the new Assets Panel design with list/grid view toggle',
|
||||||
|
defaultValue: false,
|
||||||
|
experimental: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -491,6 +491,7 @@ const zSettings = z.object({
|
|||||||
'Comfy.VueNodes.Enabled': z.boolean(),
|
'Comfy.VueNodes.Enabled': z.boolean(),
|
||||||
'Comfy.VueNodes.AutoScaleLayout': z.boolean(),
|
'Comfy.VueNodes.AutoScaleLayout': z.boolean(),
|
||||||
'Comfy.Assets.UseAssetAPI': z.boolean(),
|
'Comfy.Assets.UseAssetAPI': z.boolean(),
|
||||||
|
'Comfy.Queue.QPOV2': z.boolean(),
|
||||||
'Comfy-Desktop.AutoUpdate': z.boolean(),
|
'Comfy-Desktop.AutoUpdate': z.boolean(),
|
||||||
'Comfy-Desktop.SendStatistics': z.boolean(),
|
'Comfy-Desktop.SendStatistics': z.boolean(),
|
||||||
'Comfy-Desktop.WindowStyle': z.string(),
|
'Comfy-Desktop.WindowStyle': z.string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user