show node's output when selected

This commit is contained in:
Guilhem
2024-11-05 10:13:14 +01:00
parent 91416fe96d
commit f5a4d25fc4
2 changed files with 23 additions and 8 deletions
@@ -54,6 +54,8 @@
)
const flowEditorContext = getContext<FlowEditorContext>('FlowEditorContext')
const flowStateStore = flowEditorContext?.flowStateStore
const dispatch = createEventDispatcher()
const { currentStepStore: copilotCurrentStepStore } =
@@ -274,14 +276,26 @@ hover:border-blue-700 hover:!visible {hover ? '' : '!hidden'}"
</div>
</div>
{#if id && (selected || $propPickerConfig)}
<div class="absolute -top-[14px] right-[200px]">
<FlowPropPicker
json={{ [id]: pickableIds?.[id] }}
prefix={'results'}
viewOnly={!$propPickerConfig || !pickableIds || !Object.keys(pickableIds).includes(id)}
/>
</div>
{#if id}
{#if $propPickerConfig && pickableIds && Object.keys(pickableIds).includes(id)}
<div class="absolute -top-[14px] right-[200px]">
<FlowPropPicker
json={{
[id]: pickableIds[id]
}}
prefix={'results'}
viewOnly={false}
/>
</div>
{:else if selected && !$propPickerConfig}
<div class="absolute -top-[14px] right-[200px]">
<FlowPropPicker
json={{ [id]: $flowStateStore[id]?.previewResult }}
prefix={'results'}
viewOnly={true}
/>
</div>
{/if}
{/if}
{#if deletable}
@@ -18,6 +18,7 @@
$: console.log('dbg view only', viewOnly)
$: console.log('dbg popupOpen', popupOpen)
$: console.log('dbg json', json)
</script>
<button