From efc0431a5eb17a489d0d14b8cbc16e1fe5e1964b Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 13 Aug 2025 19:46:03 +0100 Subject: [PATCH] Update side toolbar menu (#4946) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Side toolbar menu UI updates ## Summary - Currently the template modal is very hidden. Many users do not find it - The current icons are quite aleatory ## Changes **What**: - Add templates shortcut button - Add item label in normal size - Use custom icon Critical design decisions or edge cases that need attention: - Sidebar tabs registered using custom icons will have their associated command registed with an undefined icon (currently only string icons are accepted, not components). I couldn't see anywhere directly using this icon, but we should consider autogenerating an icon font so we can use classes for our custom icons (or locating and updating locations to support both icon types) ## Screenshots (if applicable) Normal mode: image Small mode: image ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4946-Update-side-toolbar-menu-24d6d73d365081c5b2bdc0ee8b61dc50) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions --- src/assets/icons/custom/ai-model.svg | 6 +++ src/assets/icons/custom/node.svg | 3 ++ src/assets/icons/custom/template.svg | 5 ++ src/components/sidebar/SideToolbar.vue | 6 ++- src/components/sidebar/SidebarIcon.vue | 53 +++++++++++++++---- .../sidebar/SidebarTemplatesButton.vue | 35 ++++++++++++ .../sidebarTabs/useModelLibrarySidebarTab.ts | 9 +++- .../sidebarTabs/useNodeLibrarySidebarTab.ts | 9 +++- .../sidebarTabs/useQueueSidebarTab.ts | 1 + .../sidebarTabs/useWorkflowsSidebarTab.ts | 9 +++- src/locales/ar/main.json | 8 +++ src/locales/en/main.json | 8 +++ src/locales/es/main.json | 8 +++ src/locales/fr/main.json | 8 +++ src/locales/ja/main.json | 8 +++ src/locales/ko/main.json | 8 +++ src/locales/ru/main.json | 8 +++ src/locales/zh-TW/main.json | 8 +++ src/locales/zh/main.json | 8 +++ src/stores/workspace/sidebarTabStore.ts | 2 +- src/types/extensionTypes.ts | 3 +- src/vite-env.d.ts | 12 +++++ vitest.config.ts | 12 ++++- 23 files changed, 218 insertions(+), 19 deletions(-) create mode 100644 src/assets/icons/custom/ai-model.svg create mode 100644 src/assets/icons/custom/node.svg create mode 100644 src/assets/icons/custom/template.svg create mode 100644 src/components/sidebar/SidebarTemplatesButton.vue diff --git a/src/assets/icons/custom/ai-model.svg b/src/assets/icons/custom/ai-model.svg new file mode 100644 index 000000000..ede8e5c7e --- /dev/null +++ b/src/assets/icons/custom/ai-model.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/assets/icons/custom/node.svg b/src/assets/icons/custom/node.svg new file mode 100644 index 000000000..3239b59bd --- /dev/null +++ b/src/assets/icons/custom/node.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/icons/custom/template.svg b/src/assets/icons/custom/template.svg new file mode 100644 index 000000000..2a2a75f8d --- /dev/null +++ b/src/assets/icons/custom/template.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/components/sidebar/SideToolbar.vue b/src/components/sidebar/SideToolbar.vue index 0ef8598d1..72a451d81 100644 --- a/src/components/sidebar/SideToolbar.vue +++ b/src/components/sidebar/SideToolbar.vue @@ -8,10 +8,13 @@ :icon-badge="tab.iconBadge" :tooltip="tab.tooltip" :tooltip-suffix="getTabTooltipSuffix(tab)" + :label="tab.label || tab.title" + :is-small="isSmall" :selected="tab.id === selectedTab?.id" :class="tab.id + '-tab-button'" @click="onTabClick(tab)" /> +
@@ -43,6 +46,7 @@ import type { SidebarTabExtension } from '@/types/extensionTypes' import SidebarHelpCenterIcon from './SidebarHelpCenterIcon.vue' import SidebarIcon from './SidebarIcon.vue' import SidebarLogoutIcon from './SidebarLogoutIcon.vue' +import SidebarTemplatesButton from './SidebarTemplatesButton.vue' const workspaceStore = useWorkspaceStore() const settingStore = useSettingStore() @@ -86,7 +90,7 @@ const getTabTooltipSuffix = (tab: SidebarTabExtension) => { box-shadow: var(--bar-shadow); --sidebar-width: 4rem; - --sidebar-icon-size: 1.5rem; + --sidebar-icon-size: 1rem; } .side-tool-bar-container.small-sidebar { diff --git a/src/components/sidebar/SidebarIcon.vue b/src/components/sidebar/SidebarIcon.vue index 5002d7724..f38a0aa0b 100644 --- a/src/components/sidebar/SidebarIcon.vue +++ b/src/components/sidebar/SidebarIcon.vue @@ -19,12 +19,29 @@ @click="emit('click', $event)" > @@ -33,6 +50,7 @@ import Button from 'primevue/button' import OverlayBadge from 'primevue/overlaybadge' import { computed } from 'vue' +import type { Component } from 'vue' import { useI18n } from 'vue-i18n' const { t } = useI18n() @@ -41,13 +59,17 @@ const { selected = false, tooltip = '', tooltipSuffix = '', - iconBadge = '' + iconBadge = '', + label = '', + isSmall = false } = defineProps<{ - icon?: string + icon?: string | Component selected?: boolean tooltip?: string tooltipSuffix?: string iconBadge?: string | (() => string | null) + label?: string + isSmall?: boolean }>() const emit = defineEmits<{ @@ -74,10 +96,23 @@ const computedTooltip = computed(() => t(tooltip) + tooltipSuffix)