Skip to content
Open
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
20 changes: 20 additions & 0 deletions src/components/actionbar/ComfyActionbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
>
<i class="icon-[lucide--x] size-4" />
</Button>
<Button
v-if="showClearPendingTasksButton"
v-tooltip.bottom="clearPendingTasksTooltipConfig"
variant="destructive"
size="icon"
:disabled="!hasPendingTasks"
:aria-label="$t('menuLabels.Clear Pending Tasks')"
@click="() => commandStore.execute('Comfy.ClearPendingTasks')"
>
<i class="icon-[lucide--list-x] size-4" />
</Button>
</div>
</Panel>

Expand Down Expand Up @@ -77,6 +88,7 @@ import { useSettingStore } from '@/platform/settings/settingStore'
import { useTelemetry } from '@/platform/telemetry'
import { useCommandStore } from '@/stores/commandStore'
import { useExecutionStore } from '@/stores/executionStore'
import { useQueueStore } from '@/stores/queueStore'
import { cn } from '@/utils/tailwindUtil'

import ComfyRunButton from './ComfyRunButton'
Expand All @@ -92,11 +104,15 @@ const emit = defineEmits<{

const settingsStore = useSettingStore()
const commandStore = useCommandStore()
const { hasPendingTasks } = storeToRefs(useQueueStore())
const { t } = useI18n()
const { isIdle: isExecutionIdle } = storeToRefs(useExecutionStore())

const position = computed(() => settingsStore.get('Comfy.UseNewMenu'))
const visible = computed(() => position.value !== 'Disabled')
const showClearPendingTasksButton = computed(() =>
settingsStore.get('Comfy.Queue.ShowClearPendingTasksButton')
)
const isQueuePanelV2Enabled = computed(() =>
settingsStore.get('Comfy.Queue.QPOV2')
)
Expand Down Expand Up @@ -321,6 +337,10 @@ const cancelCurrentJob = async () => {
await commandStore.execute('Comfy.Interrupt')
}

const clearPendingTasksTooltipConfig = computed(() =>
buildTooltipConfig(t('menuLabels.Clear Pending Tasks'))
)

const actionbarClass = computed(() =>
cn(
'w-[200px] border-dashed border-blue-500 opacity-80',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@
"name": "Use the unified job queue in the Assets side panel",
"tooltip": "Replaces the floating job queue panel with an equivalent job queue embedded in the Assets side panel. You can disable this to return to the floating panel layout."
},
"Comfy_Queue_ShowClearPendingTasksButton": {
"name": "Show clear pending tasks button in action bar",
"tooltip": "Adds a clear pending tasks button to the action bar."
},
"Comfy_QueueButton_BatchCountLimit": {
"name": "Batch count limit",
"tooltip": "The maximum number of tasks added to the queue at one button click"
Expand Down
8 changes: 8 additions & 0 deletions src/platform/settings/constants/coreSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,14 @@ export const CORE_SETTINGS: SettingParams[] = [
defaultValue: false,
versionAdded: '1.37.0'
},
{
id: 'Comfy.Queue.ShowClearPendingTasksButton',
category: ['Comfy', 'Queue', 'ShowClearPendingTasksButton'],
defaultValue: false,
name: 'Show clear pending tasks button in action bar',
type: 'boolean',
tooltip: 'Adds a clear pending tasks button to the action bar.'
},
{
id: 'Comfy.Execution.PreviewMethod',
category: ['Comfy', 'Execution', 'PreviewMethod'],
Expand Down
1 change: 1 addition & 0 deletions src/schemas/apiSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ const zSettings = z.object({
'Comfy.QueueButton.BatchCountLimit': z.number(),
'Comfy.Queue.MaxHistoryItems': z.number(),
'Comfy.Queue.History.Expanded': z.boolean(),
'Comfy.Queue.ShowClearPendingTasksButton': z.boolean(),
'Comfy.Keybinding.UnsetBindings': z.array(zKeybinding),
'Comfy.Keybinding.NewBindings': z.array(zKeybinding),
'Comfy.Extension.Disabled': z.array(z.string()),
Expand Down