From 1da4e0eca2aed1877a1fc345b1d8d7ad71b08e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B6disch=2C=20Alexander?= Date: Mon, 26 Jan 2026 09:44:06 +0100 Subject: [PATCH] feat(search): add configurable default search type via app-config.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vödisch, Alexander --- .changeset/three-rooms-enjoy.md | 2 +- packages/app/src/components/search/SearchPage.tsx | 5 +++-- plugins/search/README.md | 1 + plugins/search/config.d.ts | 5 +++++ plugins/search/src/alpha.tsx | 5 +++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.changeset/three-rooms-enjoy.md b/.changeset/three-rooms-enjoy.md index d47c369ff9..9856aba0e8 100644 --- a/.changeset/three-rooms-enjoy.md +++ b/.changeset/three-rooms-enjoy.md @@ -2,4 +2,4 @@ '@backstage/plugin-search': minor --- -Set the default search type to `All` instead of `Software Catalog` in the search page. +Added support for configuring the default search type in the search page via the `search.defaultType` option in `app-config.yaml`. This applies to both the legacy and new frontend systems. If not set, the default is empty, which means searching for "all" types. diff --git a/packages/app/src/components/search/SearchPage.tsx b/packages/app/src/components/search/SearchPage.tsx index 743a08561c..b83b83bd65 100644 --- a/packages/app/src/components/search/SearchPage.tsx +++ b/packages/app/src/components/search/SearchPage.tsx @@ -22,7 +22,7 @@ import { Page, useSidebarPinState, } from '@backstage/core-components'; -import { useApi } from '@backstage/core-plugin-api'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { CatalogSearchResultListItem } from '@backstage/plugin-catalog'; import { CATALOG_FILTER_EXISTS, @@ -60,6 +60,7 @@ const SearchPage = () => { const { isMobile } = useSidebarPinState(); const { types } = useSearch(); const catalogApi = useApi(catalogApiRef); + const configApi = useApi(configApiRef); return ( @@ -73,7 +74,7 @@ const SearchPage = () => { @@ -152,6 +154,9 @@ export const searchPage = PageBlueprint.makeWithOverrides({