diff --git a/packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js b/packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js index fc5eb2351..505bffb73 100644 --- a/packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js +++ b/packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/CollectionsList/index.js @@ -1,8 +1,9 @@ import React, { useState, useMemo, useRef } from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { IconBox, IconTrash, IconEdit, IconShare, IconDots, IconX } from '@tabler/icons'; +import { IconBox, IconTrash, IconEdit, IconShare, IconDots, IconX, IconFolder } from '@tabler/icons'; import { addTab } from 'providers/ReduxStore/slices/tabs'; -import { mountCollection } from 'providers/ReduxStore/slices/collections/actions'; +import { mountCollection, showInFolder } from 'providers/ReduxStore/slices/collections/actions'; +import { getRevealInFolderLabel } from 'utils/common/platform'; import { normalizePath } from 'utils/common/path'; import toast from 'react-hot-toast'; import RenameCollection from 'components/Sidebar/Collections/Collection/RenameCollection'; @@ -153,6 +154,14 @@ const CollectionsList = ({ workspace }) => { setDeleteCollectionModalOpen(true); }; + const handleShowInFolder = (collection) => { + dropdownRefs.current[collection.uid]?.hide(); + dispatch(showInFolder(collection.pathname)).catch((error) => { + console.error('Error opening the folder', error); + toast.error('Error opening the folder'); + }); + }; + return ( {renameCollectionModalOpen && selectedCollectionUid && ( @@ -201,9 +210,7 @@ const CollectionsList = ({ workspace }) => {

No collections yet

-

- Create your first collection or open an existing one to get started. -

+

Create your first collection or open an existing one to get started.

) : ( workspaceCollections.map((collection, index) => ( @@ -249,6 +256,16 @@ const CollectionsList = ({ workspace }) => { Share +
{ + e.stopPropagation(); + handleShowInFolder(collection); + }} + > + + {getRevealInFolderLabel()} +
{