-
-
-
-
(),
- {
- menuHovered: false
- }
-)
+const { expanded } = defineProps<{
+ expanded?: boolean
+}>()
const emit = defineEmits<{
(e: 'update:expanded', value: boolean): void
@@ -110,20 +80,11 @@ const assetsStore = useAssetsStore()
const assetSelectionStore = useAssetSelectionStore()
const { wrapWithErrorHandlingAsync } = useErrorHandling()
-const {
- totalPercentFormatted,
- currentNodePercentFormatted,
- totalProgressStyle,
- currentNodeProgressStyle
-} = useQueueProgress()
-const isHovered = ref(false)
-const isOverlayHovered = computed(() => isHovered.value || props.menuHovered)
const internalExpanded = ref(false)
const isExpanded = computed({
- get: () =>
- props.expanded === undefined ? internalExpanded.value : props.expanded,
+ get: () => (expanded === undefined ? internalExpanded.value : expanded),
set: (value) => {
- if (props.expanded === undefined) {
+ if (expanded === undefined) {
internalExpanded.value = value
}
emit('update:expanded', value)
@@ -131,44 +92,15 @@ const isExpanded = computed({
})
const { summary: completionSummary, clearSummary } = useCompletionSummary()
-const hasCompletionSummary = computed(() => completionSummary.value !== null)
+const isOverlayVisible = computed(
+ () => isExpanded.value || completionSummary.value !== null
+)
const runningCount = computed(() => queueStore.runningTasks.length)
const queuedCount = computed(() => queueStore.pendingTasks.length)
const isExecuting = computed(() => !executionStore.isIdle)
const hasActiveJob = computed(() => runningCount.value > 0 || isExecuting.value)
const activeJobsCount = computed(() => runningCount.value + queuedCount.value)
-
-const overlayState = computed(() => {
- if (isExpanded.value) return 'expanded'
- if (hasActiveJob.value) return 'active'
- if (hasCompletionSummary.value) return 'empty'
- return 'hidden'
-})
-
-const showBackground = computed(
- () =>
- overlayState.value === 'expanded' ||
- overlayState.value === 'empty' ||
- (overlayState.value === 'active' && isOverlayHovered.value)
-)
-
-const isVisible = computed(() => overlayState.value !== 'hidden')
-
-const containerClass = computed(() =>
- showBackground.value
- ? 'border-interface-stroke bg-interface-panel-surface shadow-interface'
- : 'border-transparent bg-transparent shadow-none'
-)
-
-const bottomRowClass = computed(
- () =>
- `flex items-center justify-end gap-4 transition-opacity duration-200 ease-in-out ${
- overlayState.value === 'active' && isOverlayHovered.value
- ? 'opacity-100 pointer-events-auto'
- : 'opacity-0 pointer-events-none'
- }`
-)
const headerTitle = computed(() =>
hasActiveJob.value
? `${activeJobsCount.value} ${t('sideToolbar.queueProgressOverlay.activeJobsSuffix')}`
@@ -188,8 +120,7 @@ const {
selectedSortMode,
hasFailedJobs,
filteredTasks,
- groupedJobItems,
- currentNodeName
+ groupedJobItems
} = useJobList()
const displayedJobGroups = computed(() => groupedJobItems.value)
@@ -226,20 +157,8 @@ const {
onViewItem: openResultGallery
} = useResultGallery(() => filteredTasks.value)
-const setExpanded = (expanded: boolean) => {
- isExpanded.value = expanded
-}
-
-const openExpandedFromEmpty = () => {
- setExpanded(true)
-}
-
-const viewAllJobs = () => {
- setExpanded(true)
-}
-
const onSummaryClick = () => {
- openExpandedFromEmpty()
+ isExpanded.value = true
clearSummary()
}
@@ -285,29 +204,6 @@ const cancelQueuedWorkflows = wrapWithErrorHandlingAsync(async () => {
executionStore.clearInitializationByPromptIds(pendingPromptIds)
})
-const interruptAll = wrapWithErrorHandlingAsync(async () => {
- const tasks = queueStore.runningTasks
- const promptIds = tasks
- .map((task) => task.promptId)
- .filter((id): id is string => typeof id === 'string' && id.length > 0)
-
- if (!promptIds.length) return
-
- // Cloud backend supports cancelling specific jobs via /queue delete,
- // while /interrupt always targets the "first" job. Use the targeted API
- // on cloud to ensure we cancel the workflow the user clicked.
- if (isCloud) {
- await Promise.all(promptIds.map((id) => api.deleteItem('queue', id)))
- executionStore.clearInitializationByPromptIds(promptIds)
- await queueStore.update()
- return
- }
-
- await Promise.all(promptIds.map((id) => api.interrupt(id)))
- executionStore.clearInitializationByPromptIds(promptIds)
- await queueStore.update()
-})
-
const showClearHistoryDialog = () => {
dialogStore.showDialog({
key: 'queue-clear-history',