From 354e8d7496fbd9e05fd3edc998ebbcb7e9fbef17 Mon Sep 17 00:00:00 2001 From: naman-bruno Date: Mon, 8 Dec 2025 14:24:47 +0530 Subject: [PATCH] feat: add hideApiSpecPage dispatch to Collection and CollectionItem components (#6344) --- .../Sidebar/Collections/Collection/CollectionItem/index.js | 5 ++++- .../src/components/Sidebar/Collections/Collection/index.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js index 0c35d5045..6f8fc7f37 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js @@ -39,7 +39,7 @@ import GenerateCodeItem from './GenerateCodeItem'; import { isItemARequest, isItemAFolder } from 'utils/tabs'; import { doesRequestMatchSearchText, doesFolderHaveItemsMatchSearchText } from 'utils/collections/search'; import { getDefaultRequestPaneTab } from 'utils/collections'; -import { hideHomePage } from 'providers/ReduxStore/slices/app'; +import { hideHomePage, hideApiSpecPage } from 'providers/ReduxStore/slices/app'; import toast from 'react-hot-toast'; import StyledWrapper from './StyledWrapper'; import NetworkError from 'components/ResponsePane/NetworkError/index'; @@ -222,6 +222,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) const isRequest = isItemARequest(item); if (isRequest) { dispatch(hideHomePage()); + dispatch(hideApiSpecPage()); if (isTabForItemPresent) { dispatch( focusTab({ @@ -239,6 +240,8 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) }) ); } else { + dispatch(hideHomePage()); + dispatch(hideApiSpecPage()); dispatch( addTab({ uid: item.uid, diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js index b9f0305e3..3cdffdc55 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -24,7 +24,7 @@ import Dropdown from 'components/Dropdown'; import { toggleCollection, collapseFullCollection } from 'providers/ReduxStore/slices/collections'; import { mountCollection, moveCollectionAndPersist, handleCollectionItemDrop, pasteItem } from 'providers/ReduxStore/slices/collections/actions'; import { useDispatch, useSelector } from 'react-redux'; -import { hideHomePage } from 'providers/ReduxStore/slices/app'; +import { hideApiSpecPage, hideHomePage } from 'providers/ReduxStore/slices/app'; import { addTab, makeTabPermanent } from 'providers/ReduxStore/slices/tabs'; import toast from 'react-hot-toast'; import NewRequest from 'components/Sidebar/NewRequest'; @@ -112,6 +112,7 @@ const Collection = ({ collection, searchText }) => { if (!isChevronClick) { dispatch(hideHomePage()); // @TODO Playwright tests are often stuck on home page, rather than collection settings tab. Revisit for a proper fix. + dispatch(hideApiSpecPage()); dispatch( addTab({ uid: collection.uid,