Skip to content

Conversation

EYHN
Copy link
Contributor

@EYHN EYHN commented Jul 30, 2025

This PR adds MinDisplayRange and MaxDisplayRange properties to SliderBar, allowing the display range to be adjusted instead of being fixed to BindableNumber.MinValue and BindableNumber.MaxValue.

Context: ppy/osu#34362 (comment)
I spent some time considering variable naming and changed some original variable names, which may require discussion.

This change will not break the original behavior of SliderBar, and osu should be able to upgrade safely.

2025-07-30.130525.mp4

After this PR is merged, it will be possible to adjust the LowerBound and UpperBound ranges independently in osu ShearedSliderBar

2025-07-30.131643.mp4

/// <summary>
/// Triggered when the <see cref="Current"/> value has changed. Used to update the displayed value.
/// </summary>
/// <param name="value">The normalized <see cref="Current"/> value.</param>
/// <param name="value">
Copy link
Member

Choose a reason for hiding this comment

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

I think this parameter should be renamed to position.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree

@peppy peppy self-requested a review July 30, 2025 09:43
}

currentNumberInstantaneous.SetProportional(newValue, e.ShiftPressed ? KeyboardStep : 0);
double min = double.CreateTruncating(MinDisplayRange);
Copy link
Member

Choose a reason for hiding this comment

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

We should probably explain here that this implementation matches BindableNumber.SetProportional (now unused and having no test coverage). Or maybe even remove that method (although note that it is public..)

@peppy
Copy link
Member

peppy commented Jul 30, 2025

This looks like it will work well for the scenario in question.

I'd want a second @ppy/team-client review as this is a framework change altering a central component.

@peppy peppy requested a review from a team July 30, 2025 09:46
@bdach
Copy link
Collaborator

bdach commented Jul 30, 2025

How on earth is this the resolution to whatever the game-side problem is? This "feature" is so broken.

Using the test added in this PR as-is, why can I go below zero if the MinDisplayRange is set to zero?

Screen.Recording.2025-07-30.at.12.15.52.mov

Why can I specify MaxDisplayRange < MinDisplayRange and have the slider bar work right-to-left?

Screen.Recording.2025-07-30.at.12.16.56.mov

Why does this allow specifying a wider range of movement than the underlying bindable therefore allowing half the slide range to be dead?

Screen.Recording.2025-07-30.at.12.17.25.mov

I haven't examined the reason why this is apparently needed in closer detail but really?

@bdach
Copy link
Collaborator

bdach commented Jul 30, 2025

Oh and I apparently can just bypass the "display range" entirely by dragging past the bounds of the slider (set to [0,5] on this video):

Screen.Recording.2025-07-30.at.12.23.15.mov

@peppy
Copy link
Member

peppy commented Jul 30, 2025

@EYHN Based on the above, and the general feeling that we don't want to over-complicate the SliderBar class, we should try and figure a local workaround for this osu! side rather than making framework changes.

@peppy peppy added the blocked label Jul 30, 2025
@peppy peppy removed the request for review from a team July 30, 2025 10:34
@EYHN
Copy link
Contributor Author

EYHN commented Jul 30, 2025

Okay, thanks for your time reviewing this. I will consider how to workaround it.

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.

3 participants