enh: reference note in chat

This commit is contained in:
Timothy Jaeryang Baek
2025-07-09 01:17:25 +04:00
parent f2ee99d760
commit d5f9bbc7a7
8 changed files with 105 additions and 24 deletions
+4 -1
View File
@@ -442,7 +442,10 @@
const downloadHandler = async (type) => {
console.log('downloadHandler', type);
if (type === 'md') {
if (type === 'txt') {
const blob = new Blob([note.data.content.md], { type: 'text/plain' });
saveAs(blob, `${note.title}.txt`);
} else if (type === 'md') {
const blob = new Blob([note.data.content.md], { type: 'text/markdown' });
saveAs(blob, `${note.title}.md`);
} else if (type === 'pdf') {
+2 -2
View File
@@ -302,7 +302,7 @@
</div>
<div
class="mb-5 gap-2.5 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4"
class="mb-5 gap-2.5 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"
>
{#each notes[timeRange] as note, idx (note.id)}
<div
@@ -340,7 +340,7 @@
</div>
<div
class=" text-xs text-gray-500 dark:text-gray-500 mb-3 line-clamp-5 min-h-18"
class=" text-xs text-gray-500 dark:text-gray-500 mb-3 line-clamp-3 min-h-10"
>
{#if note.data?.content?.md}
{note.data?.content?.md}
@@ -57,6 +57,15 @@
transition={flyAndScale}
sideOffset={8}
>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md"
on:click={() => {
onDownload('txt');
}}
>
<div class="flex items-center line-clamp-1">{$i18n.t('Plain text (.txt)')}</div>
</DropdownMenu.Item>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md"
on:click={() => {