diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts index ef45ab628b..976f64110c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts @@ -86,12 +86,7 @@ describe( ); }; - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); - PageLeftPane.switchToAddNew(); - }); - - it("1. All widget tags should be visible but only Suggested tag is open.", () => { + it("1. All widget tags should be visible and open by default.", () => { agHelper.AssertElementLength( entityExplorer._widgetTagsList, Object.keys(WIDGET_TAGS).length, diff --git a/app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx b/app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx index 9fed94a3d5..852d084add 100644 --- a/app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx +++ b/app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx @@ -19,9 +19,6 @@ import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { groupWidgetCardsByTags } from "../utils"; import UIEntityTagGroup from "./UIEntityTagGroup"; import { useUIExplorerItems } from "./hooks"; -import { useSelector } from "react-redux"; -import { widgetsExistCurrentPage } from "@appsmith/selectors/entitiesSelector"; -import { getIsAnvilLayout } from "layoutSystems/anvil/integrations/selectors"; function UIEntitySidebar({ focusSearchInput, @@ -39,8 +36,6 @@ function UIEntitySidebar({ const isDragDropBuildingBlocksEnabled = useFeatureFlag( FEATURE_FLAG.release_drag_drop_building_blocks_enabled, ); - const isAnvil = useSelector(getIsAnvilLayout); - const hasWidgets = useSelector(widgetsExistCurrentPage); const hideSuggestedWidgets = useMemo( () => (isSearching && !areSearchResultsEmpty) || @@ -151,26 +146,9 @@ function UIEntitySidebar({ return null; } - // Do not expand all the widget tags when the user does not have any - // widgets yet. - // Only show Suggested or Building Blocks - // This behavior should not be used if Anvil layout is active - let isInitiallyOpen = false; - if ( - isAnvil || - hasWidgets || - [ - WIDGET_TAGS.SUGGESTED_WIDGETS as string, - WIDGET_TAGS.BUILDING_BLOCKS as string, - ].includes(tag) - ) { - isInitiallyOpen = true; - } - return ( { - const [isOpen, setIsOpen] = React.useState(props.isInitiallyOpen); const [showFullItems, setShowFullItems] = React.useState(false); const toggleShowFullItems = () => { setShowFullItems(!showFullItems); @@ -82,9 +80,8 @@ const UIEntityTagGroup = (props: Props) => { className={`pb-2 widget-tag-collapsible widget-tag-collapsible-${props.tag .toLowerCase() .replace(/ /g, "-")}`} - isOpen={isOpen} + isOpen key={props.tag} - onOpenChange={setIsOpen} > {
{props.tag === WIDGET_TAGS.SUGGESTED_WIDGETS diff --git a/app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx b/app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx index 05096d2908..4b40346ec2 100644 --- a/app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx +++ b/app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx @@ -127,21 +127,4 @@ describe("UIEntitySidebar", () => { const { queryByText } = renderUIEntitySidebar(true, true); expect(queryByText(WIDGET_TAGS.SUGGESTED_WIDGETS)).toBeNull(); }); - - it("6. should have `Building Blocks` section open when no widgets exist", () => { - mockUIExplorerItems(); - const { getAllByTestId, getByText } = renderUIEntitySidebar(true, true); - expect(getByText(WIDGET_TAGS.BUILDING_BLOCKS)).not.toBeNull(); - const groups = getAllByTestId("ui-entity-tag-group"); - for (const group of groups) { - if ( - group.getElementsByClassName("t--widget-card-draggable-buildingblock") - .length - ) { - expect(group.getAttribute("data-collapsed")).toBe("false"); - } else { - expect(group.getAttribute("data-collapsed")).toBe("true"); - } - } - }); });