Add Smart Notes AI analysis and Mento Memory with user approval.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 14:29:34 +03:30
co-authored by Cursor
parent 4d9f3c04cd
commit d152d1c19f
20 changed files with 1577 additions and 9 deletions
+18 -1
View File
@@ -3,6 +3,7 @@ import { computed, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import axios from 'axios';
import { api } from '@/lib/api';
import NoteAiSuggestionPanel from '@/components/NoteAiSuggestionPanel.vue';
import type {
DealDto,
NoteAttachmentDto,
@@ -198,6 +199,7 @@ async function saveNote() {
: null,
};
const pending = [...draftFiles.value];
const wasNew = !editingId.value;
let noteId = editingId.value;
if (editingId.value) {
await api.patch(`/notes/${editingId.value}`, payload);
@@ -208,6 +210,13 @@ async function saveNote() {
if (noteId && pending.length) {
await uploadFiles(noteId, pending);
}
if (noteId && wasNew && draftBody.value.trim().length >= 8) {
try {
await api.post(`/notes/${noteId}/analyze`);
} catch {
/* panel shows retry */
}
}
resetDraft();
await load();
} catch (e) {
@@ -264,7 +273,7 @@ onMounted(load);
<div>
<p class="eyebrow">Smart Notes</p>
<h1>یادداشت‌ها</h1>
<p class="lead">مثل Keep بنویسید؛ به شخص یا معامله وصل کنید. AI و حافظه مشتری در گام‌های بعد می‌آید.</p>
<p class="lead">مثل Keep بنویسید؛ AI کار بعدی و حافظه مشتری را پیشنهاد می‌دهد — فقط با تأیید شما اعمال می‌شود.</p>
</div>
<form class="search" @submit.prevent="load">
<input v-model="q" type="search" placeholder="جستجو در متن و برچسب…" />
@@ -408,6 +417,10 @@ onMounted(load);
<span v-if="note.deal"> · {{ note.deal.title }}</span>
<span v-if="note.reminderAt"> · یادآوری {{ formatWhen(note.reminderAt) }}</span>
</p>
<NoteAiSuggestionPanel
:note-id="note.id"
:has-person="Boolean(note.person?.id)"
/>
<footer>
<button type="button" @click="startEdit(note)">ویرایش</button>
<label class="attach-label">
@@ -474,6 +487,10 @@ onMounted(load);
<span v-if="note.deal"> · {{ note.deal.title }}</span>
<span v-if="note.reminderAt"> · یادآوری {{ formatWhen(note.reminderAt) }}</span>
</p>
<NoteAiSuggestionPanel
:note-id="note.id"
:has-person="Boolean(note.person?.id)"
/>
<footer>
<button type="button" @click="startEdit(note)">ویرایش</button>
<label class="attach-label">