1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-24 06:32:56 +08:00
Commit Graph

23 Commits

Author SHA1 Message Date
Bartłomiej Dach
a068d88b84
Merge pull request #31823 from peppy/carousel-v2-optimisation-pass
Refactor grouping to be much more efficient
2025-02-07 10:44:53 +01:00
Dean Herbert
9d979dc3f4
Refactor grouping to be much more efficient 2025-02-07 16:35:20 +09:00
Dean Herbert
1cf375e329
Merge branch 'master' into carousel-v2-spacing 2025-02-07 14:34:59 +09:00
Dean Herbert
bff686f012
Avoid double iteration when updating group states 2025-02-06 17:22:50 +09:00
Dean Herbert
024fbde0fd
Refactor selection and activation handling
I had a bit of a struggle getting header traversal logic to work well.
The constraints I had in place were a bit weird:

- Group panels should toggle or potentially fall into the prev/next
  group
- Set panels should just traverse around them

The current method of using `CheckValidForGroupSelection` return type
for traversal did not mesh with the above two cases. Just trust me on
this one since it's quite hard to explain in words.

After some re-thinking, I've gone with a simpler approach with one
important change to UX: Now when group traversing with a beatmap set
header currently keyboard focused, the first operation will be to reset
keyboard selection to the selected beatmap, rather than traverse.

I find this non-offensive – at most it means a user will need to press
their group traversal key one extra time.

I've also changed group headers to always toggle expansion when doing
group traversal with them selected.

To make all this work, the meaning of `Activation` has changed somewhat.
It is now the primary path for carousel implementations to change
selection of an item. It is what the `Drawable` panels call when they
are clicked.

Selection changes are not performed implicitly by `Carousel` – an
implementation should decide when it actually wants to change the
selection, usually in `HandleItemActivated`.

Having less things mutating `CurrentSelection` is better in my eyes, as
we see this variable as only being mutated internally when utmost
required (ie the user has requested the change). With this change,
`CurrentSelection` can no longer become of a non-`T` type (in the
beatmap carousel implementation at least).

This might pave a path forward for making `CurrentSelection` typed, but
that comes with a few other concerns so I'll look at that as a
follow-up.
2025-02-06 17:02:44 +09:00
Dean Herbert
88ad87a78e
Expose set grouping state 2025-02-06 14:30:15 +09:00
Dean Herbert
11de429621
Add support for grouping by artist 2025-02-05 19:48:41 +09:00
Salman Alshamrani
fc5832ce67 Support variable spacing between carousel items 2025-02-05 05:20:26 -05:00
Dean Herbert
58560f8acf
Add tracking of expansion states for groups and sets 2025-02-04 17:51:51 +09:00
Dean Herbert
6a18d18feb
Fix null handling when no items are populated but a selection is made 2025-02-03 02:39:45 +09:00
Dean Herbert
d74939e6e9
Fix backwards traversal of groupings and allow toggling groups without updating selection 2025-02-03 02:24:27 +09:00
Dean Herbert
764f799dcb
Improve selection flow using early exit and invalidation 2025-02-03 02:24:27 +09:00
Dean Herbert
d5dc55149d
Add initial difficulty grouping support 2025-02-03 02:24:27 +09:00
Dean Herbert
175eb82ccf
Split out beatmaps and set panels into two separate classes 2025-01-24 20:10:41 +09:00
Dean Herbert
9366bfbf0d
Move activation drawable flow portion to ICarouselPanel 2025-01-24 18:40:48 +09:00
Dean Herbert
f4270ab3b9
Simplify selection handling logic 2025-01-23 23:58:51 +09:00
Dean Herbert
d5369d3508
Add regions to BeatmapCarousel 2025-01-23 23:53:09 +09:00
Dean Herbert
2f94456a06
Add selection and activation flow 2025-01-23 18:51:24 +09:00
Dean Herbert
d526835627
Only show loading when doing a user triggered filter 2025-01-23 15:51:54 +09:00
Dean Herbert
900237c1ed
Add loading overlay and refine filter flow 2025-01-14 20:23:53 +09:00
Dean Herbert
cc8941a94a
Add animation and depth control 2025-01-14 20:12:09 +09:00
Dean Herbert
7e8a80a0e5
Add difficulty, artist and title sort examples
Also:

- Adds hinting at grouping and header status of items
- Passes through criteria and prepare for grouping tests.
- Makes `Filters` list `protected` because naming clash with `Filter()`
  on `BeatmapCarousel`.
2025-01-14 19:52:48 +09:00
Dean Herbert
d97a3270a5
Split out BeatmapCarousel classes and drop V2 suffix 2025-01-14 19:18:02 +09:00