From 671247e783b695fd38dae82e356393322650ceb4 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 3 Feb 2026 14:35:31 -0500 Subject: [PATCH] feat(hosted-files): finalize download button UI with fixed spinner, divider, and alternating status view --- ..._comp__hosted_files_download_button.svelte | 115 ++++++++++++++---- 1 file changed, 93 insertions(+), 22 deletions(-) diff --git a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte index 5d098e42..7b12470d 100644 --- a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte +++ b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte @@ -1,6 +1,7 @@ {#if hosted_file_id && hosted_file_obj} @@ -159,39 +192,77 @@ title={`Download this file:\n${filename ?? hosted_file_obj?.filename}\n[API] SHA256: ${hosted_file_obj?.hash_sha256?.slice(0, 10)}...\nHosted ID: ${file_id}\n Linked to: ${linked_to_type} ID: ${linked_to_id}`} > {#await ae_promises[file_id]} - - - Downloading - {#if $ae_sess.api_download_kv[file_id]} - {$ae_sess.api_download_kv[file_id] - .percent_completed}% - {/if} - : - +
+
+ +
+
+ {#if show_filename_view} +
+ + {ae_util.shorten_filename({ + filename: filename ?? hosted_file_obj?.filename, + max_length: max_length + })} + +
+ {:else} +
+ + Downloading: + {#if $ae_sess.api_download_kv[file_id]} + {$ae_sess.api_download_kv[file_id].percent_completed}% + {:else} + ... + {/if} + +
+ {/if} +
+
{:then} {#if label} {@render label()} {:else} {@const IconComp = ae_util.file_extension_icon_lucide(hosted_file_obj?.extension)} - - - {ae_util.shorten_filename({ - filename: filename ?? hosted_file_obj?.filename, - max_length: max_length - })} - +
+
+ +
+ + {ae_util.shorten_filename({ + filename: filename ?? hosted_file_obj?.filename, + max_length: max_length + })} + + {#if hosted_file_obj?.file_purpose || hosted_file_obj?.group} + + {hosted_file_obj.file_purpose || hosted_file_obj.group} + + {/if} +
{/if} {/await} {#if download_complete === null} - File not found + File not found {:else if download_complete === false} - Failed to download! + Failed! {/if} {:else} - {/if}