From 9be11883b87a96894731000e19aef01106d51cc6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 16 Jul 2026 02:05:08 -0400 Subject: [PATCH] refac --- .../components/chat/ChatPlaceholder.svelte | 2 +- src/lib/components/chat/MessageInput.svelte | 4 +- .../components/chat/Messages/Message.svelte | 2 +- src/lib/components/chat/Placeholder.svelte | 2 +- src/lib/components/notes/Notes.svelte | 315 +++++++++--------- src/routes/(app)/automations/+page.svelte | 18 +- 6 files changed, 170 insertions(+), 173 deletions(-) diff --git a/src/lib/components/chat/ChatPlaceholder.svelte b/src/lib/components/chat/ChatPlaceholder.svelte index f13770b316..346395b2f1 100644 --- a/src/lib/components/chat/ChatPlaceholder.svelte +++ b/src/lib/components/chat/ChatPlaceholder.svelte @@ -36,7 +36,7 @@ {#key mounted} -
+
{#each models as model, modelIdx} diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 79cd710dfa..85b47f2f6f 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1286,7 +1286,7 @@
{#if autoScroll === false && history?.currentId} @@ -1323,7 +1323,7 @@
{#if history.messages[messageId]} {#if history.messages[messageId].role === 'user'} diff --git a/src/lib/components/chat/Placeholder.svelte b/src/lib/components/chat/Placeholder.svelte index ff2bae8869..38522abb37 100644 --- a/src/lib/components/chat/Placeholder.svelte +++ b/src/lib/components/chat/Placeholder.svelte @@ -80,7 +80,7 @@ $selectedFolder.permission !== 'write'; -
+
{#if $temporaryChatEnabled} {#each notesList as note, idx (note.id)}
- -
-
- -
- {note.title} -
-
- -
- -
- {dayjs(note.updated_at / 1000000).fromNow()} -
-
- -
- {$i18n.t('By {{name}}', { - name: capitalizeFirstLetter( - note?.user?.name ?? - note?.user?.email ?? - $i18n.t('Deleted User') - ) - })} -
-
- -
- { - selectedNote = note; - - downloadHandler(type); - }} - onCopyLink={async () => { - const baseUrl = window.location.origin; - const res = await copyToClipboard( - `${baseUrl}/notes/${note.id}` - ); - - if (res) { - toast.success($i18n.t('Copied link to clipboard')); - } else { - toast.error($i18n.t('Failed to copy link')); - } - }} - onDelete={() => { - selectedNote = note; - showDeleteConfirm = true; - }} - isPinned={note.is_pinned ?? false} - onPin={async () => { - await toggleNotePinnedStatusById(localStorage.token, note.id); - pinnedNotes.set( - await getPinnedNoteList(localStorage.token).catch(() => []) - ); - init(); - }} - > - - -
-
+
+ +
+ {note.title}
+
+ +
+ + { + selectedNote = note; + + downloadHandler(type); + }} + onCopyLink={async () => { + const baseUrl = window.location.origin; + const res = await copyToClipboard(`${baseUrl}/notes/${note.id}`); + + if (res) { + toast.success($i18n.t('Copied link to clipboard')); + } else { + toast.error($i18n.t('Failed to copy link')); + } + }} + onDelete={() => { + selectedNote = note; + showDeleteConfirm = true; + }} + isPinned={note.is_pinned ?? false} + onPin={async () => { + await toggleNotePinnedStatusById(localStorage.token, note.id); + pinnedNotes.set( + await getPinnedNoteList(localStorage.token).catch(() => []) + ); + init(); + }} + > + +
{/each}
@@ -613,96 +611,91 @@ > {#each notesList as note, idx (note.id)}
-
- + + +
+ {note.title} +
+
+
+ + { + selectedNote = note; + + downloadHandler(type); + }} + onCopyLink={async () => { + const baseUrl = window.location.origin; + const res = await copyToClipboard(`${baseUrl}/notes/${note.id}`); + + if (res) { + toast.success($i18n.t('Copied link to clipboard')); + } else { + toast.error($i18n.t('Failed to copy link')); + } + }} + onDelete={() => { + selectedNote = note; + showDeleteConfirm = true; + }} + isPinned={note.is_pinned ?? false} + onPin={async () => { + await toggleNotePinnedStatusById(localStorage.token, note.id); + pinnedNotes.set( + await getPinnedNoteList(localStorage.token).catch(() => []) + ); + init(); + }} > - - -
- {#if note.data?.content?.md} - {note.data?.content?.md} - {:else} - {$i18n.t('No content')} - {/if} -
-
- - +
{/each}
diff --git a/src/routes/(app)/automations/+page.svelte b/src/routes/(app)/automations/+page.svelte index c6d927d4d7..9f64b12f3e 100644 --- a/src/routes/(app)/automations/+page.svelte +++ b/src/routes/(app)/automations/+page.svelte @@ -546,17 +546,19 @@