Skip to content

Fix random selection not showing selection when all groups are collapsed#36404

Merged
bdach merged 8 commits intoppy:masterfrom
peppy:fix-carousel-thing
Jan 22, 2026
Merged

Fix random selection not showing selection when all groups are collapsed#36404
bdach merged 8 commits intoppy:masterfrom
peppy:fix-carousel-thing

Conversation

@peppy
Copy link
Copy Markdown
Member

@peppy peppy commented Jan 20, 2026

Closes #36365.

This reverts a previous fix (#35163 plus follow-up regression fix) and applies a hopefully more permanent fix which doesn't affect other scenarios.

I also did some refactoring, which is in the last commit. It can be skipped or applied separately as preferred (but without it I have trouble understanding the fix I made here).

Note that I'm still dealing with surrounding flaky tests and only pushing this PR out to see how production CI responds. It should be considered a functional RFC.

peppy added 5 commits January 20, 2026 21:12
…apsing group with current selection"

This reverts commit 9ba9966.
… user manually collapsed them"

This reverts commit bc4d5d0.
This avoids the implicit group expansion happening that the added code
was attempting to fix.
This is not required to fix the issue, but it is required for my brain
to follow the method to some degress.
@peppy peppy force-pushed the fix-carousel-thing branch from 56e94d6 to 46b2d53 Compare January 20, 2026 12:12
@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jan 21, 2026

I don't understand this diff at all.

8860eec replaces a HandleItemSelected() call with inlining the non-problematic part of it that doesn't expand the group. aside from the fact that it's for whatever reason not checking BeatmapSetsGroupedTogether before trying to expand sets that may not exist, I get that part.

but then... 46b2d53 reverts to using HandleItemSelected()? and instead adds some is GroupedBeatmap check that is presumably load-bearing here, but I don't know why? is this a null check? is this a type check? no idea. there's also a group expansion operation at the end that was seemingly straight-up removed? is that load-bearing / the moved fix? if not, where did it go?

@peppy
Copy link
Copy Markdown
Member Author

peppy commented Jan 21, 2026

and instead adds some is GroupedBeatmap

This part was just tidying up. The important part is the removal of the final setExpandedGroup call via the refactoring.

The final diff makes more sense to me because we're calling just HandleSelectedItem in all cases (which can be rationalised as "running even in the case of model equality for visual resync purposes"), and it's always working as expected.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jan 21, 2026

I was unconvinced so I went fishing and found an apparent regression:

  1. start with a grouping mode set and beatmaps grouped by set
  2. select any beatmap
  3. collapse its enclosing group
  4. filter it out
  5. clear the filter
  6. expand the group
  7. the set panel of the selected beatmap will be collapsed and will not respond to attempts of expanding it

doesn't appear to happen on master.

Screen.Recording.2026-01-21.at.09.52.48.mov

appears to be failing on the following guard:

if (selection.Group == ExpandedGroup)

@peppy
Copy link
Copy Markdown
Member Author

peppy commented Jan 21, 2026

I haven't made a test for your provided case yet, but I've hopefully fixed it.

Will add a test tomorrow. I'm pretty happy with the latest diff.

@peppy peppy force-pushed the fix-carousel-thing branch from 3a391d7 to 6354286 Compare January 22, 2026 06:10
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 22, 2026
@peppy
Copy link
Copy Markdown
Member Author

peppy commented Jan 22, 2026

Added test coverage of failing scenario.

Copy link
Copy Markdown
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't seem to break this anymore. at the same time I also expect someone to find some breakage and this to require another fix on top, but we can add unit tests ad nauseam until hopefully a stable equilibrium is reached 🤷

@bdach bdach merged commit ea0b281 into ppy:master Jan 22, 2026
5 of 9 checks passed
@peppy peppy deleted the fix-carousel-thing branch January 25, 2026 10:44
peppy added a commit to peppy/osu that referenced this pull request Jan 27, 2026
I'm not sure how this will hold out. I can't really explain it in a
better way. I've tried about 10 other different iterations of this.

I don't like this fix. If this is not mergeable I'll probably look to
see if I can rewrite the expanded set state handling, because it's just
ass right now.

- Regressed in ppy#36404.
- Closes ppy#36445.
- Supersedes and closes ppy#36456.
peppy added a commit to peppy/osu that referenced this pull request Jan 27, 2026
I ended up using a very similar approach to ppy#36456 after multiple
alternative attempts.

- Regressed in ppy#36404.
- Closes ppy#36445.
- Supersedes and closes ppy#36456.
bdach pushed a commit that referenced this pull request Jan 27, 2026
Closes #36445.

Fixes a regression from #36404

---------

Co-authored-by: Dean Herbert <pe@ppy.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choosing a random song via F5 while on Song Select does not always automatically open the group

2 participants