From 55cb98ff561e1298dda407fb06a0a0ad304ad89a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 29 Jun 2026 13:03:30 -0500 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 13 +- src/lib/components/chat/MessageInput.svelte | 406 ++++++++++---------- src/lib/components/workspace/Models.svelte | 2 - 3 files changed, 210 insertions(+), 211 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 36efe44e33..3903b95401 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2977,12 +2977,13 @@ const loaded = chat?.chat ?? {}; if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return; - const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch( - (err) => { - console.error('[controls autosave]', err); - return null; - } - ); + const res = await updateChatById(localStorage.token, $chatId, { + params, + files: chatFiles + }).catch((err) => { + console.error('[controls autosave]', err); + return null; + }); // Refresh the dedupe baseline so a later revert still saves. if (res) chat = res; }; diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 409861f495..de623d90b4 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1755,43 +1755,43 @@
{#if showWebSearchButton || showImageGenerationButton || showCodeInterpreterButton || showToolsButton || showSkillsButton || (toggleFilters && toggleFilters.length > 0)} - { - const { type, id } = e; - selectedValvesType = type; - selectedValvesItemId = id; - showValvesModal = true; - integrationsMenuCloseOnOutsideClick = false; - }} - onClose={async () => { - await tick(); + { + const { type, id } = e; + selectedValvesType = type; + selectedValvesItemId = id; + showValvesModal = true; + integrationsMenuCloseOnOutsideClick = false; + }} + onClose={async () => { + await tick(); - const chatInput = document.getElementById('chat-input'); - chatInput?.focus(); - }} - > - - + + {/if} {#if selectedModelIds.length === 1 && $models.find((m) => m.id === selectedModelIds[0])?.has_user_valves} @@ -1814,190 +1814,190 @@ {/if}
- {#if (selectedToolIds ?? []).length > 0} - - - - {/if} - - {#if (selectedSkillIds ?? []).length > 0} - - - - {/if} - - {#each selectedFilterIds as filterId (filterId)} - {@const filter = toggleFilters.find((f) => f.id === filterId)} - {#if filter} - + + {/if} + + {#if (selectedSkillIds ?? []).length > 0} + + + + {/if} + + {#each selectedFilterIds as filterId (filterId)} + {@const filter = toggleFilters.find((f) => f.id === filterId)} + {#if filter} + + + + {/if} + {/each} + + {#if webSearchEnabled} + + {/if} - {/each} - {#if webSearchEnabled} - - - - {/if} + {#if imageGenerationEnabled} + + + + {/if} - {#if imageGenerationEnabled} - - - - {/if} + {#if codeInterpreterEnabled} + + + + {/if} - - - - {/if} - - {#each pendingOAuthTools as pendingTool (pendingTool.id)} - - - - {/each} -
+ > + + {pendingTool.name} + + + {/each} +
diff --git a/src/lib/components/workspace/Models.svelte b/src/lib/components/workspace/Models.svelte index 4c62a6b8ea..2492bbd68a 100644 --- a/src/lib/components/workspace/Models.svelte +++ b/src/lib/components/workspace/Models.svelte @@ -254,8 +254,6 @@ return allModels; }; - - const enableAllHandler = async () => { const allModels = await fetchAllWorkspaceModels(); const modelsToEnable = allModels.filter((m) => !(m.is_active ?? true));