From c133e0a93c6ed9d176c4eff4e7a4896345972a69 Mon Sep 17 00:00:00 2001 From: limina1 Date: Wed, 23 Jul 2025 20:24:50 -0400 Subject: [PATCH] refactor: legend now using inline tailwind --- src/lib/navigator/EventNetwork/Legend.svelte | 176 +++++++----------- .../navigator/EventNetwork/NodeTooltip.svelte | 2 +- 2 files changed, 67 insertions(+), 111 deletions(-) diff --git a/src/lib/navigator/EventNetwork/Legend.svelte b/src/lib/navigator/EventNetwork/Legend.svelte index d92efb0..d32a1b8 100644 --- a/src/lib/navigator/EventNetwork/Legend.svelte +++ b/src/lib/navigator/EventNetwork/Legend.svelte @@ -92,11 +92,8 @@
-
-

Node Types

+
+

Node Types

{#if nodeTypesExpanded} @@ -111,9 +108,10 @@ {#each Object.entries(eventCounts).sort(([a], [b]) => Number(a) - Number(b)) as [kindStr, count]} {@const kind = Number(kindStr)} + {@const countNum = count as number} {@const color = getEventKindColor(kind)} {@const name = getEventKindName(kind)} - {#if (count as number) > 0} + {#if countNum > 0}
  • - - {kind} - {name} ({count}) + + {kind} - {name} ({countNum})
  • {/if} @@ -139,7 +137,7 @@ fill="none" /> - + {#if starMode} Radial connections from centers to related events {:else} @@ -159,7 +157,7 @@ fill="none" /> - + Authored by person @@ -172,7 +170,7 @@ fill="none" /> - + References person @@ -183,11 +181,8 @@
    -
    tagControlsExpanded = !tagControlsExpanded} - > -

    Tag Anchor Controls

    +
    tagControlsExpanded = !tagControlsExpanded}> +

    Tag Anchor Controls

    {#if tagControlsExpanded} @@ -206,7 +201,7 @@ showTagAnchors = !showTagAnchors; onTagSettingsChange(); }} - class="px-2 py-1 border border-gray-300 dark:border-gray-600 rounded-md bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-medium cursor-pointer transition-all min-w-12 hover:bg-gray-200 dark:hover:bg-gray-600 {showTagAnchors ? 'bg-blue-500 text-white border-blue-500 hover:bg-blue-600' : ''}" + class="px-2 py-1 border border-gray-300 dark:border-gray-700 rounded text-xs font-medium cursor-pointer transition min-w-[3rem] hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 {showTagAnchors ? 'bg-blue-600 text-white border-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:text-white dark:border-blue-600 dark:hover:bg-blue-700' : 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300'}" > {showTagAnchors ? 'ON' : 'OFF'} @@ -238,11 +233,8 @@ {#if showTags && tagAnchors.length > 0}
    -
    -

    Active Tag Anchors: {tagAnchors[0].type}

    +
    +

    Active Tag Anchors: {tagAnchors[0].type}

    {#if tagAnchorsExpanded} @@ -314,32 +306,32 @@ {#each sortedAnchors as anchor} {@const tagId = `${anchor.type}-${anchor.label}`} {@const isDisabled = disabledTags.has(tagId)} -
    - - {anchor.label} - {#if !isDisabled} - ({anchor.count}) - {/if} - - + {/each}
    {/if} @@ -348,11 +340,8 @@
    -
    personVisualizerExpanded = !personVisualizerExpanded} - > -

    Person Visualizer

    +
    personVisualizerExpanded = !personVisualizerExpanded}> +

    Person Visualizer

    {#if personVisualizerExpanded} @@ -372,7 +361,7 @@ showPersonNodes = !showPersonNodes; onPersonSettingsChange(); }} - class="px-2 py-1 border border-gray-300 dark:border-gray-600 rounded-md bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-medium cursor-pointer transition-all min-w-12 hover:bg-gray-200 dark:hover:bg-gray-600 {showPersonNodes ? 'bg-blue-500 text-white border-blue-500 hover:bg-blue-600' : ''}" + class="px-2 py-1 border border-gray-300 dark:border-gray-700 rounded text-xs font-medium cursor-pointer transition min-w-[3rem] hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 {showPersonNodes ? 'bg-blue-600 text-white border-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:text-white dark:border-blue-600 dark:hover:bg-blue-700' : 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300'}" > {showPersonNodes ? 'ON' : 'OFF'} @@ -437,31 +426,31 @@ > {#each personAnchors as person} {@const isDisabled = disabledPersons.has(person.pubkey)} - + {/each}
    {:else if showPersonNodes} @@ -475,36 +464,3 @@
    {/if}
    - - diff --git a/src/lib/navigator/EventNetwork/NodeTooltip.svelte b/src/lib/navigator/EventNetwork/NodeTooltip.svelte index 57be965..42c72d2 100644 --- a/src/lib/navigator/EventNetwork/NodeTooltip.svelte +++ b/src/lib/navigator/EventNetwork/NodeTooltip.svelte @@ -13,7 +13,7 @@ getDisplayNameSync, replacePubkeysWithDisplayNames, } from "$lib/utils/profileCache"; - import {indexKind, zettelKinds } from "$lib/consts"; + import {indexKind, zettelKinds, wikiKind} from "$lib/consts"; // Component props let {