diff --git a/.changeset/shy-plants-retire.md b/.changeset/shy-plants-retire.md new file mode 100644 index 0000000000000..77427452f58c9 --- /dev/null +++ b/.changeset/shy-plants-retire.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search': patch +--- + +Updated the default SearchType.Accordion behavior to remain open after result type selection. This is a UX improvement to reduce the number of clicks needed when toggling result type filters. diff --git a/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx b/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx index 556a9550a07c5..453b76679111a 100644 --- a/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx +++ b/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx @@ -140,18 +140,6 @@ describe('SearchType.Accordion', () => { expect(setPageCursorMock).toHaveBeenCalledWith(undefined); }); - it('should collapse when a new type is selected', async () => { - const { getByText, queryByText } = render( - - - , - ); - - await user.click(getByText(expectedType.name)); - - expect(queryByText('Collapse')).not.toBeInTheDocument(); - }); - it('should show result counts if enabled', async () => { const { getAllByText } = render( diff --git a/plugins/search/src/components/SearchType/SearchType.Accordion.tsx b/plugins/search/src/components/SearchType/SearchType.Accordion.tsx index f9a07b6dcd488..bdd13f2fb254e 100644 --- a/plugins/search/src/components/SearchType/SearchType.Accordion.tsx +++ b/plugins/search/src/components/SearchType/SearchType.Accordion.tsx @@ -96,7 +96,6 @@ export const SearchTypeAccordion = (props: SearchTypeAccordionProps) => { return () => { setTypes(type !== '' ? [type] : []); setPageCursor(undefined); - setExpanded(false); }; };