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

Add failing test showing double filter on entering song select

This commit is contained in:
Dean Herbert
2025-05-30 16:00:20 +09:00
Unverified
parent efbdd3fffb
commit 666d9b153c
3 changed files with 17 additions and 1 deletions
@@ -356,7 +356,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
""");
createHeader("carousel");
stats.AddParagraph($"""
sorting: {Carousel.IsFiltering}
filtering: {Carousel.IsFiltering} (total {Carousel.FilterCount} times)
tracked: {Carousel.ItemsTracked}
displayable: {Carousel.DisplayableItems}
displayed: {Carousel.VisibleItems}
@@ -78,6 +78,15 @@ namespace osu.Game.Tests.Visual.SongSelectV2
AddUntilStep("wait for results screen", () => Stack.CurrentScreen is ResultsScreen);
}
[Test]
public void TestSingleFilterWhenEntering()
{
ImportBeatmapForRuleset(0);
LoadSongSelect();
AddAssert("single filter", () => Carousel.FilterCount, () => Is.EqualTo(1));
}
[Test]
public void TestCookieDoesNothingIfNothingSelected()
{
+7
View File
@@ -71,6 +71,11 @@ namespace osu.Game.Graphics.Carousel
/// </summary>
public bool IsFiltering => !filterTask.IsCompleted;
/// <summary>
/// The number of times filter operations have been triggered.
/// </summary>
internal int FilterCount { get; private set; }
/// <summary>
/// The number of displayable items currently being tracked (before filtering).
/// </summary>
@@ -187,6 +192,8 @@ namespace osu.Game.Graphics.Carousel
/// <param name="clearExistingPanels">Whether all existing drawable panels should be reset post filter.</param>
protected virtual Task<IEnumerable<CarouselItem>> FilterAsync(bool clearExistingPanels = false)
{
FilterCount++;
if (clearExistingPanels)
filterReusesPanels.Invalidate();