Fix regression where tooltip node descriptions in the graph stopped showing (#3639)

* Fix tooltips

* Convert DefinitionIdentifier to string in JavaScript

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Adam Gerhant
2026-01-15 23:30:16 -08:00
committed by GitHub
co-authored by Keavon Chambers
parent c60ddcf875
commit c13647aef4
10 changed files with 47 additions and 51 deletions
+4 -4
View File
@@ -4,7 +4,7 @@
import { fade } from "svelte/transition";
import type { Editor } from "@graphite/editor";
import type { DefinitionIdentifier, FrontendGraphInput, FrontendGraphOutput, FrontendNode } from "@graphite/messages";
import type { FrontendGraphInput, FrontendGraphOutput, FrontendNode } from "@graphite/messages";
import type { NodeGraphState } from "@graphite/state-providers/node-graph";
import NodeCatalog from "@graphite/components/floating-menus/NodeCatalog.svelte";
@@ -100,7 +100,7 @@
return sparse;
}
function createNode(identifier: DefinitionIdentifier) {
function createNode(identifier: string) {
if ($nodeGraph.contextMenuInformation === undefined) return;
editor.handle.createNode(identifier, $nodeGraph.contextMenuInformation.contextMenuCoordinates.x, $nodeGraph.contextMenuInformation.contextMenuCoordinates.y);
@@ -481,7 +481,7 @@
{@const layerAreaWidth = $nodeGraph.layerWidths.get(node.id) || 8}
{@const layerChainWidth = $nodeGraph.chainWidths.get(node.id) || 0}
{@const hasLeftInputWire = $nodeGraph.hasLeftInputWire.get(node.id) || false}
{@const description = (node.reference && $nodeGraph.nodeDescriptions.get(node.reference)) || undefined}
{@const description = node.reference ? $nodeGraph.nodeDescriptions.get(node.reference) : undefined}
<div
class="layer"
class:selected={$nodeGraph.selected.includes(node.id)}
@@ -634,7 +634,7 @@
.map(([_, node], nodeIndex) => ({ node, nodeIndex })) as { node, nodeIndex } (nodeIndex)}
{@const exposedInputsOutputs = zipWithUndefined(node.exposedInputs, node.exposedOutputs)}
{@const clipPathId = String(Math.random()).substring(2)}
{@const description = (node.reference && $nodeGraph.nodeDescriptions.get(node.reference)) || undefined}
{@const description = node.reference ? $nodeGraph.nodeDescriptions.get(node.reference) : undefined}
<div
class="node"
class:selected={$nodeGraph.selected.includes(node.id)}