mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-11 00:10:40 +00:00
feat: Add cancel button to active job card in grid view (#8264)
## Summary Add a cancel (x) button overlay to active job cards in grid view, matching the existing list view behavior. ## Changes - **What**: Added hover-triggered cancel button to `ActiveJobCard.vue` using the existing `useJobActions` composable - Button appears on hover for jobs in cancellable states (pending, initialization, running) <img width="1710" height="1107" alt="스크린샷 2026-01-23 오후 5 11 04" src="https://github.com/user-attachments/assets/31a6b6d1-46e7-49c4-a253-92260cb28514" /> <img width="1710" height="1107" alt="스크린샷 2026-01-23 오후 5 10 59" src="https://github.com/user-attachments/assets/b559a81e-8e62-4858-b8e7-92de9caa2919" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8264-feat-Add-cancel-button-to-active-job-card-in-grid-view-2f16d73d3650817d83f0dd3b955759cb) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { computed } from 'vue'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
@@ -6,6 +7,18 @@ import ActiveJobCard from './ActiveMediaAssetCard.vue'
|
||||
|
||||
import type { JobListItem } from '@/composables/queue/useJobList'
|
||||
|
||||
vi.mock('@/composables/queue/useJobActions', () => ({
|
||||
useJobActions: () => ({
|
||||
cancelAction: {
|
||||
icon: 'icon-[lucide--x]',
|
||||
label: 'Cancel',
|
||||
variant: 'destructive'
|
||||
},
|
||||
canCancelJob: computed(() => false),
|
||||
runCancelJob: vi.fn()
|
||||
})
|
||||
}))
|
||||
|
||||
vi.mock('@/composables/useProgressBarBackground', () => ({
|
||||
useProgressBarBackground: () => ({
|
||||
progressBarPrimaryClass: 'bg-blue-500',
|
||||
|
||||
Reference in New Issue
Block a user