feat: RTL/i18n, AI translate+undo, no-refresh saves, settings perf

- RTL: force dir=rtl on LabelFilter, NotesViewToggle, LabelManagementDialog
- i18n: add missing keys (notifications, privacy, edit/preview, AI translate/undo)
- Settings pages: convert to Server Components (general, appearance) + loading skeleton
- AI menu: add Translate option (10 languages) + Undo AI button in toolbar
- Fix: saveInline uses REST API instead of Server Action → eliminates all implicit refreshes in list mode
- Fix: NotesTabsView notes sync effect preserves selected note on content changes
- Fix: auto-tag suggestions now filter already-assigned labels
- Fix: color change in card view uses local state (no refresh)
- Fix: nav links use <Link> for prefetching (Settings, Admin)
- Fix: suppress duplicate label suggestions already on note
- Route: add /api/ai/translate endpoint
This commit is contained in:
Sepehr Ramezani
2026-04-15 23:48:28 +02:00
parent 39671c6472
commit b6a548acd8
68 changed files with 5014 additions and 485 deletions

View File

@@ -101,10 +101,11 @@ export async function PUT(
const newName = name ? name.trim() : currentLabel.name
// For backward compatibility, update old label field in notes if renaming
if (name && name.trim() !== currentLabel.name && currentLabel.userId) {
const targetUserIdPut = currentLabel.userId || currentLabel.notebook?.userId || session.user.id;
if (name && name.trim() !== currentLabel.name && targetUserIdPut) {
const allNotes = await prisma.note.findMany({
where: {
userId: currentLabel.userId,
userId: targetUserIdPut,
labels: { not: null }
},
select: { id: true, labels: true }
@@ -197,10 +198,11 @@ export async function DELETE(
}
// For backward compatibility, remove from old label field in notes
if (label.userId) {
const targetUserIdDel = label.userId || label.notebook?.userId || session.user.id;
if (targetUserIdDel) {
const allNotes = await prisma.note.findMany({
where: {
userId: label.userId,
userId: targetUserIdDel,
labels: { not: null }
},
select: { id: true, labels: true }