-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add role badges to WebUI #21393
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 role badges to WebUI #21393
Conversation
cc62165
to
2727e68
Compare
2727e68
to
d73b683
Compare
Any idea why codeclimate is stuck? |
No idea, looks like it's just a fluke, and thankfully not on the test or linter results themselves. |
Hello. I've just wanted to add that it worked like a charm. Examples: Not visible through Mastodon Android / iOS yet but works in Mobile Web perfectly too. Thank you. |
That may not be entirely true, as the admin setting the roles would have to account for any theme (e.g. something that looks fine with the dark theme may not work fine with the light theme, or the other way around) |
Discord has the role color as a circle instead of a background/border.
There's not just dark and light themes. There's also custom themes that could be any color. Text and background colors should only have to worry about contrast with themselves, and the role color shouldn't have to be considered because that would mean considering every single color. |
That being said, available custom themes are decided by the admins as well, not end-users (unless we enter user CSS territory in which case the users can also override the badges) |
I tested it out on glitch and the badges are not visible for some reason, im sure im doing something wrong. |
glitch-soc ships with two front-ends, the “vanilla” flavour and the “glitch” flavour; if you applied the changes as-is, they'd only affect the “vanilla” flavour. You need to port the changes to files under |
Thank you so much ^_^ |
This is fantastic - and much needed for some of my users i'd like to validate or offer supporter roles too. What would be the effort to add PRs to the mastodon mobile apps to show these badges? |
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.
I prefer the second design.
Which one would this be? This one? #21393 (comment) My main concern about it is that it would make profiles take even more vertical space, which is already a complaint we get with 4.0 profiles. |
Without taking a stand in the layout alignment-wise, as a CSS/UI guy I'd say the slight border-radius supports the Mastodon brand best, I'd keep it, that's my 2 cents on the matter. |
Any chance we could get something like this in for a 4.0.3 release? I have some high profile accounts that I've verified over phone and i'd love to have a "Verified" role that shows up on profile page (and have the mobile apps expose this eventually) |
You can push on your own like some of us did but keep in mind it's a beta stage and not final. In any case, please don't rush the developers :) It will be available when it's finally done. I'd suggest to keep this topic clean from non developer talk as any update usually notifies everyone in the thread. Have a nice day. |
Any work needed on this to get traction back on? Been some fantastic discussions above, but can't find exactly the cause for it getting stuck (other than of course Christmas and New Year 👍 ) |
Deployed this locally yesterday, it looks and functions great! Might I suggest an addition to display_name.js to show badges everywhere aswell? EDIT: Mainly a duplicative implementation but code-wise looks like this: @@ -62,8 +62,13 @@
acct = `${acct}@${localDomain}`;
}
+ let role = null;
+ if (account.get('role')) {
+ role = (<div key='role' className={`account-role user-role-${account.getIn(['role', 'id'])}`}>{account.getIn(['role', 'name'])}</div>);
+ }
+
displayName = <bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi>;
- suffix = <span className='display-name__account'>@{acct}</span>;
+ suffix = <span className='display-name__account'>@{acct}{role ? ` · ` : ""}{role}</span>;
} else {
displayName = <bdi><strong className='display-name__html'><Skeleton width='10ch' /></strong></bdi>;
suffix = <span className='display-name__account'><Skeleton width='7ch' /></span>;``` |
This pull request has merge conflicts that must be resolved before it can be merged. |
4991962
to
42f9704
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
42f9704
to
6b1a756
Compare
Sad to see this still not available in 4.1 😢 |
This pull request has merge conflicts that must be resolved before it can be merged. |
6b1a756
to
6d1331e
Compare
Any chance we could get custom emoji included in roles before the API and UI are stabilized? Servers using roles for supporter badges, manual verification, etc. will want those. Servers using roles for fun will definitely want those. |
Is this really the only comment blocking the merge to fix this 7-month old regression? |
Fixes #19922
Add moderation badges in the WebUI, as they were only available in the public pages.
Of note, I defined a new serializer for roles, as to not expose
permissions
(because it's not useful and may leak information that we do not want to expose) andhighlighted
(because it's always true in this context).