Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix beatmap links not truncating correctly on playlists/multiplayer #25396

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Joehuu
Copy link
Member

@Joehuu Joehuu commented Nov 9, 2023

There are NRT changes I'm not sure I did correctly. Also not sure about making OsuHoverContainer.IdleColour public, can make nested private classes instead if better.

Before After
Screenshot 2023-11-08 at 5 12 32 PM Screenshot 2023-11-08 at 5 11 13 PM
Screenshot 2023-11-08 at 5 12 54 PM Screenshot 2023-11-08 at 5 11 42 PM

@@ -17,7 +17,7 @@ public partial class OsuHoverContainer : OsuClickableContainer

protected Color4 HoverColour;

protected Color4 IdleColour = Color4.White;
public Color4 IdleColour = Color4.White;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If going to do this, better make sure that the change of it takes effect immediately when any consumer sets it. I don't see this happening in this diff.

Comment on lines 208 to 210
// best effort to confine the auto-sized text to parent bounds
// TODO: remove when text/link flow can support truncation with ellipsis natively.
beatmapText.MaxWidth = mainFillFlow.DrawWidth;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this sort of thing go live as a default in TruncatingSpriteText? Sprinkling it everywhere that we've got this class already seems... like a waste of effort.

I know the wedge usage is slightly different but maybe it can be padded differently to achieve the same effect?

Copy link
Member Author

@Joehuu Joehuu Nov 10, 2023

Choose a reason for hiding this comment

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

I had a normalising suggestion when I was implementing the truncated text tooltips (also with RelativeSizeAxes removal):

I also tried centralising the MaxWidth and RelativeSizeAxes = Axes.X assigning to TruncatingSpriteText (Joehuu@dd8e1ba), but not sure about the solution as I'm working around a framework limitation and probably should be done more directly in SpriteText.

But now links are in the mix, and here's what my updated solution is (using ChildSize.X and omited X and the RelativeSizeAxes removal for now): e45a2b2

May need to incorporate the RelativeSizeAxes removal as it makes MaxWidth a relative value.


Or just isolate the non-link text and make a TruncatingLinkSpriteText : OsuHoverContainer but then I have to port all the OsuSpriteText properties or make it public...

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is even the framework limitation being worked around here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what I was saying at the time, but probably putting said logic framework-side in a proper way (through the use of properties) so framework consumers can use it and there is no usage of Update() game-side, but probably not feasible at the moment.

@Joehuu Joehuu self-assigned this Jan 9, 2024
@Joehuu
Copy link
Member Author

Joehuu commented Jan 9, 2024

Updated this as there were conflicts.

@Joehuu
Copy link
Member Author

Joehuu commented Feb 19, 2024

Updated to fix a compile error with master and remove the changes of TestSceneOsuDropdown in diff (already applied in #27178).

Copy link
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.

Merge conflicts

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know what's going on here but the entirety of the changes in this file just put me off wanting to review this instantly. The getFirstNonAutoSizedWidthAncestor() upwards traversal, the three obsoleted new members, all of this looks way too cursed for my pain threshold.

I'd expect a proper and exhaustive explanation of what's going on and clear evidence there is no better alternative in here before I approach this pull again.

I'd rather even revert to #25396 (comment) than do this.

Copy link
Member Author

@Joehuu Joehuu Feb 28, 2024

Choose a reason for hiding this comment

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

Totally cursed, did some research on why obsoleting properties this way are against OOP.

Will revert as implementing that logic is probably a framework-level task.

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.

None yet

2 participants