diff --git a/packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js b/packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js index dc93ae17d..74a0d8db9 100644 --- a/packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js +++ b/packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js @@ -29,6 +29,7 @@ import ToolHint from 'components/ToolHint'; import JsSandboxMode from 'components/SecuritySettings/JsSandboxMode'; import ActionIcon from 'ui/ActionIcon'; import { getRevealInFolderLabel } from 'utils/common/platform'; +import { normalizePath } from 'utils/common/path'; import classNames from 'classnames'; import StyledWrapper from './StyledWrapper'; import { useTheme } from 'providers/Theme'; @@ -112,7 +113,7 @@ const CollectionHeader = ({ collection, isScratchCollection }) => { if (isScratch) return false; const workspaceCollectionPaths = currentWorkspace?.collections?.map((wc) => wc.path) || []; - return workspaceCollectionPaths.some((wcPath) => c.pathname === wcPath); + return workspaceCollectionPaths.some((wcPath) => normalizePath(c.pathname) === normalizePath(wcPath)); }); // Count tabs for the current collection diff --git a/packages/bruno-app/src/components/SaveTransientRequest/index.js b/packages/bruno-app/src/components/SaveTransientRequest/index.js index 827067fb9..5708bf886 100644 --- a/packages/bruno-app/src/components/SaveTransientRequest/index.js +++ b/packages/bruno-app/src/components/SaveTransientRequest/index.js @@ -17,7 +17,7 @@ import { insertTaskIntoQueue } from 'providers/ReduxStore/slices/app'; import { newFolder, closeTabs, mountCollection, createCollection, browseDirectory } from 'providers/ReduxStore/slices/collections/actions'; import { sanitizeName, validateName, validateNameError } from 'utils/common/regex'; import { resolveRequestFilename } from 'utils/common/platform'; -import path from 'utils/common/path'; +import path, { normalizePath } from 'utils/common/path'; import { transformRequestToSaveToFilesystem, findCollectionByUid, findItemInCollection, areItemsLoading } from 'utils/collections'; import { DEFAULT_COLLECTION_FORMAT } from 'utils/common/constants'; import { itemSchema } from '@usebruno/schema'; @@ -50,7 +50,7 @@ const SaveTransientRequest = ({ item: itemProp, collection: collectionProp, isOp if (!isScratchCollection || !activeWorkspace) return []; return (activeWorkspace.collections || []).map((wc) => { - const fullCollection = allCollections.find((c) => c.pathname === wc.path); + const fullCollection = allCollections.find((c) => normalizePath(c.pathname) === normalizePath(wc.path)); // Use stable deterministic UID based on path to avoid duplicate Redux entries const stableUid = wc.path ? `pending-${wc.path.replace(/[^a-zA-Z0-9]/g, '-')}` : uuid(); return fullCollection || { ...wc, uid: stableUid, mountStatus: 'unmounted' };