Skip to content

Fix song select background preview when clicking on the beatmap info area / leaderboard#38105

Open
austin19moore wants to merge 4 commits into
ppy:masterfrom
austin19moore:37977
Open

Fix song select background preview when clicking on the beatmap info area / leaderboard#38105
austin19moore wants to merge 4 commits into
ppy:masterfrom
austin19moore:37977

Conversation

@austin19moore

@austin19moore austin19moore commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Resolves #37977

Currently, long clicking on the empty background space in the beatmap details area does not trigger the background preview like it does on the song select carousel.

This MR reverts the blanket changes in #33748, and replaces them with logic to filter wanted / unwanted OnMouseDown events in BeatmapDetailsArea.

Any feedback here is appreciated!

Before:

2026-06-17.22-27-53.mp4

After:

2026-06-17.22-25-36.mp4

…beatmap details area / leaderboard in song select.
@austin19moore austin19moore changed the title Fix backround preview when clicking and holding the backround on the … Fix song select backround preview when clicking on the beatmap info area / leaderboard Jun 18, 2026
@bdach bdach added area:song-select type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work. subjective PRs with subjective changes which have not been discussed prior. Need team consensus to proceed. labels Jun 18, 2026
@peppy

peppy commented Jun 18, 2026

Copy link
Copy Markdown
Member

Seems fine as long as it doesn't regress any behaviours

@peppy peppy removed the subjective PRs with subjective changes which have not been discussed prior. Need team consensus to proceed. label Jun 18, 2026
@bdach bdach changed the title Fix song select backround preview when clicking on the beatmap info area / leaderboard Fix song select background preview when clicking on the beatmap info area / leaderboard Jun 19, 2026

@bdach bdach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

First of all, this should have visual tests. Fixing these sorts of subtle input handling issues without test coverage leads to inadvertent regressions later.

Secondly, this seems way too complicated and unidiomatic for what it should be. On a quick check this should be no more than the following:

diff --git a/osu.Game/Graphics/UserInterfaceV2/ShearedDropdown.cs b/osu.Game/Graphics/UserInterfaceV2/ShearedDropdown.cs
index af69aefaaf..ac974719e2 100644
--- a/osu.Game/Graphics/UserInterfaceV2/ShearedDropdown.cs
+++ b/osu.Game/Graphics/UserInterfaceV2/ShearedDropdown.cs
@@ -50,6 +50,8 @@ public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
         {
         }
 
+        protected override bool OnMouseDown(MouseDownEvent e) => true;
+
         protected partial class ShearedDropdownMenu : OsuDropdown<T>.OsuDropdownMenu
         {
             public ShearedDropdownMenu()
diff --git a/osu.Game/Screens/Select/BeatmapLeaderboardScore.cs b/osu.Game/Screens/Select/BeatmapLeaderboardScore.cs
index bb96c97d52..6c03efb9dd 100644
--- a/osu.Game/Screens/Select/BeatmapLeaderboardScore.cs
+++ b/osu.Game/Screens/Select/BeatmapLeaderboardScore.cs
@@ -534,6 +534,8 @@ protected override void OnHoverLost(HoverLostEvent e)
             base.OnHoverLost(e);
         }
 
+        protected override bool OnMouseDown(MouseDownEvent e) => true;
+
         private void updateState()
         {
             var lightenedGradient = ColourInfo.GradientHorizontal(backgroundColour.Opacity(0).Lighten(0.2f), backgroundColour.Lighten(0.2f));
diff --git a/osu.Game/Screens/Select/BeatmapLeaderboardWedge.cs b/osu.Game/Screens/Select/BeatmapLeaderboardWedge.cs
index 56d23dd154..0987d17b4e 100644
--- a/osu.Game/Screens/Select/BeatmapLeaderboardWedge.cs
+++ b/osu.Game/Screens/Select/BeatmapLeaderboardWedge.cs
@@ -16,7 +16,6 @@
 using osu.Framework.Graphics.Colour;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Sprites;
-using osu.Framework.Input.Events;
 using osu.Framework.Threading;
 using osu.Framework.Utils;
 using osu.Game.Beatmaps;
@@ -88,13 +87,6 @@ public partial class BeatmapLeaderboardWedge : VisibilityContainer
 
         private const float personal_best_height = 112;
 
-        // Blocking mouse down is required to avoid song select's background reveal logic happening while hovering scores.
-        // Our horizontal alignment doesn't really align with the rest of the sheared components (protrudes a touch to the right) which makes
-        // it complicated to handle this at a higher level.
-        public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => scoresScroll.ReceivePositionalInputAt(screenSpacePos);
-
-        protected override bool OnMouseDown(MouseDownEvent e) => true;
-
         private Sample? swishSample;
 
         private readonly List<ScheduledDelegate> scoreSfxDelegates = new List<ScheduledDelegate>();
diff --git a/osu.Game/Screens/Select/LeftSideInteractionContainer.cs b/osu.Game/Screens/Select/LeftSideInteractionContainer.cs
index 4b28213f4e..539aebe93b 100644
--- a/osu.Game/Screens/Select/LeftSideInteractionContainer.cs
+++ b/osu.Game/Screens/Select/LeftSideInteractionContainer.cs
@@ -29,8 +29,6 @@ public LeftSideInteractionContainer(Action resetCarouselPosition)
         // as those will usually correspond to other interactions like adjusting volume.
         protected override bool OnScroll(ScrollEvent e) => !e.ControlPressed && !e.AltPressed && !e.ShiftPressed && !e.SuperPressed;
 
-        protected override bool OnMouseDown(MouseDownEvent e) => true;
-
         protected override void LoadComplete()
         {
             inputManager = GetContainingInputManager()!;

I have particular problems with the ShearedButton change (what does that have to do with fixing the issue?) and the weird unidiomatic corralling of hover states in BeatmapDetailsArea to determine whether to handle or not handle mouse down events.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jun 23, 2026
@austin19moore

Copy link
Copy Markdown
Contributor Author

Reverted the ShearedButton change, and added a new test file with test cases for:

  • Clicking and holding a score (preview blocked)
  • Clicking and holding each of the leaderboard control types (preview blocked)
  • Clicking and holding the leaderboard background (preview triggers)

Blocking OnMouseDown in BeatmapLeaderboardScore breaks dragging on scores in the leaderboard to scroll through the list, so I handled that with OnMouseDown by checking if a score is hovered in BeatmapLeaderboardWedge instead. Would there be a better way other than checking the hover state on the scores that doesn't break dragging and still triggers the preview on the leaderboard?

bdach added 2 commits June 25, 2026 11:53
- It's spelled `background`.
- Wait steps are not measured "in seconds". Each wait step takes
  `TimePerAction` as defined by the test scene.
- Actually assert whether the background was hidden or not by checkign
  the actual state of one of the components affected by the background
  reveal (footer).
Meant you could reveal the background via clicking in between the tab
items which is really strange.
@bdach

bdach commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

I began to fix this up but then discovered this behaviour:

Screen.Recording.2026-06-25.at.12.01.42.mov

I presume this is bad and should not happen but I do not actually know whether my opinion is correct. @peppy please advise.

@bdach bdach added the subjective PRs with subjective changes which have not been discussed prior. Need team consensus to proceed. label Jun 25, 2026
@peppy

peppy commented Jun 25, 2026

Copy link
Copy Markdown
Member

I think I'd agree with that dead space not revealing background.

@bdach bdach removed the subjective PRs with subjective changes which have not been discussed prior. Need team consensus to proceed. label Jun 25, 2026

@bdach bdach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requires behavioral changes as described above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:song-select size/L type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long click to hide UI (background preview) doesn't work on empty 'Ranking' space

4 participants