RemindersPanel dereffed content.target unconditionally and decryptReminder
trusted JSON.parse output as ReminderContent with no validation. A note-only
reminder (no target — explicitly valid per NIP-ER) or malformed self-decrypted
plaintext crashed the 60s due-check loop or rendered fake reminders.
Make target optional, validate decrypted content fail-closed (object shape,
known status, target/note structure), and guard every target deref with a note
fallback. Mirror the relay's strict not_before parser so the client ignores
values the relay rejects, and use 16 random bytes for the d-tag to meet the
spec's 128-bit entropy MUST (randomUUID is only 122 bits).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Add a "Custom date & time" section below the time presets in the
RemindMeLaterDialog, using native date and time inputs styled with the
existing Input component. The date picker defaults to today and prevents
selecting past dates. A "Set reminder" button creates the reminder at
the user-selected timestamp.
Also extends the screenshot spec to 6 tests: widens the action menu
screenshot clip, adds tests for the reminders panel with active and
fired/overdue reminders, and adds KIND_EVENT_REMINDER mock support to
the e2e bridge for seeding reminder data in tests.
Co-authored-by: Will Pfleger <wpfleger@block.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Radix UI components animate in via CSS transitions. Playwright's toBeVisible()
resolves mid-animation, producing greyed-out or partially-rendered screenshots.
- Create shared waitForAnimations(page) utility in tests/helpers/animations.ts
- Wire it into screenshot.mjs so the just desktop-screenshot path settles
animations automatically before capture
- Update reminders-screenshots.spec.ts to call waitForAnimations before every
page.screenshot(), add clip regions for focused captures
- Update AGENTS.md to reference the shared helper as mandatory
Co-authored-by: Will Pfleger <wpfleger@block.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Captures 4 screenshots verifying the NIP-ER reminder feature renders
correctly: sidebar nav item, message action menu, time-picker dialog,
and empty reminders panel. Registered in the smoke project.
Co-authored-by: Will Pfleger <wpfleger@squareup.com>
Signed-off-by: Will Pfleger <wpfleger@squareup.com>
Implements the desktop client UI for kind:30300 event reminders (NIP-ER):
- Service layer (reminderService.ts): create, complete, snooze, and cancel
reminders as individual parameterized-replaceable events with NIP-44
encrypt-to-self. Each reminder has a random d-tag, not_before timestamp,
and encrypted content containing the target message reference and optional
note.
- "Remind me later" action: new menu item in MessageActionBar opens a dialog
with time presets (30min, 1hr, 3hr, tomorrow 9am, next Monday 9am) and an
optional note field.
- Reminders panel: accessible from sidebar (Bell icon), shows pending
reminders grouped by due status (overdue/today/upcoming) with
complete/snooze/cancel action buttons per row.
- Due-detection: local 60-second interval checks not_before against
Date.now() and fires toast notifications when reminders become due.
No relay scheduler dependency for v1 — purely client-side.
- RemindMeLaterProvider context avoids prop-threading through 4 intermediate
components; MessageRow uses the hook directly.
All reminder content is NIP-44 encrypted — never stored or transmitted in
plaintext. Completed/cancelled reminders get jittered 30-90 day expiration
tags for eventual relay-side cleanup.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
The relay now proactively delivers due reminders via Redis pub/sub.
Cross-pod dedup uses an atomic delivered_at claim (mirrors the reaper's
archived_at guard). Ingest relaxed to allow kind:30300 without
not_before (bookmarks/terminal states). max_not_before_delta enforced
to prevent unbounded-future scheduling abuse.
Schema: nullable not_before + delivered_at columns on events, partial
index for scheduler queries. NIP-11: supported_extensions ["nip-er"],
due_delivery_mode "push", max_not_before_delta advertised.
Spec (NIP-ER.md) amended: not_before optional on kind:30300, required
only for pending reminders that may become due.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
The spec requires not_before on pending reminders only — terminal states
(done/cancelled) and bookmarks omit it. The validator incorrectly
required exactly one not_before on all kind:30300 events, blocking the
entire completion/cancellation lifecycle.
Also adds d-tag structure validation per spec: reject zero, empty, or
duplicate d tags.
Co-authored-by: Will Pfleger <will@pfleger.dev>
Signed-off-by: Will Pfleger <will@pfleger.dev>