diff --git a/app/gui2/src/components/GraphNode.vue b/app/gui2/src/components/GraphNode.vue index 59d703706cf..8df0baeddab 100644 --- a/app/gui2/src/components/GraphNode.vue +++ b/app/gui2/src/components/GraphNode.vue @@ -20,6 +20,7 @@ import { import { colorFromString } from '@/util/colors' import { usePointer, useResizeObserver } from '@/util/events' import { methodNameToIcon, typeNameToIcon } from '@/util/getIconName' +import type { UnsafeMutable } from '@/util/mutable' import type { Opt } from '@/util/opt' import type { Vec2 } from '@/util/vec2' import type { ContentRange, ExprId, VisualizationIdentifier } from 'shared/yjsModel' @@ -307,9 +308,11 @@ function switchToDefaultPreprocessor() { visPreprocessor.value = DEFAULT_VISUALIZATION_CONFIGURATION } -const visualizationConfig = ref({ +// This usage of `UnsafeMutable` is SAFE, as it is being used on a type without an associated value. +const visualizationConfig = ref>({ fullscreen: false, - types: visualizationStore.types, + // We do not know the type yet. + types: visualizationStore.types(undefined), width: null, height: 150, hide() { @@ -426,6 +429,10 @@ const icon = computed(() => { return 'in_out' } }) + +watchEffect(() => { + visualizationConfig.value.types = visualizationStore.types(expressionInfo.value?.typename) +})