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 support for displaying "mapper" badge in comment section #27164
Conversation
Would cause the mapper badge to never actually be shown in the real world.
Have applied changes. Mostly minor, up until 68247fa - typo in json property name meant that this would have never actually worked outside of tests because
would fail to match due to null |
@@ -14,18 +14,18 @@ namespace osu.Game.Tests.Visual.UserInterface | |||
{ | |||
public abstract partial class ThemeComparisonTestScene : OsuGridTestScene | |||
{ | |||
private readonly bool showNoColourProvider; | |||
private readonly bool showWithoutColourProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh haha, this is the name I chose initially for the variable. It read slightly weird to me so I replaced Without
with No
.
Kindly stop, I literally tested this on production. It was only the fact that I had altered the conditions of querying the metadata on the last minutes of opening a PR as I was checking against web (read second paragraph of #27164 (comment)). Saying "clearly no attempt" is straight up an insult to me, I'm sure you know that. |
For a quick summary on the interaction between the client and the API on determining the "mapper" badge, there exists a property in each comment bundle named
commentable_meta
. The property contains information about the page which the user is commenting on ("commentable object"). The fieldowner_id
defines the user which owns the page (e.g. the mapper in a beatmap page), and the fieldowner_title
which has the title given to the user (e.g. "mapper").Interestingly, the
commentable_meta
property is actually a list of potentially multipleCommentableMeta
elements, instead of a singular one. I've inquired about this in discord and it seems there is somewhat of a technical reason behind it? Either way, I've went with a sane approach of finding the most relevantCommentableMeta
by comparing against the commentable ID associated with the comment (which sort of matches web?).The part I'm most unsure of is the structure of passing the
CommentableMeta
data. I've went with the simplest approach of passing it via constructor fromCommentableContainer
down to eachComment
, adding an extra parameter in eachGetDrawableComment
call. Open to feedback on any other method to better approach this.