feat: reminder button in list/tabs view, notifications show reminders, trash count live update
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 43s

- Add reminder action to NoteActions (masonry view) and NoteMetaSidebar (tabs view)
- NotificationPanel now fetches and displays upcoming/overdue reminders alongside share requests
- Badge count includes overdue reminders; overdue items show mark-as-done toggle
- Sidebar trash count refreshes on NoteRefreshContext trigger (no more manual refresh)
- Add "Clear completed" button on reminders page with clearCompletedReminders action
- Add i18n keys for new features (en/fr)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-30 20:43:02 +02:00
parent 07f8a60b69
commit 0a900b3582
9 changed files with 283 additions and 39 deletions

View File

@@ -319,6 +319,31 @@ export async function toggleReminderDone(noteId: string, done: boolean) {
}
}
// Clear completed reminders (set reminder to null for done reminders)
export async function clearCompletedReminders() {
const session = await auth();
if (!session?.user?.id) return { error: 'Unauthorized' }
try {
await prisma.note.updateMany({
where: {
userId: session.user.id,
isReminderDone: true,
reminder: { not: null },
},
data: {
reminder: null,
isReminderDone: false,
},
})
revalidatePath('/reminders')
return { success: true }
} catch (error) {
console.error('Error clearing completed reminders:', error)
return { error: 'Failed to clear reminders' }
}
}
// Get archived notes only
export async function getArchivedNotes() {
const session = await auth();