From 412ebccc4f4373197257d893f0d8ed0f2b85a1ff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 10:01:42 +0000 Subject: [PATCH] fix: include since/until in spell filter JSON display The filter JSON in SpellDetailRenderer was missing since/until fields when they were in relative format (e.g., "7d", "now"). This happened because decodeSpell only adds these fields to the filter object when they're unix timestamps. Now we extract the raw since/until values from event tags and include them in a displayFilter object for the JSON viewer, ensuring users see the complete filter regardless of format. The command preview already worked correctly since it uses the reconstructed command string which includes these values. --- src/components/nostr/kinds/SpellRenderer.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/nostr/kinds/SpellRenderer.tsx b/src/components/nostr/kinds/SpellRenderer.tsx index d3a5f71..8dabac7 100644 --- a/src/components/nostr/kinds/SpellRenderer.tsx +++ b/src/components/nostr/kinds/SpellRenderer.tsx @@ -220,6 +220,20 @@ export function SpellDetailRenderer({ event }: BaseEventProps) { try { const spell = decodeSpell(event as SpellEvent); + // Create a display filter that includes since/until even in relative format + const displayFilter = { ...spell.filter }; + + // Extract raw since/until values from tags + const sinceTag = event.tags.find((t) => t[0] === "since")?.[1]; + const untilTag = event.tags.find((t) => t[0] === "until")?.[1]; + + if (sinceTag && !displayFilter.since) { + displayFilter.since = sinceTag as any; // Show relative format like "7d" + } + if (untilTag && !displayFilter.until) { + displayFilter.until = untilTag as any; // Show relative format like "now" + } + return (
@@ -291,7 +305,7 @@ export function SpellDetailRenderer({ event }: BaseEventProps) {

Filter

- +
{spell.relays && spell.relays.length > 0 && (