From fed5615c19b0045a55b0be426b468a57bfda4b66 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 16 Sep 2025 11:32:40 -0500 Subject: [PATCH] refac: image max compression size --- .../components/chat/Settings/Interface.svelte | 58 ++++------ .../ManageImageCompressionModal.svelte | 108 ++++++++++++++++++ 2 files changed, 132 insertions(+), 34 deletions(-) create mode 100644 src/lib/components/chat/Settings/Interface/ManageImageCompressionModal.svelte diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index c383b831bb..f79dd8524f 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -9,6 +9,7 @@ import Plus from '$lib/components/icons/Plus.svelte'; import Switch from '$lib/components/common/Switch.svelte'; import ManageFloatingActionButtonsModal from './Interface/ManageFloatingActionButtonsModal.svelte'; + import ManageImageCompressionModal from './Interface/ManageImageCompressionModal.svelte'; const dispatch = createEventDispatcher(); const i18n = getContext('i18n'); @@ -93,6 +94,7 @@ let iframeSandboxAllowForms = false; let showManageFloatingActionButtonsModal = false; + let showManageImageCompressionModal = false; const toggleLandingPageMode = async () => { landingPageMode = landingPageMode === '' ? 'chat' : ''; @@ -260,6 +262,14 @@ }} /> + { + saveSettings({ imageCompressionSize: size }); + }} +/> +
-
+
+ {#if imageCompression} + + {/if} + {#if imageCompression} -
-
-
- {$i18n.t('Image Max Compression Size')} -
- -
- - x - - -
-
-
-
diff --git a/src/lib/components/chat/Settings/Interface/ManageImageCompressionModal.svelte b/src/lib/components/chat/Settings/Interface/ManageImageCompressionModal.svelte new file mode 100644 index 0000000000..652db8ab4e --- /dev/null +++ b/src/lib/components/chat/Settings/Interface/ManageImageCompressionModal.svelte @@ -0,0 +1,108 @@ + + + +
+
+

+ {$i18n.t('Manage')} +

+ +
+ +
+
+ { + e.preventDefault(); + submitHandler(); + }} + > +
+
+
+
+ {$i18n.t('Image Max Compression Size')} +
+ +
+
+ + +
+ +
+ +
+ +
+ + +
+
+
+
+
+ +
+ +
+ +
+
+
+