From 622767d72473c39869111f278192ff3b1c94785c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 15 Jul 2026 02:49:46 -0400 Subject: [PATCH] refac --- .../automations/AutomationEditor.svelte | 22 ++++++- src/lib/components/channel/Navbar.svelte | 2 +- src/lib/components/chat/Messages/Error.svelte | 61 ++++++++++++------- src/lib/components/chat/Navbar.svelte | 2 +- .../components/common/DropdownOptions.svelte | 6 +- src/lib/components/icons/Sidebar.svelte | 20 ++---- src/lib/components/layout/SearchModal.svelte | 23 +++---- src/lib/components/layout/Sidebar.svelte | 4 +- src/lib/components/notes/NoteEditor.svelte | 34 +++++------ src/lib/components/notes/Notes.svelte | 54 ++++++++-------- src/lib/components/workspace/Models.svelte | 30 +++++---- src/routes/(app)/admin/+layout.svelte | 13 ++-- src/routes/(app)/automations/+page.svelte | 52 ++++++++-------- src/routes/(app)/calendar/+page.svelte | 4 +- src/routes/(app)/home/+layout.svelte | 4 +- src/routes/(app)/playground/+layout.svelte | 19 +++--- src/routes/(app)/workspace/+layout.svelte | 6 +- 17 files changed, 192 insertions(+), 164 deletions(-) diff --git a/src/lib/components/automations/AutomationEditor.svelte b/src/lib/components/automations/AutomationEditor.svelte index 463cb0fa70..dd01662345 100644 --- a/src/lib/components/automations/AutomationEditor.svelte +++ b/src/lib/components/automations/AutomationEditor.svelte @@ -7,7 +7,7 @@ import relativeTime from 'dayjs/plugin/relativeTime'; import localizedFormat from 'dayjs/plugin/localizedFormat'; - import { WEBUI_NAME, showSidebar } from '$lib/stores'; + import { WEBUI_NAME, mobile, showSidebar } from '$lib/stores'; import { updateAutomationById, @@ -25,6 +25,7 @@ import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import GarbageBin from '$lib/components/icons/GarbageBin.svelte'; import ChevronLeft from '$lib/components/icons/ChevronLeft.svelte'; + import SidebarIcon from '$lib/components/icons/Sidebar.svelte'; import ScheduleDropdown from '$lib/components/automations/ScheduleDropdown.svelte'; import ModelDropdown from '$lib/components/automations/ModelDropdown.svelte'; @@ -222,7 +223,24 @@
-
+
+ {#if $mobile} + + + + {/if} diff --git a/src/lib/components/chat/Messages/Error.svelte b/src/lib/components/chat/Messages/Error.svelte index 2c046485c2..700157b82f 100644 --- a/src/lib/components/chat/Messages/Error.svelte +++ b/src/lib/components/chat/Messages/Error.svelte @@ -1,29 +1,48 @@ -
-
- -
+
+ -
- {#if typeof content === 'string'} - {content} - {:else if typeof content === 'object' && content !== null} - {#if content?.error && content?.error?.message} - {content.error.message} - {:else if content?.detail} - {content.detail} - {:else if content?.message} - {content.message} - {:else} - {JSON.stringify(content)} - {/if} - {:else} - {JSON.stringify(content)} - {/if} +
+ {message}
diff --git a/src/lib/components/chat/Navbar.svelte b/src/lib/components/chat/Navbar.svelte index 75e064d22a..ee2a00052c 100644 --- a/src/lib/components/chat/Navbar.svelte +++ b/src/lib/components/chat/Navbar.svelte @@ -104,7 +104,7 @@ aria-label={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')} >
- +
diff --git a/src/lib/components/common/DropdownOptions.svelte b/src/lib/components/common/DropdownOptions.svelte index 19eadf1395..c7ca7ba745 100644 --- a/src/lib/components/common/DropdownOptions.svelte +++ b/src/lib/components/common/DropdownOptions.svelte @@ -37,11 +37,13 @@ }} > - {selectedLabel} + {selectedLabel} - {item.label} + {item.label} diff --git a/src/lib/components/icons/Sidebar.svelte b/src/lib/components/icons/Sidebar.svelte index e158cf3cf4..b17649b731 100644 --- a/src/lib/components/icons/Sidebar.svelte +++ b/src/lib/components/icons/Sidebar.svelte @@ -1,5 +1,5 @@ @@ -10,18 +10,10 @@ viewBox="0 0 24 24" stroke-width={strokeWidth} stroke="currentColor" + stroke-linecap="round" + stroke-linejoin="round" class={className} - > diff --git a/src/lib/components/layout/SearchModal.svelte b/src/lib/components/layout/SearchModal.svelte index 9b61c639c0..19de4fc93a 100644 --- a/src/lib/components/layout/SearchModal.svelte +++ b/src/lib/components/layout/SearchModal.svelte @@ -24,12 +24,7 @@ import Loader from '../common/Loader.svelte'; import { createMessagesList } from '$lib/utils'; import { getOutputText } from '$lib/components/chat/Messages/structuredOutput'; - import { - config, - user, - chatId as currentChatId, - tags - } from '$lib/stores'; + import { config, user, chatId as currentChatId, tags } from '$lib/stores'; import { refreshChatList } from '$lib/stores/chat-list'; import Messages from '../chat/Messages.svelte'; import { goto } from '$app/navigation'; @@ -561,8 +556,6 @@ messages = null; }} onKeydown={(e) => { - console.log('e', e); - if (e.code === 'Enter' && (chatList ?? []).length > 0) { const item = document.querySelector(`[data-arrow-selected="true"]`); if (item) { @@ -585,8 +578,6 @@ />
- -
{ selectedIdx = idx; }} @@ -622,7 +613,7 @@ {/each} {#if chatList} -
+