From adc65f98195109ed384159305a35abf8ba85d4ed Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:55:22 +0200 Subject: [PATCH] feat: Spells app for saved, shareable Nostr queries (grimoire kind 777) (#33) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Spells app for saved, shareable Nostr queries (grimoire kind 777) The original feedback mentioned "grimoire spells" — traced to github.com/purrgrammer/grimoire, a third-party Nostr client with its own draft NIP for kind 777 "Spell" events: a REQ filter (kinds, authors, one tag filter, limit, time window) encoded as portable, shareable tags, with $me/$contacts runtime variables and relative timestamps ("7d", "now"). - src/hooks/useSpells.ts implements that draft NIP as-is (same tags, same variables, same relative-time grammar) rather than a reinterpretation, so a spell saved here round-trips with Grimoire. - src/apps/spells: browse "My Spells" / "Discover", build one with NewSpellForm, and Run it on demand against the resolved filter, rendering kind-1 results with NoteCard. - Only the "Spell" half is implemented; "Spellbook" (kind 30777, saved window layouts) is left as a documented follow-up. Closes #24 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BYiUtZMQeA5RHggQw73wto * fix: address review feedback on the Spells app Per review: - Scope is now derived (forced to "discover" when signed out) rather than stored as the requested value directly, matching the Feed app's pattern — signing out mid-session can no longer leave "My Spells" selected. - resolveSpellFilter() now validates a spell's tag-filter letter (single a-zA-Z char) before using it as a "#" filter key, and clamps limit to [1, 500] instead of trusting a relay-sourced spell's number outright — a malformed or hostile spell can no longer produce a "#undefined" filter key or an enormous/NaN/zero limit. Added regression tests for all of these. - NewSpellForm's Field now renders a real