diff --git a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs index d2b18b2f33..490d5095ec 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs @@ -343,6 +343,12 @@ namespace osu.Game.Screens.SelectV2 } } + /// + /// Tracks whether the user has manually requested to collapse an open group. + /// In this case, refilters should not forcibly expand groups until the user expands a group again themselves. + /// + private bool userCollapsedGroup; + protected override void HandleItemActivated(CarouselItem item) { try @@ -355,11 +361,19 @@ namespace osu.Game.Screens.SelectV2 { setExpansionStateOfGroup(ExpandedGroup, false); ExpandedGroup = null; + userCollapsedGroup = true; return; } setExpandedGroup(group); + if (userCollapsedGroup) + { + if (grouping.BeatmapSetsGroupedTogether && CurrentGroupedBeatmap != null) + setExpandedSet(new GroupedBeatmapSet(CurrentGroupedBeatmap.Group, CurrentGroupedBeatmap.Beatmap.BeatmapSet!)); + userCollapsedGroup = false; + } + // If the active selection is within this group, it should get keyboard focus immediately. if (CurrentSelectionItem?.IsVisible == true && CurrentSelection is GroupedBeatmap gb) RequestSelection(gb); @@ -398,6 +412,9 @@ namespace osu.Game.Screens.SelectV2 throw new InvalidOperationException("Groups should never become selected"); case GroupedBeatmap groupedBeatmap: + if (userCollapsedGroup) + break; + setExpandedGroup(groupedBeatmap.Group); if (grouping.BeatmapSetsGroupedTogether)