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
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:
@@ -177,6 +177,24 @@ export const NoteCard = memo(function NoteCard({
|
||||
const [comparisonNotes, setComparisonNotes] = useState<string[] | null>(null)
|
||||
const [fusionNotes, setFusionNotes] = useState<Array<Partial<Note>>>([])
|
||||
const [showNotebookMenu, setShowNotebookMenu] = useState(false)
|
||||
const [reminderDate, setReminderDate] = useState<Date | null>(note.reminder ? new Date(note.reminder) : null)
|
||||
|
||||
const handleUpdateReminder = async (noteId: string, reminder: Date | null) => {
|
||||
startTransition(async () => {
|
||||
try {
|
||||
await updateNote(noteId, { reminder })
|
||||
setReminderDate(reminder)
|
||||
triggerRefresh()
|
||||
if (reminder) {
|
||||
toast.success(t('notes.reminderSet', { datetime: reminder.toLocaleString() }))
|
||||
} else {
|
||||
toast.info(t('reminder.removeReminder'))
|
||||
}
|
||||
} catch {
|
||||
toast.error(t('general.error'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Move note to a notebook
|
||||
const handleMoveToNotebook = async (notebookId: string | null) => {
|
||||
@@ -653,6 +671,9 @@ export const NoteCard = memo(function NoteCard({
|
||||
onPermanentDelete={handlePermanentDelete}
|
||||
onOpenHistory={() => onOpenHistory?.(note)}
|
||||
historyEnabled={noteHistoryEnabled}
|
||||
noteId={note.id}
|
||||
currentReminder={reminderDate}
|
||||
onUpdateReminder={handleUpdateReminder}
|
||||
className="absolute bottom-0 left-0 right-0 p-2 opacity-100 md:opacity-0 group-hover:opacity-100 transition-opacity"
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user