From 2c1750312981c8c1c55d45dd8c64655cf02fffd8 Mon Sep 17 00:00:00 2001 From: 0xrohitgarg Date: Wed, 18 Dec 2024 12:12:59 +0530 Subject: [PATCH] feat: config to change order & visibility of sidebar sections --- .../chat/elements/DefaultScreen.vue | 6 +- src/components/chat/elements/Sidebar.vue | 355 +++++++++--------- 2 files changed, 186 insertions(+), 175 deletions(-) diff --git a/src/components/chat/elements/DefaultScreen.vue b/src/components/chat/elements/DefaultScreen.vue index c89af48..b63a47b 100644 --- a/src/components/chat/elements/DefaultScreen.vue +++ b/src/components/chat/elements/DefaultScreen.vue @@ -50,7 +50,7 @@ class="fade-in-anim vdb-c-flex vdb-c-grow vdb-c-items-start vdb-c-justify-center vdb-c-pt-4" >
- -
- +
@@ -366,6 +371,13 @@ const props = defineProps({ type: Boolean, default: false, }, + sidebarSections: { + type: Array, + default: () => ['collections', 'agents', 'sessions'], + validator: (value) => { + return value.every(item => ['collections', 'agents', 'sessions'].includes(item)); + } + } }); const showExploreAgents = ref(true); @@ -380,6 +392,10 @@ const hoveredSession = ref(null); const isMobile = ref(window?.innerWidth < 1024); const isOpen = ref(false); +const visibleSections = computed(() => { + return props.sidebarSections; +}); + const emit = defineEmits([ "create-new-session", "session-click", @@ -470,7 +486,6 @@ watch(showExploreAgents, (newValue) => { } }); - defineExpose({ toggleExploreAgents, toggleSessions,