diff --git a/src/components/ui/Popover.vue b/src/components/ui/Popover.vue index e3ab57077..7580b4935 100644 --- a/src/components/ui/Popover.vue +++ b/src/components/ui/Popover.vue @@ -11,7 +11,7 @@ import Button from '@/components/ui/button/Button.vue' import { cn } from '@/utils/tailwindUtil' defineProps<{ - entries: { label: string; action?: () => void; icon?: string }[][] + entries?: { label: string; action?: () => void; icon?: string }[][] icon?: string }>() @@ -29,12 +29,13 @@ defineProps<{
diff --git a/src/views/LinearView.vue b/src/views/LinearView.vue index d4d800fb7..f184bd618 100644 --- a/src/views/LinearView.vue +++ b/src/views/LinearView.vue @@ -73,36 +73,37 @@ const graphNodes = shallowRef(app.rootGraph.nodes) useEventListener( app.rootGraph.events, 'configured', - () => (graphNodes.value = app.rootGraph.nodes) + () => (graphNodes.value = app.rootGraph.nodes.reverse()) ) -const nodeDatas = computed(() => { - function nodeToNodeData(node: LGraphNode) { - const mapper = safeWidgetMapper(node, new Map()) - const widgets = node.widgets?.map(mapper) ?? [] - const dropIndicator = - node.type !== 'LoadImage' - ? undefined - : { - iconClass: 'icon-[lucide--image]', - label: t('Click to browse or drag an image'), - onClick: node.widgets?.[1]?.callback - } - //of VueNodeData, only widgets is actually used - return { - executing: false, - id: `${node.id}`, - mode: 0, - selected: false, - title: node.title, - type: node.type, - widgets, +function nodeToNodeData(node: LGraphNode) { + const mapper = safeWidgetMapper(node, new Map()) + const widgets = node.widgets?.map(mapper) ?? [] + const dropIndicator = + node.type !== 'LoadImage' + ? undefined + : { + iconClass: 'icon-[lucide--image]', + label: t('Click to browse or drag an image'), + onClick: node.widgets?.[1]?.callback + } + //of VueNodeData, only widgets is actually used + return { + executing: false, + id: `${node.id}`, + mode: 0, + selected: false, + title: node.title, + type: node.type, + widgets, - dropIndicator, - onDragDrop: node.onDragDrop, - onDragOver: node.onDragOver - } + dropIndicator, + onDragDrop: node.onDragDrop, + onDragOver: node.onDragOver } +} + +const nodeDatas = computed(() => { return graphNodes.value .filter( (node) => @@ -111,7 +112,16 @@ const nodeDatas = computed(() => { !['MarkdownNote', 'Note'].includes(node.type) ) .map(nodeToNodeData) - .reverse() +}) +const noteDatas = computed(() => { + return graphNodes.value + .filter( + (node) => + node.mode === 0 && + node.widgets?.length && + ['MarkdownNote', 'Note'].includes(node.type) + ) + .map(nodeToNodeData) }) const batchCountWidget = { @@ -602,7 +612,21 @@ useEventListener(document.body, 'keydown', (e: KeyboardEvent) => { v-text="workflowStore.activeWorkflow?.filename" />
- + + +
+ +
+