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

Add highest rank tooltip to global rank display #27107

Merged
merged 7 commits into from
Feb 22, 2024

Conversation

Joehuu
Copy link
Member

@Joehuu Joehuu commented Feb 10, 2024

this PR Web
Screenshot 2024-02-09 at 3 56 49 PM Screenshot 2024-02-09 at 3 55 32 PM

@@ -34,6 +34,19 @@ public class APIUser : IEquatable<APIUser>, IUser
[JsonProperty(@"previous_usernames")]
public string[] PreviousUsernames;

[JsonProperty(@"rank_highest")]
[CanBeNull]
public UserRankHighest RankHighest;
Copy link
Collaborator

Choose a reason for hiding this comment

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

and this class keeps growing and growing and growing and growing.........

Content = s.NewValue?.GlobalRank?.ToLocalisableString("\\##,##0") ?? (LocalisableString)"-";
}, true);

// needed as statistics doesn't populate User
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you elaborate? I don't follow what this is trying to say.

Copy link
Member Author

Choose a reason for hiding this comment

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

Talking about this:

[JsonProperty]
public APIUser User;

Seems to return null, so I have to add the User bindable instead of just using UserStatistics.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, this is what happens when API models are overloaded to be used in 30 different contexts.........

I'd at least reword the comment to mention the specific class rather than vaguely mention "statistics" of unknown provenance.

Comment on lines 169 to 172
UserStatistics = { BindTarget = statistics },
// TODO: make highest rank update, as api.LocalUser doesn't update
// maybe move to statistics in api, so `SoloStatisticsWatcher` can update the value
User = { BindTarget = user },
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure how changes in here are going to interact with #27128. I'm guessing that they are not going to do so at all, since I don't believe anything refetches user on ruleset change (and that's probably a good thing).

Feels like too many cooks in the area. Maybe best to back these changes out for now. Or else wait for that pull to go through.

@bdach
Copy link
Collaborator

bdach commented Feb 19, 2024

Are you willing to back out the GlobalRankDisplay changes for now? I'm reluctant to merge this without that, because the lack of correct updating flows there is inevitably going to lead to things looking weird.

@Joehuu
Copy link
Member Author

Joehuu commented Feb 19, 2024

Yeah will do, wasn't worth centralizing when the LoginOverlay usage was not updating correctly, to begin with.

Also don't show on `LoginOverlay` usage for now.
@pull-request-size pull-request-size bot added size/M and removed size/L labels Feb 19, 2024
@bdach bdach merged commit 57bb0b8 into ppy:master Feb 22, 2024
13 of 17 checks passed
@Joehuu Joehuu deleted the rank-highest-tooltip branch February 22, 2024 21:03
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.

2 participants