feat(post): add client tag and remove reset button

Client tag:
- Add ["client", "grimoire"] tag to all published events
- Added to both handlePublish and retryRelay functions
- Identifies posts as coming from Grimoire client

UI cleanup:
- Remove reset button from relay selection UI
- Relay selection persists across sessions via draft storage
- Simplify header to just show relay count
- Remove unused RotateCcw icon import

Tag generation order (final):
1. p tags (mentions)
2. e tags (event references)
3. a tags (address references)
4. client tag (grimoire)
5. emoji tags (NIP-30)
6. imeta tags (NIP-92)
This commit is contained in:
Claude
2026-01-20 22:01:14 +00:00
parent 6e29758648
commit a455b8d529

View File

@@ -1,5 +1,5 @@
import { useState, useRef, useCallback, useMemo, useEffect } from "react";
import { Paperclip, Send, Loader2, Check, X, RotateCcw } from "lucide-react";
import { Paperclip, Send, Loader2, Check, X } from "lucide-react";
import { toast } from "sonner";
import { Button } from "./ui/button";
import { Checkbox } from "./ui/checkbox";
@@ -201,6 +201,9 @@ export function PostViewer() {
tags.push(["a", `${addr.kind}:${addr.pubkey}:${addr.identifier}`]);
}
// Add client tag
tags.push(["client", "grimoire"]);
// Add emoji tags
for (const emoji of serialized.emojiTags) {
tags.push(["emoji", emoji.shortcode, emoji.url]);
@@ -323,6 +326,9 @@ export function PostViewer() {
tags.push(["a", `${addr.kind}:${addr.pubkey}:${addr.identifier}`]);
}
// Add client tag
tags.push(["client", "grimoire"]);
// Add emoji tags
for (const emoji of emojiTags) {
tags.push(["emoji", emoji.shortcode, emoji.url]);
@@ -506,18 +512,6 @@ export function PostViewer() {
<span className="text-sm text-muted-foreground">
Relays ({selectedRelays.size} selected)
</span>
{writeRelays.length > 0 && (
<Button
variant="ghost"
size="icon"
onClick={updateRelayStates}
disabled={isPublishing}
className="h-6 w-6"
title="Reset relay selection"
>
<RotateCcw className="h-3 w-3" />
</Button>
)}
</div>
{writeRelays.length === 0 ? (