From f33a050120c0c81bf11f5eab5f1ccc9608c23007 Mon Sep 17 00:00:00 2001 From: regexowl Date: Mon, 7 Oct 2024 13:43:25 +0200 Subject: [PATCH] Wizard: Default to Included repos in package search Previously when you searched for package from repositories recommendations and switched to "Other repos", new search left you in Other repos and didn't show results even if they were found in "Included". Since we search for recommendations only when no matches were found in distro and custom repos, the results will be always empty. This solves the problem by defaulting to "Included repos" toggle with every new search, limiting clicks required from the user. How to reproduce previous behaviour: 1. search for 'gnuplot' packages 2. no results should be found, switch to "Other repos" 3. search for a distro/custom repo package like "vim" Previous behaviour - the "Other repos" toggle is still selected, showing no results. When switching to "Included repos" manually, the results can be found there. New behaviour - "Included repos" gets automatically selected, showing results for packages found in distro and custom repos. --- src/Components/CreateImageWizard/steps/Packages/Packages.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Components/CreateImageWizard/steps/Packages/Packages.tsx b/src/Components/CreateImageWizard/steps/Packages/Packages.tsx index e8dc7ebd..77458755 100644 --- a/src/Components/CreateImageWizard/steps/Packages/Packages.tsx +++ b/src/Components/CreateImageWizard/steps/Packages/Packages.tsx @@ -808,10 +808,12 @@ const Packages = () => { selection: string ) => { setSearchTerm(selection); + setToggleSourceRepos(RepoToggle.INCLUDED); }; const handleClear = async () => { setSearchTerm(''); + setToggleSourceRepos(RepoToggle.INCLUDED); }; const handleSelect = (