From 09e47cd45a9cfb1fdab523bb09639a73b0b97064 Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Mon, 31 Aug 2026 16:58:33 +0200 Subject: [PATCH] ui : simplify download options to plain memory estimate Replace the device-memory tier badges with the simple memory estimate: each quant tooltip shows the estimated runtime memory and the device/OS chip is dropped, matching the estimateModelMemoryBytes model. Make the download dialog callbacks optional so the component stays presentational until wired to the live status store. Assisted-by: pi --- .../discover/DialogModelDownload.svelte | 14 +- .../discover/ModelsDiscoverDetails.svelte | 7 +- ...odelsDiscoverDetailsDownloadOptions.svelte | 127 +++++------------- .../ModelsDiscoverDetails.stories.svelte | 6 - 4 files changed, 41 insertions(+), 113 deletions(-) diff --git a/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte b/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte index d15278c589..902e5cdc7a 100644 --- a/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte +++ b/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte @@ -31,13 +31,13 @@ /** Error message from a failed start attempt, shown above the footer. */ error?: string | null; /** Fire the download (POST /models). */ - onDownload: () => void; + onDownload?: () => void; /** Cancel the in-flight download (DELETE /models). */ onCancelDownload?: () => void; /** Delete the model from the server cache; offered once finished. */ onDelete?: () => void; /** Dialog was dismissed or the download completed. */ - onClose: () => void; + onClose?: () => void; } let { @@ -102,7 +102,7 @@ return; } - if (!inFlight) onClose(); + if (!inFlight) onClose?.(); } function handleKeydown(event: KeyboardEvent) { @@ -118,7 +118,7 @@ started = true; sawProgress = false; - onDownload(); + onDownload?.(); } async function cancel() { @@ -137,7 +137,7 @@ showDeleteConfirm = false; onDelete?.(); - onClose(); + onClose?.(); } // Latch progress: 'in-flight ending' only means finished once the feed has @@ -150,7 +150,7 @@ $effect(() => { if (phase !== 'finished') return; - const timer = setTimeout(() => onClose(), 600); + const timer = setTimeout(() => onClose?.(), 600); return () => clearTimeout(timer); }); @@ -280,7 +280,7 @@ {/if} {:else} - onClose()}> + onClose?.()}> {#if phase === 'finished'}Close{:else}Cancel{/if} {/if} diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte index b4b5db1c8a..1a6205cfbd 100644 --- a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte +++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte @@ -106,12 +106,7 @@ {modelId} /> - + diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte index 5b9da11818..d5678edf00 100644 --- a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte +++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte @@ -1,14 +1,14 @@