From 0fff9d49378ce8acc9aa0e612b6215ed831eea9b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 16 Feb 2024 19:17:41 +0900 Subject: [PATCH 1/3] Add non-whitespace search term for mods --- osu.Game/Overlays/Mods/ModPanel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Mods/ModPanel.cs b/osu.Game/Overlays/Mods/ModPanel.cs index f294b1892d..2d8d01d8c8 100644 --- a/osu.Game/Overlays/Mods/ModPanel.cs +++ b/osu.Game/Overlays/Mods/ModPanel.cs @@ -80,6 +80,7 @@ namespace osu.Game.Overlays.Mods public override IEnumerable FilterTerms => new[] { Mod.Name, + Mod.Name.Replace(" ", string.Empty), Mod.Acronym, Mod.Description }; From 84fdcd24ef17194422a3aab9f3d6653955cda3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 22 Feb 2024 10:56:50 +0100 Subject: [PATCH 2/3] Remove description from mod search terms Closes https://github.com/ppy/osu/issues/27111. --- osu.Game/Overlays/Mods/ModPanel.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModPanel.cs b/osu.Game/Overlays/Mods/ModPanel.cs index 2d8d01d8c8..cf173b0d6a 100644 --- a/osu.Game/Overlays/Mods/ModPanel.cs +++ b/osu.Game/Overlays/Mods/ModPanel.cs @@ -77,12 +77,11 @@ namespace osu.Game.Overlays.Mods /// public bool Visible => modState.Visible; - public override IEnumerable FilterTerms => new[] + public override IEnumerable FilterTerms => new LocalisableString[] { Mod.Name, Mod.Name.Replace(" ", string.Empty), Mod.Acronym, - Mod.Description }; public override bool MatchingFilter From b08fcbd4e953af0051bf9560eba57006763ded43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 22 Feb 2024 10:56:13 +0100 Subject: [PATCH 3/3] Adjust tests to new behaviour --- .../Visual/UserInterface/TestSceneModSelectOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 99a5897dff..b26e126249 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -788,7 +788,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert("all columns visible", () => this.ChildrenOfType().All(col => col.IsPresent)); AddStep("set search", () => modSelectOverlay.SearchTerm = "HD"); - AddAssert("one column visible", () => this.ChildrenOfType().Count(col => col.IsPresent) == 1); + AddAssert("two columns visible", () => this.ChildrenOfType().Count(col => col.IsPresent) == 2); AddStep("filter out everything", () => modSelectOverlay.SearchTerm = "Some long search term with no matches"); AddAssert("no columns visible", () => this.ChildrenOfType().All(col => !col.IsPresent)); @@ -812,7 +812,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert("all columns visible", () => this.ChildrenOfType().All(col => col.IsPresent)); AddStep("set search", () => modSelectOverlay.SearchTerm = "fail"); - AddAssert("one column visible", () => this.ChildrenOfType().Count(col => col.IsPresent) == 2); + AddAssert("one column visible", () => this.ChildrenOfType().Count(col => col.IsPresent) == 1); AddStep("hide", () => modSelectOverlay.Hide()); AddStep("show", () => modSelectOverlay.Show());