1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-24 01:33:21 +08:00
Commit Graph

700 Commits

Author SHA1 Message Date
Dean Herbert
5ace8e911b
Fix failing test 2025-02-07 21:46:00 +09:00
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
Bartłomiej Dach
ae179c8feb
Merge pull request #31824 from peppy/carousel-v2-group-click-transfer-keyboard
Always transfer keyboard selection on activation
2025-02-07 10:12:10 +01:00
Dean Herbert
cef9d2eac5
Reduce number of beatmaps added in selection test
This is because with the new keyboard selection logic, adding too many
can cause the re-added selection to be off-screen in the headless test
setup.
2025-02-07 17:02:53 +09:00
Dean Herbert
c935c3154b
Always transfer keyboard selection on activation 2025-02-07 17:02:53 +09:00
Dean Herbert
75ef6f6a0e
Use random generation in carousel stress test 2025-02-07 16:09:35 +09:00
Dean Herbert
aa329f397e
Remove stray [Solo]s 2025-02-07 15:30:31 +09:00
Dean Herbert
d505c529cd
Adjust tests in line with new expectations 2025-02-07 15:27:28 +09:00
Dean Herbert
1cf375e329
Merge branch 'master' into carousel-v2-spacing 2025-02-07 14:34:59 +09:00
Bartłomiej Dach
91bc23e39e
Merge pull request #31801 from peppy/carousel-v2-artist-grouping
Add support for grouping by artist to beatmap carousel v2
2025-02-06 13:13:35 +01:00
Dean Herbert
33035f0206
Merge branch 'master' into carousel-v2-spacing 2025-02-06 17:30:49 +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
4026ca84f8
Move selected retrieval functions to base class 2025-02-06 16:48:17 +09:00
Dean Herbert
a25e1f4f9b
Add test coverage of artist grouping 2025-02-06 16:48:17 +09:00
Dean Herbert
bf377e081a
Reorganise tests to make more logical when manually testing 2025-02-06 15:09:41 +09:00
Dean Herbert
0257b8c2ff
Move metadata randomisation local to usage 2025-02-06 14:07:50 +09:00
Dean Herbert
11de429621
Add support for grouping by artist 2025-02-05 19:48:41 +09:00
Salman Alshamrani
6037d5d8ce Add test coverage 2025-02-05 05:20:26 -05:00
Dean Herbert
14273824dc
Fix Carousel.FilterAsync not working when called from a non-update thread
I was trying to be smart about things and make use of our
`SynchronisationContext` setup, but it turns out to not work in all
cases due to the context being missing depending on where you are
calling the method from.

For now let's prefer the "works everywhere" method of scheduling the
final work back to update.
2025-02-05 16:40:11 +09:00
Dean Herbert
599b59cb14
Add expanded state to sample drawable representations 2025-02-04 18:06:16 +09:00
Dean Herbert
58560f8acf
Add tracking of expansion states for groups and sets 2025-02-04 17:51:51 +09:00
Dean Herbert
ccdb6e4c48
Fix carousel tests failing due to dependency on depth ordering 2025-02-04 17:50:16 +09:00
Dean Herbert
2f2dc158e0
Ensure test step doesn't consider pooled instances of drawables 2025-02-04 17:45:02 +09:00
Dean Herbert
b5c4e3bc14
Add failing tests for traversal on group headers 2025-02-04 02:55:34 +09:00
Dean Herbert
c7780c9fdc
Refactor how grouping is performed 2025-02-03 20:40:52 +09:00
Dean Herbert
9c34819ff4
Add test coverage for grouped selection 2025-02-03 02:39:45 +09:00
Dean Herbert
3cde11ab77
Re-enable masking by default 2025-02-03 02:24:26 +09:00
Bartłomiej Dach
b0136f98a9
Fix test failures 2025-01-24 14:24:16 +01:00
Dean Herbert
175eb82ccf
Split out beatmaps and set panels into two separate classes 2025-01-24 20:10:41 +09:00
Dean Herbert
eaea053c7d
Add test coverage of various selection examples
Where possible I've tried to match the test and method names of
`TestSceneBeatmapCarousel` for easy coverage comparison.
2025-01-23 18:51:25 +09:00
Dean Herbert
ffca90779f
Fix sort direction being flipped 2025-01-23 18:51:24 +09:00
Dean Herbert
9ab045495d
Tidy up tests in preparation for adding more 2025-01-23 18:51:24 +09:00
Dean Herbert
980f6cf18e
Make CarouselItem sealed and remove BeatmapCarouselItem concept
Less abstraction is better. As far as I can tell, we don't need a custom
model for this. If there's any tracking to be done, it should be done
within `BeatmapCarousel`'s implementation (or a filter).
2025-01-23 18:48:44 +09:00
Dean Herbert
8657576210
Show selection defaults in test scene (and make prettier) 2025-01-23 15:50:40 +09:00
Dean Herbert
a6057a9f54
Move absolute scroll support local to carousel and allow custom bindings 2025-01-16 20:47:59 +09:00
Dean Herbert
6027947657
Move animation handling to Carousel implementation to better handle add/removes
With the animation logic being external, it was going to make it very
hard to apply the scroll offset when a new panel is added or removed
before the current selection.

There's no real reason for the animations to be local to beatmap
carousel. If there's a usage in the future where the animation is to
change, we can add more customisation to `Carousel` itself.
2025-01-15 17:01:07 +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
Dean Herbert
ad04681b28
Add scroll position maintaining 2025-01-11 01:43:47 +09:00
Dean Herbert
5e9a7532d3
Add basic implementation of new beatmap carousel 2025-01-11 01:43:47 +09:00
Dean Herbert
b8a10d9b0e
Mark recommendation test as flaky
Will revisit during song select refactoring no doubt.
2025-01-07 17:58:12 +09:00
Dan Balasescu
edbaaa9468
Fix test 2024-12-13 17:41:55 +09:00
Joseph Madamba
f7364de01a
Add test and null protections 2024-12-12 15:23:00 -08:00
Dean Herbert
a868c33380
Remove BeatmapCarousel testing backdoor 2024-12-11 16:28:51 +09:00
Dean Herbert
c94b393e30
Access beatmap store via abstract base class
The intention here is to make things more testable going forward.
Specifically, to remove the "back-door" entrance into `BeatmapCarousel`
where `BeatmapSets` can be set by tests and bypas/block realm retrieval.
2024-12-11 16:28:51 +09:00
Salman Alshamrani
b106833663 Fix more test / component breakage 2024-11-17 20:36:12 -05:00
Salman Alshamrani
caf56afba6 Fix various test failures 2024-11-17 19:13:29 -05:00
Dan Balasescu
06380f91fc
Update test 2024-11-11 16:25:05 +09:00
Dan Balasescu
4d7fd236c5
Make class partial 2024-11-07 17:28:31 +09:00
Dan Balasescu
bd630c189e
Fix tests not working by forgoing beatmap updates 2024-11-07 17:26:10 +09:00