From e384ae1037ab76c648a5f588f7d7a120e45320da Mon Sep 17 00:00:00 2001 From: Ulas Date: Wed, 15 Apr 2026 11:40:24 +0200 Subject: [PATCH] feat: add reminders for tasks and calendar events (closes #13) - DB migration #8: reminders table (entity_type, entity_id, remind_at, dismissed, created_by) - REST API: GET /pending, GET /?entity, POST /, PATCH /:id/dismiss, DELETE - Client polling module (reminders.js): 60s interval, toast + Browser Notification API - Tasks: enable reminder with custom date/time in edit modal - Calendar: reminder offset selector (at time / 15min / 1h / 1d before) - Bell badge shows pending count; reminders auto-dismiss after 30s or on user action - SW shell cache updated to include reminders.js + reminders.css - 11 new DB tests covering CRUD, pending query, dismiss, upsert, cascade delete, constraints --- CHANGELOG.md | 13 ++ package.json | 5 +- public/index.html | 1 + public/locales/de.json | 21 +++ public/locales/en.json | 21 +++ public/pages/calendar.js | 86 +++++++++++- public/pages/tasks.js | 99 ++++++++++++-- public/reminders.js | 257 ++++++++++++++++++++++++++++++++++++ public/router.js | 4 + public/styles/reminders.css | 96 ++++++++++++++ public/sw.js | 4 +- server/db-schema-test.js | 14 ++ server/db.js | 19 +++ server/index.js | 2 + server/routes/reminders.js | 210 +++++++++++++++++++++++++++++ test-reminders.js | 229 ++++++++++++++++++++++++++++++++ 16 files changed, 1061 insertions(+), 20 deletions(-) create mode 100644 public/reminders.js create mode 100644 public/styles/reminders.css create mode 100644 server/routes/reminders.js create mode 100644 test-reminders.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d527ab2..ea578df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.20.0] - 2026-04-15 + +### Added +- Reminders: set time-based reminders on tasks and calendar events (closes #13) + - Tasks: enable a reminder with a custom date and time via the task edit modal + - Calendar events: choose an offset (at time, 15 min, 1 hour, or 1 day before) via the event edit dialog + - In-app toast notifications (built via DOM API, no external dependencies) appear when a reminder is due + - Browser Notification API support - reminders fire as system notifications when permission is granted + - Client-side polling every 60 seconds checks for pending reminders + - Reminders can be dismissed individually; dismissed reminders no longer appear + - Bell badge on each reminder shows pending count when reminders are due + - DB migration #8 adds `reminders` table with `entity_type`, `entity_id`, `remind_at`, `dismissed` fields and appropriate indexes + ## [0.19.6] - 2026-04-15 ### Added diff --git a/package.json b/package.json index ec531a8..d5bcadd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oikos", - "version": "0.19.6", + "version": "0.20.0", "description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.", "main": "server/index.js", "type": "module", @@ -20,7 +20,8 @@ "test:ncb": "node --experimental-sqlite test-notes-contacts-budget.js", "test:ux-utils": "node test-ux-utils.js", "test:modal-utils": "node --loader ./test-browser-loader.mjs test-modal-utils.js", - "test": "node --experimental-sqlite test-db.js && node --experimental-sqlite test-dashboard.js && node --experimental-sqlite test-tasks.js && node --experimental-sqlite test-shopping.js && node --experimental-sqlite test-meals.js && node --experimental-sqlite test-calendar.js && node --experimental-sqlite test-notes-contacts-budget.js && npm run test:ux-utils && npm run test:modal-utils" + "test:reminders": "node --experimental-sqlite test-reminders.js", + "test": "node --experimental-sqlite test-db.js && node --experimental-sqlite test-dashboard.js && node --experimental-sqlite test-tasks.js && node --experimental-sqlite test-shopping.js && node --experimental-sqlite test-meals.js && node --experimental-sqlite test-calendar.js && node --experimental-sqlite test-notes-contacts-budget.js && npm run test:ux-utils && npm run test:modal-utils && npm run test:reminders" }, "dependencies": { "bcrypt": "^6.0.0", diff --git a/public/index.html b/public/index.html index 311bcd1..b8b4f43 100644 --- a/public/index.html +++ b/public/index.html @@ -38,6 +38,7 @@ +