feat(ux): epic UX design improvements across agents, chat, notes, and i18n
Comprehensive UI/UX updates including agent card redesign, chat container improvements, note editor enhancements, memory echo notifications, and updated translations for all 15 locales. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -435,6 +435,7 @@ export async function createNote(data: {
|
||||
isMarkdown?: boolean
|
||||
size?: 'small' | 'medium' | 'large'
|
||||
autoGenerated?: boolean
|
||||
aiProvider?: string
|
||||
notebookId?: string | undefined // Assign note to a notebook if provided
|
||||
skipRevalidation?: boolean // Option to prevent full page refresh for smooth optimistic UI updates
|
||||
}) {
|
||||
@@ -459,6 +460,7 @@ export async function createNote(data: {
|
||||
isMarkdown: data.isMarkdown || false,
|
||||
size: data.size || 'small',
|
||||
autoGenerated: data.autoGenerated || null,
|
||||
aiProvider: data.aiProvider || null,
|
||||
notebookId: data.notebookId || null,
|
||||
}
|
||||
})
|
||||
@@ -867,7 +869,7 @@ export async function togglePin(id: string, isPinned: boolean) { return updateNo
|
||||
export async function toggleArchive(id: string, isArchived: boolean) { return updateNote(id, { isArchived }) }
|
||||
export async function updateColor(id: string, color: string) { return updateNote(id, { color }) }
|
||||
export async function updateLabels(id: string, labels: string[]) { return updateNote(id, { labels }) }
|
||||
export async function removeFusedBadge(id: string) { return updateNote(id, { autoGenerated: null }) }
|
||||
export async function removeFusedBadge(id: string) { return updateNote(id, { autoGenerated: null, aiProvider: null }) }
|
||||
|
||||
// Update note size WITHOUT revalidation - client uses optimistic updates
|
||||
export async function updateSize(id: string, size: 'small' | 'medium' | 'large') {
|
||||
@@ -941,8 +943,16 @@ export async function updateFullOrderWithoutRevalidation(ids: string[]) {
|
||||
if (!session?.user?.id) throw new Error('Unauthorized');
|
||||
const userId = session.user.id;
|
||||
try {
|
||||
const updates = ids.map((id: string, index: number) =>
|
||||
prisma.note.update({ where: { id, userId }, data: { order: index } })
|
||||
// Verify all notes belong to the user before updating
|
||||
const notes = await prisma.note.findMany({
|
||||
where: { id: { in: ids }, userId },
|
||||
select: { id: true },
|
||||
})
|
||||
const ownedIds = new Set(notes.map(n => n.id))
|
||||
const validIds = ids.filter(id => ownedIds.has(id))
|
||||
|
||||
const updates = validIds.map((id: string, index: number) =>
|
||||
prisma.note.update({ where: { id }, data: { order: index } })
|
||||
)
|
||||
await prisma.$transaction(updates)
|
||||
return { success: true }
|
||||
|
||||
Reference in New Issue
Block a user