diff --git a/public/healthz.json b/public/healthz.json index fe4e0d3..b1f6088 100644 --- a/public/healthz.json +++ b/public/healthz.json @@ -2,7 +2,7 @@ "status": "ok", "service": "aitherboard", "version": "0.1.0", - "buildTime": "2026-02-04T14:48:13.641Z", + "buildTime": "2026-02-04T16:28:03.763Z", "gitCommit": "unknown", - "timestamp": 1770216493641 + "timestamp": 1770222483764 } \ No newline at end of file diff --git a/src/lib/components/EventMenu.svelte b/src/lib/components/EventMenu.svelte index 62caa7b..f94692d 100644 --- a/src/lib/components/EventMenu.svelte +++ b/src/lib/components/EventMenu.svelte @@ -55,12 +55,21 @@ let pinnedState = $state(false); let bookmarkedState = $state(false); let highlightedState = $state(false); + let stateUpdateTrigger = $state(0); // Trigger to force state updates - // Update state when event changes + // Update state when event changes or when trigger changes $effect(() => { - pinnedState = isPinned(event.id); - bookmarkedState = isBookmarked(event.id); highlightedState = isHighlighted(event.id); + // Access trigger to make effect reactive to it + void stateUpdateTrigger; + + // Update pin and bookmark state asynchronously + isPinned(event.id).then(pinned => { + pinnedState = pinned; + }); + isBookmarked(event.id).then(bookmarked => { + bookmarkedState = bookmarked; + }); }); function toggleMenu() { @@ -231,12 +240,17 @@ } async function pinNote() { - pinnedState = await togglePin(event.id); + await togglePin(event.id); + // Force state update + stateUpdateTrigger++; closeMenu(); } async function bookmarkNote() { - bookmarkedState = await toggleBookmark(event.id); + await toggleBookmark(event.id); + // Force state update by re-checking bookmark status + const newBookmarked = await isBookmarked(event.id); + bookmarkedState = newBookmarked; closeMenu(); } @@ -244,21 +258,25 @@ // Extract content and e/a tags for highlight const content = event.content || ''; - // Find e-tag or a-tag (prefer a-tag if available) - let referenceTag: string[] | null = null; - const aTag = event.tags.find(tag => tag[0] === 'a'); - const eTag = event.tags.find(tag => tag[0] === 'e'); + // Collect all relevant tags: e-tag with the event's ID, a-tag (if available), and p-tag with the event's pubkey + const tagsToInclude: string[][] = []; + // Always add e-tag with the event ID of the event being highlighted + tagsToInclude.push(['e', event.id]); + + // Also check for a-tag in the original event (for parameterized replaceable events) + const aTag = event.tags.find(tag => tag[0] === 'a'); if (aTag) { - referenceTag = aTag; - } else if (eTag) { - referenceTag = eTag; + tagsToInclude.push(aTag); } + // Add p-tag with the pubkey of the event being highlighted + tagsToInclude.push(['p', event.pubkey]); + // Store highlight data in sessionStorage const highlightData = { content, - tags: referenceTag ? [referenceTag] : [] + tags: tagsToInclude }; sessionStorage.setItem('aitherboard_highlightData', JSON.stringify(highlightData)); @@ -446,6 +464,7 @@ justify-content: center; border-radius: 4px; transition: background-color 0.2s, color 0.2s; + filter: grayscale(100%); } .menu-button:hover { @@ -466,6 +485,7 @@ user-select: none; transform: rotate(90deg); display: inline-block; + filter: grayscale(100%); } .menu-dropdown { diff --git a/src/lib/components/profile/BookmarksPanel.svelte b/src/lib/components/profile/BookmarksPanel.svelte new file mode 100644 index 0000000..7cf76d8 --- /dev/null +++ b/src/lib/components/profile/BookmarksPanel.svelte @@ -0,0 +1,219 @@ + + +{#if isOpen} +
+{/if} + +{nip19.npubEncode(profilePubkey)}
+ No pinned posts yet.
+ {:else} +