diff --git a/src/lib/consts.ts b/src/lib/consts.ts index ef41e0d..90afa53 100644 --- a/src/lib/consts.ts +++ b/src/lib/consts.ts @@ -2,7 +2,7 @@ export const wikiKind = 30818; export const indexKind = 30040; -export const zettelKinds = [30041, 30818]; +export const zettelKinds = [30041, 30818, 30023]; export const communityRelays = [ "wss://theforest.nostr1.com", @@ -29,18 +29,18 @@ export const secondaryRelays = [ export const anonymousRelays = [ "wss://freelay.sovbit.host", - "wss://thecitadel.nostr1.com" + "wss://thecitadel.nostr1.com", ]; export const lowbandwidthRelays = [ "wss://theforest.nostr1.com", "wss://thecitadel.nostr1.com", - "wss://aggr.nostr.land" + "wss://aggr.nostr.land", ]; export const localRelays: string[] = [ "wss://localhost:8080", - "wss://localhost:4869" + "wss://localhost:4869", ]; export enum FeedType { diff --git a/src/lib/navigator/EventNetwork/NodeTooltip.svelte b/src/lib/navigator/EventNetwork/NodeTooltip.svelte index 485c900..57be965 100644 --- a/src/lib/navigator/EventNetwork/NodeTooltip.svelte +++ b/src/lib/navigator/EventNetwork/NodeTooltip.svelte @@ -9,7 +9,11 @@ import { onMount } from "svelte"; import { getMatchingTags } from "$lib/utils/nostrUtils"; import { getEventKindName } from "$lib/utils/eventColors"; - import { getDisplayNameSync, replacePubkeysWithDisplayNames } from "$lib/utils/profileCache"; + import { + getDisplayNameSync, + replacePubkeysWithDisplayNames, + } from "$lib/utils/profileCache"; + import {indexKind, zettelKinds } from "$lib/consts"; // Component props let { @@ -35,9 +39,9 @@ // Maximum content length to display const MAX_CONTENT_LENGTH = 200; - + // Publication event kinds (text/article based) - const PUBLICATION_KINDS = [30040, 30041, 30818, 30023]; // Added 30023 (long-form content) + const PUBLICATION_KINDS = [wikiKind, indexKind, ...zettelKinds]; /** * Gets the author name from the event tags @@ -81,14 +85,14 @@ } return "View Publication"; } - + /** * Checks if this is a publication event */ function isPublicationEvent(kind: number): boolean { return PUBLICATION_KINDS.includes(kind); } - + /** * Gets the appropriate URL for the event */ @@ -98,7 +102,7 @@ } return `/events?id=${node.id}`; } - + /** * Gets display text for the link */ @@ -238,17 +242,23 @@ {#if node.event?.content}
Content: -
{truncateContent(node.event.content)}
+
{truncateContent(
+              node.event.content,
+            )}
{/if} - + {#if node.event?.tags && node.event.tags.length > 0}
Tags: {node.event.tags.length} {#if node.event.tags.length <= 3} {#each node.event.tags as tag} - · {tag[0]}{tag[1] ? `: ${tag[0] === 'p' ? getDisplayNameSync(tag[1]) : tag[1].substring(0, 20)}${tag[1].length > 20 && tag[0] !== 'p' ? '...' : ''}` : ''} + · {tag[0]}{tag[1] + ? `: ${tag[0] === "p" ? getDisplayNameSync(tag[1]) : tag[1].substring(0, 20)}${tag[1].length > 20 && tag[0] !== "p" ? "..." : ""}` + : ""} {/each} {/if}