mirror of
https://github.com/hoornet/vega.git
synced 2026-07-02 06:48:59 -07:00
Bump to v0.2.0 — Phase 2: Engagement & Reach
Four features shipped in this release: - Feed reply context: replies show "↩ replying to @name" above the note content; clicking fetches and opens the parent thread - NIP-65 outbox model: fetchUserRelayList + publishRelayList + fetchUserNotesNIP65 in client.ts; profile notes fetched via the author's write relays; "Publish relay list to Nostr" button in Settings (kind 10002) - Notifications: new store (notifications.ts) + NotificationsView; 🔔 sidebar nav item with unread badge; DM nav item also shows unread conversation count; badges clear on open/select - Keyboard shortcuts: useKeyboardShortcuts hook + HelpModal; n=compose, /=search, j/k=feed nav with ring highlight, Esc=back, ?=help overlay Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { useUserStore } from "../../stores/user";
|
||||
import { useMuteStore } from "../../stores/mute";
|
||||
import { getNDK, getStoredRelayUrls, addRelay, removeRelay } from "../../lib/nostr";
|
||||
import { getNDK, getStoredRelayUrls, addRelay, removeRelay, publishRelayList } from "../../lib/nostr";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import { NWCWizard } from "./NWCWizard";
|
||||
|
||||
@@ -61,9 +61,12 @@ function RelayRow({ url, onRemove }: { url: string; onRemove: () => void }) {
|
||||
}
|
||||
|
||||
function RelaySection() {
|
||||
const { loggedIn } = useUserStore();
|
||||
const [relays, setRelays] = useState<string[]>(() => getStoredRelayUrls());
|
||||
const [input, setInput] = useState("");
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [publishing, setPublishing] = useState(false);
|
||||
const [publishedAt, setPublishedAt] = useState<number | null>(null);
|
||||
|
||||
const handleAdd = () => {
|
||||
const url = input.trim();
|
||||
@@ -92,6 +95,18 @@ function RelaySection() {
|
||||
if (e.key === "Escape") setInput("");
|
||||
};
|
||||
|
||||
const handlePublishRelayList = async () => {
|
||||
setPublishing(true);
|
||||
try {
|
||||
await publishRelayList(getStoredRelayUrls());
|
||||
setPublishedAt(Date.now());
|
||||
} catch {
|
||||
// ignore — publishing failure is non-critical
|
||||
} finally {
|
||||
setPublishing(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<section>
|
||||
<h2 className="text-text text-[11px] font-medium uppercase tracking-widest mb-2 text-text-dim">Relays</h2>
|
||||
@@ -119,6 +134,20 @@ function RelaySection() {
|
||||
</button>
|
||||
</div>
|
||||
{error && <p className="text-danger text-[11px] mt-1">{error}</p>}
|
||||
{loggedIn && !!getNDK().signer && (
|
||||
<div className="mt-3">
|
||||
<button
|
||||
onClick={handlePublishRelayList}
|
||||
disabled={publishing}
|
||||
className="text-[11px] px-3 py-1.5 border border-border text-text-muted hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
{publishing ? "publishing…" : publishedAt ? "published ✓" : "publish relay list to Nostr"}
|
||||
</button>
|
||||
<p className="text-text-dim text-[10px] mt-1">
|
||||
Saves your relay list as a kind 10002 event (NIP-65) so other clients can find your notes.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user