1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 06:00:25 +08:00

Do not forcibly re-expand carousel groups on refilters if the user manually collapsed them

RFC. Closes https://github.com/ppy/osu/issues/35091.
This commit is contained in:
Bartłomiej Dach
2025-09-30 15:17:03 +02:00
Unverified
parent 4b2f3efcbd
commit bc4d5d07d7
@@ -343,6 +343,12 @@ namespace osu.Game.Screens.SelectV2
}
}
/// <summary>
/// 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.
/// </summary>
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)