Avatar replacement for self-mentions doesn't work
-
^^See above. Self-mentions themselves do work, though: @djls45
-
@djls45 said in Avatar replacement for self-mentions doesn't work:
^^See above. Self-mentions themselves do work, though: @djls45
Apparently, one must have a custom avatar for this to work. Could the functionality be extended to include the defaults as well?
-
@djls45 said in Avatar replacement for self-mentions doesn't work:
@djls45 said in Avatar replacement for self-mentions doesn't work:
^^See above. Self-mentions themselves do work, though: @djls45
Apparently, one must have a custom avatar for this to work. Could the functionality be extended to include the defaults as well?
Apparently not, this was mentioned before and no traction was gained IMHO...
-
It'd be a pain because unlike Some Other Software, users without an explicit avatar get a div with a background and some text. While it's technically possible to fix, it's actually harder to fix because it's not like you have an img tag that you can set the size for and have the browser 'just deal with it'.
Of course, NodeBB could craft an image for users without an avatar but then you're in Discoterritory and we all know how that ended.
-
@djls45 congrats on the new avatar at least?
-
@Arantor said in Avatar replacement for self-mentions doesn't work:
It'd be a pain because unlike Some Other Software, users without an explicit avatar get a div with a background and some text. While it's technically possible to fix, it's actually harder to fix because it's not like you have an img tag that you can set the size for and have the browser 'just deal with it'.
Of course, NodeBB could craft an image for users without an avatar but then you're in Discoterritory and we all know how that ended.
Why write new code when there's Jeff's AaaS?
Of course they could also handle the no-avatar case by making a colored
span
with a letter in it, but where's the fun in that?
-
@JBert said in Avatar replacement for self-mentions doesn't work:
Of course they could also handle the no-avatar case by making a colored
span
with a letter in it, but where's the fun in that?NodeBB does this (albeit with a div not a span) which is why it would be a pain to fix this particular case.
Of course that wouldn't stop some software generating the image when the account is first created because that would never work or anything (if you really couldn't do it any other way), which is why AaaS is even a thing.
-
I don't remember what the "thinking" () was in Discourse for going the way they went (and I don't really care, apart from getting a laugh), but seriously, what are the arguments for saying that generating a picture from the letter when a new account is created is a bad solution?
As far as I can see, this requires a script on the server to generate this (which I'm sure must be all of 2 lines of script), and then storing the picture in exactly the same way as for any other user that has changed his avatar, so no overhead or complications? Did I miss something?
-
@remi I "think" the argument was ultimately "what if we want to change the font" which they did along the way somewhere.
Or possibly something to do with disambiguating people by colour was hard or something.
Either way, discologic struck again.
-
@Arantor said in Avatar replacement for self-mentions doesn't work:
@remi I "think" the argument was ultimately "what if we want to change the font" which they did along the way somewhere.
Hmm, that's a (semi)valid argument, yes. Although without a lot effort I can think of several trivial ways to work around that (i.e. somehow being able to tell that it's a default avatar, not a user-uploaded one) and regenerate them when needed...
Or you could just not bother and instead of pretending that a default avatar is some kind of special item that is intimately related to your user, just say "it's a default picture, different people may get different ones across time, if you don't like it just change it".
Plus, I cannot even begin to imagine the amount of code that is needed in many places to handle properly a default avatar (as a div) vs. a non-default one (as a picture)! This bug itself is just one of the places...
Either way, discologic struck again.
Yeah, I remember the thread about it was quite funny (wasn't registered at the time, but still a long-time regular reader). The part where they switched to a CDN (AaaS) was also... interesting!
Sometimes I wonder if there would be an easy way to highlight a few Disco choices as a "what not to do with software development" tutorial.
-
-
@remi said in Avatar replacement for self-mentions doesn't work:
This bug itself is just one of the places...
I think the avatarmoji is a local customisation, so not strictly a bug with NodeBB, although it does highlight the pointless distinction
-
@Arantor said in Avatar replacement for self-mentions doesn't work:
I "think" the argument was ultimately "what if we want to change the font" which they did along the way somewhere.
I remember people complaining about how some letters looked like they weren't centered properly or something, so they had to be able to tweak it to satisfy someone's font related OCD.
-
@boomzilla I think we signalled that as a noticeable problem only after the roundvatar incident?
-
@PleegWat This post is still hilarious:
https://meta.discourse.org/t/optimizing-letter-avatar-rendering/33082
As it's only a year ago, it wasn't the initial reports. Those are probably down the memory hole by now.
Option 1: ship a font and use CSS
The simplest and probably most efficient way would be to pick a pretty font from: https://www.google.com/fonts23 and use CSS to render this stuff.
If we were to do this with "font + CSS" we must use a consistent font, otherwise positioning will be hellish and the UX. Centering the letter is not going to be super easy but probably doable.
Pros:
Simple to build
Will be very fast regardless of avatar count on screen
Embed freindly
Cons:Centering in CSS is hard
We need to ship an extra icon font
CSS for this will be quite long
Not RSS friendly (unlikely to be even doable in a sane way)
Not Email friendly (will require a fair amount of work to get it to work in email)
-
@boomzilla Yeah. To be fair though, they never did what @remi suggests. They didn't generate letter avatars on account create and just handle them as uploaded images. They had a completely separate routing/caching scheme for them. Which, as you quote, didn't function very efficiently.
-
@PleegWat Yep. They are amazing people.
-
@boomzilla said in Avatar replacement for self-mentions doesn't work:
Letter avatars are our 4th most expensive route globally.
To be fair (to them), I guess we would need to know what proportions of users (or requests) that is. I mean, they spend just slightly less on that than on "regular" avatars, so if that's for serving the same number of requests, that wouldn't be an issue (at least, not compared to normal pictures).
Still, I love how after a lengthy discussion of how all proposed solutions are complicated and fragile, a couple of people try to propose (what seems to me to be) the sane solution, which is much simpler than all the rest, only to be told "it's complicated" and "OMG storing 10 MB of pics is too much"...
-
@remi Didn't that originate here? It's obviously wrong if it originates here.
-
@remi IIRC the space issue was because they were going to ship the complete set of colour/letter combination images pre rendered with the base install.
Not generating on demand which would have completely been a non issue. Because the retarded logic is that they're complaining about X MB of space. Which would be used if users uploaded an avatar anyway.
And, really, 10 MB? Even shitty-ass GoDaddy hosting offers enough space, and remember you need a VPS-class or better for Discohosting, where your space is already measured in GBs.
-
@Arantor Yeah, that's my point. Who the fuck bothers about a few MB, that would be used anyway if users changed their avatar? (which, according to one message in the discourssion, seems to be something that Discourse encourages users to do anyway...)
And even pre-generating and shipping... OK, that would be stupid, but even so, is that really going to be that huge compared to all the rest of the cruft that is included already? Does anyone really care about that?
-
@boomzilla said in Avatar replacement for self-mentions doesn't work:
@PleegWat Yep. They are amazing people.
They could always have a separate CDN for the background AND the letter! Double the fun. Naturally, both should be delivered using JSON stuffed with XML, for extra brillance. Even better, they should be reliant on a special script responsible for grabbing the fake avatars.
-
@Arantor said in Avatar replacement for self-mentions doesn't work:
Because the retarded logic is that they're complaining about X MB of space. Which would be used if users uploaded an avatar anyway.
Hell, just hardlink all green As to the same location if that's an issue. Which it isn't since a two-color letter in PNG doesn't even take a kilobyte from what I know.
I've been saying again and again that that's how they should've done that in the first place, but noooo, neither Discourse nor NodeBB could've gone for such a 2000s option.
-
There's a perfectly fine client-side API for image generation as well, and then you don't have to worry about server side performance at all. (OK, its text capabilities suck, but it can handle a centered fucking letter.)
You can generate them on-the-fly (which wouldn't really address this issue) or at user-creation/profile edit time.
-
@JBert said in Avatar replacement for self-mentions doesn't work:
Of course they could also handle the no-avatar case by making a colored span with a letter in it, but where's the fun in that?
They could also ship some images (16 shades × 26 letters?) that are used by default. You know, instead of getting into DADN territory…
-
@Arantor said in Avatar replacement for self-mentions doesn't work:
Or possibly something to do with disambiguating people by colour was hard or something.
Quite honestly, I notice the username first, then the avatar.
I almost completely ignore the left avatar column, except for a handful of people.
-
@xaade said in Avatar replacement for self-mentions doesn't work:
@Arantor said in Avatar replacement for self-mentions doesn't work:
Or possibly something to do with disambiguating people by colour was hard or something.
Quite honestly, I notice the username first, then the avatar.
I almost completely ignore the left avatar column, except for a handful of people.
I thought this was the case for me, until a few people changed their avatar and they were suddenly unfamiliar to me.
-
@error How would that work? The point is being able to simply do <img src="whatever.png">, and AFAIK you can't put javascript code in an image file.
However, SVG was actually designed for stuff like that, and it works in <img> tags now. The server could have a
/avatars/default/username.svg
endpoint that dynamically generated an SVG file (a background and a letter, trivial to make) and the client does all the rendering, which is how websites were supposed to be. Yay!Or, we could embrace the component-based web and just make everything a seamless iframe, which is basically the same idea but with svg replaced by moar HTML.
-
@error said in Avatar replacement for self-mentions doesn't work:
@xaade said in Avatar replacement for self-mentions doesn't work:
@Arantor said in Avatar replacement for self-mentions doesn't work:
Or possibly something to do with disambiguating people by colour was hard or something.
Quite honestly, I notice the username first, then the avatar.
I almost completely ignore the left avatar column, except for a handful of people.
I thought this was the case for me, until a few people changed their avatar and they were suddenly unfamiliar to me.
Still no.
I confuse @accalia and @aliceif all the time, despite whatever their avatars are.
-
If rendered client-side:
If uploaded to server-side:
The image is saved and handled as a normal image.
-
What if... we just used a default avatar...
-
@xaade You mean, like some forum softwares from the 00's (or even older)? Heretic!
-
I never thought I would look back fondly at Community Server.
-
@remi said in Avatar replacement for self-mentions doesn't work:
@xaade You mean, like some forum softwares from the 00's (or even older)? Heretic!
No, it's better to just cough on your own blood than to do something simpler. :P
-
@djls45 said in Avatar replacement for self-mentions doesn't work:
Apparently, one must have a custom avatar for this to work.
Correct.
Could the functionality be extended to include the defaults as well?
Sure, if we used a letter image CDN for default avatars.
@Arantor said in Avatar replacement for self-mentions doesn't work:
It'd be a pain because unlike Some Other Software, users without an explicit avatar get a div with a background and some text. While it's technically possible to fix, it's actually harder to fix because it's not like you have an img tag that you can set the size for and have the browser 'just deal with it'.
It's not like NodeBB doesn't already generate default avatars at a few different sizes. There's really no reason why one more time is more than already.
I count six different sizes...
Pictah Syxe Whargarble 24x24 Last reply preview in topic list 28x28 Profile timeline 30x30 User menu 46x46 Post 128x128 Profile top 150x150 User card
-
@anotherusername said in Avatar replacement for self-mentions doesn't work:
24x24
@anotherusername said in Avatar replacement for self-mentions doesn't work:
28x28
@anotherusername said in Avatar replacement for self-mentions doesn't work:
30x30
WHY.
-
@Yamikuronue We have to have responsive design!!!
-
@Yamikuronue said in Avatar replacement for self-mentions doesn't work:
@anotherusername said in Avatar replacement for self-mentions doesn't work:
24x24
@anotherusername said in Avatar replacement for self-mentions doesn't work:
28x28
@anotherusername said in Avatar replacement for self-mentions doesn't work:
30x30
WHY.
@xaade said in Avatar replacement for self-mentions doesn't work:
@Yamikuronue We have to have responsive design!!!
I didn't even try adjusting the window size to see if responsive design caused even more avatar sizes. That's just at the window size at which I'm currently reading.
-
-
@xaade no kidding, I said "a few different sizes", thinking 2 or 3 max, and then I started looking and ended up finding 6.
There might even be more. Who knows?
-
I forget which Windows OS it started in, but I upgraded one time and noticed that the icons would work for seemingly any square size.
I was excited because I thought they made the switch to vector icons.
Nope... the default icon files just had 512 sizes...
-
@xaade said in Avatar replacement for self-mentions doesn't work:
Nope... the default icon files just had 512 sizes...
That's a curiously specific number…
-
@Maciejasjmj said in Avatar replacement for self-mentions doesn't work:
@JBert said in Avatar replacement for self-mentions doesn't work:
Jeff's AaaS?
Ew.
I wanted to go for a better pun but I couldn't think of anything less hairy.
You're welcome.
-
@xaade said in Avatar replacement for self-mentions doesn't work:
I forget which Windows OS it started in, but I upgraded one time and noticed that the icons would work for seemingly any square size.
I was excited because I thought they made the switch to vector icons.
Nope... the default icon files just had 512 sizes...
From a user's perspective, what's the difference?
-
@xaade said in Avatar replacement for self-mentions doesn't work:
I forget which Windows OS it started in, but I upgraded one time and noticed that the icons would work for seemingly any square size.
I was excited because I thought they made the switch to vector icons.
Nope... the default icon files just had 512 sizes...
I don't think I've seen icon resources with much more than 4 or 8 sizes, but it does makes sense really. A large icon which looks nice doesn't always scale down very well. Supplying a version in a smaller size lets you tweak it so it looks better at that size.
It's more helpful for icons that have more stuff going on; you can sharpen them up so they're not just a blurry blob. A simple letter on a solid background shouldn't really need it, though.