From 17bd5f527a496a61590c07fbebd11a0cd4ae7d37 Mon Sep 17 00:00:00 2001 From: Jin Yi Date: Wed, 28 Jan 2026 12:25:57 +0900 Subject: [PATCH] feat: Add cancel button to active job card in grid view (#8264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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) 스크린샷 2026-01-23 오후 5 11 04 스크린샷 2026-01-23 오후 5 10 59 ┆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 --- .../components/ActiveMediaAssetCard.test.ts | 13 +++++++++++ .../components/ActiveMediaAssetCard.vue | 23 ++++++++++++++++++- .../composables/useMediaAssetActions.test.ts | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/platform/assets/components/ActiveMediaAssetCard.test.ts b/src/platform/assets/components/ActiveMediaAssetCard.test.ts index c653ae0be..c00d319ed 100644 --- a/src/platform/assets/components/ActiveMediaAssetCard.test.ts +++ b/src/platform/assets/components/ActiveMediaAssetCard.test.ts @@ -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', diff --git a/src/platform/assets/components/ActiveMediaAssetCard.vue b/src/platform/assets/components/ActiveMediaAssetCard.vue index 8121d9bc3..8d68b41ff 100644 --- a/src/platform/assets/components/ActiveMediaAssetCard.vue +++ b/src/platform/assets/components/ActiveMediaAssetCard.vue @@ -1,8 +1,13 @@