diff --git a/src/components/graph/NodeTooltip.vue b/src/components/graph/NodeTooltip.vue index 5a3b97d9f..3089866a2 100644 --- a/src/components/graph/NodeTooltip.vue +++ b/src/components/graph/NodeTooltip.vue @@ -104,7 +104,7 @@ const onIdle = () => { ) if (inputSlot !== -1) { const inputName = node.inputs[inputSlot].name - if (selectDocItem(node, inputName)) { + if (!selectDocItem(node, inputName)) { return showTooltip(nodeDef.input.getInput(inputName)?.tooltip) } } @@ -117,7 +117,7 @@ const onIdle = () => { ) if (outputSlot !== -1) { const outputDef = nodeDef.output.all?.[outputSlot] - if (selectDocItem(node, outputDef?.name)) { + if (!selectDocItem(node, outputDef?.name)) { return showTooltip(outputDef?.tooltip) } } @@ -125,7 +125,7 @@ const onIdle = () => { const widget = getHoveredWidget() // Dont show for DOM widgets, these use native browser tooltips as we dont get proper mouse events on these if (widget && !widget.element) { - if (selectDocItem(node, widget.name, widget.value)) { + if (!selectDocItem(node, widget.name, widget.value)) { return showTooltip( widget.tooltip ?? nodeDef.input.getInput(widget.name)?.tooltip ) diff --git a/src/components/sidebar/tabs/DocumentationSidebarTab.vue b/src/components/sidebar/tabs/DocumentationSidebarTab.vue index 649044a05..1dc51b088 100644 --- a/src/components/sidebar/tabs/DocumentationSidebarTab.vue +++ b/src/components/sidebar/tabs/DocumentationSidebarTab.vue @@ -28,8 +28,9 @@ diff --git a/src/hooks/sidebarTabs/documentationSidebarTab.ts b/src/hooks/sidebarTabs/documentationSidebarTab.ts new file mode 100644 index 000000000..3daf0d6cf --- /dev/null +++ b/src/hooks/sidebarTabs/documentationSidebarTab.ts @@ -0,0 +1,18 @@ +import { useQueuePendingTaskCountStore } from '@/stores/queueStore' +import { markRaw } from 'vue' +import { useI18n } from 'vue-i18n' +import DocumentationSidebarTab from '@/components/sidebar/tabs/DocumentationSidebarTab.vue' +import type { SidebarTabExtension } from '@/types/extensionTypes' + +export const useDocumentationSidebarTab = (): SidebarTabExtension => { + const { t } = useI18n() + const queuePendingTaskCountStore = useQueuePendingTaskCountStore() + return { + id: 'documentation', + icon: 'pi pi-question', + title: t('sideToolbar.documentation'), + tooltip: t('sideToolbar.documentation'), + component: markRaw(DocumentationSidebarTab), + type: 'vue' + } +} diff --git a/src/i18n.ts b/src/i18n.ts index 8669eb3a6..378d4c8b1 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -58,6 +58,7 @@ const messages = { nodeLibrary: 'Node Library', workflows: 'Workflows', browseTemplates: 'Browse example templates', + documentation: 'Display documentation for nodes', openWorkflow: 'Open workflow in local file system', newBlankWorkflow: 'Create a new blank workflow', nodeLibraryTab: { diff --git a/src/stores/workspace/sidebarTabStore.ts b/src/stores/workspace/sidebarTabStore.ts index 9154bd99f..5e564dd55 100644 --- a/src/stores/workspace/sidebarTabStore.ts +++ b/src/stores/workspace/sidebarTabStore.ts @@ -2,6 +2,7 @@ import { useModelLibrarySidebarTab } from '@/hooks/sidebarTabs/modelLibrarySideb import { useNodeLibrarySidebarTab } from '@/hooks/sidebarTabs/nodeLibrarySidebarTab' import { useQueueSidebarTab } from '@/hooks/sidebarTabs/queueSidebarTab' import { useWorkflowsSidebarTab } from '@/hooks/sidebarTabs/workflowsSidebarTab' +import { useDocumentationSidebarTab } from '@/hooks/sidebarTabs/documentationSidebarTab' import { SidebarTabExtension } from '@/types/extensionTypes' import { defineStore } from 'pinia' import { computed, ref } from 'vue' @@ -57,6 +58,7 @@ export const useSidebarTabStore = defineStore('sidebarTab', () => { registerSidebarTab(useNodeLibrarySidebarTab()) registerSidebarTab(useModelLibrarySidebarTab()) registerSidebarTab(useWorkflowsSidebarTab()) + registerSidebarTab(useDocumentationSidebarTab()) } return {