Skip to content

Commit 2acf93b

Browse files
committed
Fix tooltips
1 parent 73682b4 commit 2acf93b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

frontend/src/components/floating-menus/NodeCatalog.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@
125125
{disabled}
126126
label={nodeType.name}
127127
tooltipLabel={nodeType.name}
128-
tooltipDescription={$nodeGraph.nodeDescriptions.get(nodeType.identifier)}
128+
tooltipDescription={[...$nodeGraph.nodeDescriptions.entries()]
129+
.find(([key]) => key.type === nodeType.identifier?.type && key.data === nodeType.identifier?.data)
130+
?.at(1)
131+
?.toString()}
129132
action={() => dispatch("selectNodeType", nodeType.identifier)}
130133
/>
131134
{/each}

frontend/src/components/views/Graph.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
{@const layerAreaWidth = $nodeGraph.layerWidths.get(node.id) || 8}
482482
{@const layerChainWidth = $nodeGraph.chainWidths.get(node.id) || 0}
483483
{@const hasLeftInputWire = $nodeGraph.hasLeftInputWire.get(node.id) || false}
484-
{@const description = (node.reference && $nodeGraph.nodeDescriptions.get(node.reference)) || undefined}
484+
{@const description = [...$nodeGraph.nodeDescriptions.entries()].find(([key]) => key.type === node.reference?.type && key.data === node.reference?.data)?.at(1) || undefined}
485485
<div
486486
class="layer"
487487
class:selected={$nodeGraph.selected.includes(node.id)}
@@ -634,7 +634,7 @@
634634
.map(([_, node], nodeIndex) => ({ node, nodeIndex })) as { node, nodeIndex } (nodeIndex)}
635635
{@const exposedInputsOutputs = zipWithUndefined(node.exposedInputs, node.exposedOutputs)}
636636
{@const clipPathId = String(Math.random()).substring(2)}
637-
{@const description = (node.reference && $nodeGraph.nodeDescriptions.get(node.reference)) || undefined}
637+
{@const description = [...$nodeGraph.nodeDescriptions.entries()].find(([key]) => key.type === node.reference?.type && key.data === node.reference?.data)?.at(1) || undefined}
638638
<div
639639
class="node"
640640
class:selected={$nodeGraph.selected.includes(node.id)}

0 commit comments

Comments
 (0)