diff --git a/src/components/queue/QueueOverlayExpanded.vue b/src/components/queue/QueueOverlayExpanded.vue index 1d20040983..fad53db111 100644 --- a/src/components/queue/QueueOverlayExpanded.vue +++ b/src/components/queue/QueueOverlayExpanded.vue @@ -4,12 +4,14 @@ :header-title="headerTitle" :show-concurrent-indicator="showConcurrentIndicator" :concurrent-workflow-count="concurrentWorkflowCount" + :queued-count="queuedCount" @clear-history="$emit('clearHistory')" + @clear-queued="$emit('clearQueued')" /> -
+
-
-
- {{ queuedCount }} - {{ - t('sideToolbar.queueProgressOverlay.queuedSuffix') - }} -
- -
headerTitle: 'Job queue', showConcurrentIndicator: true, concurrentWorkflowCount: 2, + queuedCount: 3, ...props }, global: { @@ -80,6 +83,25 @@ describe('QueueOverlayHeader', () => { expect(wrapper.find('.inline-flex.items-center.gap-1').exists()).toBe(false) }) + it('shows queued summary and emits clear queued', async () => { + const wrapper = mountHeader({ queuedCount: 4 }) + + expect(wrapper.text()).toContain('4') + expect(wrapper.text()).toContain('queued') + + const clearQueuedButton = wrapper.get('button[aria-label="Clear queued"]') + await clearQueuedButton.trigger('click') + expect(wrapper.emitted('clearQueued')).toHaveLength(1) + }) + + it('hides clear queued button when queued count is zero', () => { + const wrapper = mountHeader({ queuedCount: 0 }) + + expect(wrapper.find('button[aria-label="Clear queued"]').exists()).toBe( + false + ) + }) + it('toggles popover and emits clear history', async () => { const spy = vi.spyOn(tooltipConfig, 'buildTooltipConfig') diff --git a/src/components/queue/QueueOverlayHeader.vue b/src/components/queue/QueueOverlayHeader.vue index 9ae82346a3..999b551e4d 100644 --- a/src/components/queue/QueueOverlayHeader.vue +++ b/src/components/queue/QueueOverlayHeader.vue @@ -1,8 +1,8 @@