Fix bugs, add auto-refresh, quick-complete tasks, and every-N-day routines

- Fix bot auth: merge duplicate on_ready handlers so session restore runs (#13)
- Fix push notifications: pass Uint8Array directly as applicationServerKey (#6)
- Show specific conflict reason on schedule save instead of generic error (#17)
- Add inline checkmark button to complete tasks on routines timeline (#18)
- Add visibility-change + 60s polling auto-refresh to routines, meds, tasks (#15)
- Add every-N-day routine scheduling: schema, API, scheduler, and UI (#16)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 19:04:52 -06:00
parent 24a1d18b25
commit ecb79af44e
10 changed files with 288 additions and 96 deletions

View File

@@ -74,7 +74,10 @@ CREATE TABLE IF NOT EXISTS routine_schedules (
routine_id UUID REFERENCES routines(id) ON DELETE CASCADE,
days JSON DEFAULT '[]',
time VARCHAR(5),
remind BOOLEAN DEFAULT FALSE
remind BOOLEAN DEFAULT FALSE,
frequency VARCHAR(20) DEFAULT 'weekly',
interval_days INTEGER,
start_date DATE
);
CREATE TABLE IF NOT EXISTS routine_session_notes (
@@ -314,3 +317,8 @@ CREATE TABLE IF NOT EXISTS tasks (
);
CREATE INDEX IF NOT EXISTS idx_tasks_user_scheduled ON tasks(user_uuid, scheduled_datetime);
CREATE INDEX IF NOT EXISTS idx_tasks_pending ON tasks(status) WHERE status = 'pending';
-- Add every-N-day scheduling to routine_schedules (run once on existing DBs)
ALTER TABLE routine_schedules ADD COLUMN IF NOT EXISTS frequency VARCHAR(20) DEFAULT 'weekly';
ALTER TABLE routine_schedules ADD COLUMN IF NOT EXISTS interval_days INTEGER;
ALTER TABLE routine_schedules ADD COLUMN IF NOT EXISTS start_date DATE;