diff --git a/tools/ui/src/lib/components/app/dialogs/DialogConfirmDownload.svelte b/tools/ui/src/lib/components/app/dialogs/DialogConfirmDownload.svelte new file mode 100644 index 0000000000..a76d5c3fa1 --- /dev/null +++ b/tools/ui/src/lib/components/app/dialogs/DialogConfirmDownload.svelte @@ -0,0 +1,60 @@ + + + diff --git a/tools/ui/src/lib/components/app/dialogs/index.ts b/tools/ui/src/lib/components/app/dialogs/index.ts index e3963ba499..5f05f91750 100644 --- a/tools/ui/src/lib/components/app/dialogs/index.ts +++ b/tools/ui/src/lib/components/app/dialogs/index.ts @@ -108,6 +108,17 @@ export { default as DialogExportSettings } from './DialogExportSettings.svelte'; */ export { default as DialogConfirmation } from './DialogConfirmation.svelte'; +/** + * **DialogConfirmDownload** - Confirm a destructive download action + * + * Shared confirmation for stopping/cancelling an in-flight download or deleting + * a downloaded model, used by the discover quant chips and the model selector's + * download rows so both word the action identically. Owns the copy and the + * default store removal; render one instance per surface keyed by the acted-on + * repo:tag. + */ +export { default as DialogConfirmDownload } from './DialogConfirmDownload.svelte'; + /** * **DialogConversationRename** - Rename a conversation * diff --git a/tools/ui/src/lib/components/app/models/ModelsSelector/ModelsSelectorDownloadItem.svelte b/tools/ui/src/lib/components/app/models/ModelsSelector/ModelsSelectorDownloadItem.svelte index 963c380937..a4ff0150ca 100644 --- a/tools/ui/src/lib/components/app/models/ModelsSelector/ModelsSelectorDownloadItem.svelte +++ b/tools/ui/src/lib/components/app/models/ModelsSelector/ModelsSelectorDownloadItem.svelte @@ -3,7 +3,6 @@ import ModelsDiscoverAvatar from '../discover/ModelsDiscoverAvatar.svelte'; import { Loader2, Pause, Play, X } from '@lucide/svelte'; import { ModelId } from '$lib/components/app'; - import DialogConfirmation from '$lib/components/app/dialogs/DialogConfirmation.svelte'; import { HuggingFaceService, ModelsService } from '$lib/services'; import { modelsStore } from '$lib/stores'; import type { ModelDownloadProgress } from '$lib/types'; @@ -11,12 +10,14 @@ interface Props { /** One entry from the status feed: an in-flight or paused download. */ entry: { isPaused: boolean; progress: ModelDownloadProgress | null; repoWithTag: string }; + /** + * Ask the list to confirm cancelling this download. The row owns no dialog; + * the list renders a single shared confirmation. + */ + onRequestCancel?: (repoWithTag: string) => void; } - let { entry }: Props = $props(); - - // cancel confirmation state - let confirmCancelOpen = $state(false); + let { entry, onRequestCancel }: Props = $props(); let percent = $derived( entry.progress && entry.progress.totalBytes > 0 @@ -105,7 +106,7 @@