Long usernames cut off when full names are displayed


(Allen - Watchman Monitoring) #1

In my own Discourse, freshly updated as of Feb 22, my account’s long username is cut off.

See in the image the blue text should be watchmanmonitor but the n is cut in half.

I don’t believe I have any extra customization which would cause this behavior.

TIA for your thoughts.


(Sam Saffron) #2

It looks good here cause we have a simple way to split (your username is “watchman monitor” )

It should not really cut off, I can see the bug

@awesomerobot should we ensure there is word-wrap break word or something in place for this?


(Kris) #3

Yep! I could put that back in - it looked like long usernames were getting a <wbr> tag to break the space logically, but I was wrong in assuming that (just usernames with obvious breaks like spaces and underscores get that I think?)

It might be nice to have some logic that says if a username is X characters long insert a <wbr> tag in the middle of it… I’d prefer that type of break versus just dropping off one or two letters at the end like word-wrap: break-word does… though maybe that bothers me more than it bothers other folks?


(Sam Saffron) #4

yes that is the case … the wbr is just used as a hint

I thought this would just work in conjunction … break-word will only kick in if wbr is missing ?


(Kris) #5

No you’re right - it’s the simplest way to handle it, I just hate that it’ll break a single letter on to the next line. Just not the nicest looking from a visual standpoint.

Anyway, I’ll add break-word back in today.


(Allen - Watchman Monitoring) #6

I’ve updated, here’s what I see now:

My username is @watchmanmonitor in my forum as well as here, though in my forum, i am have Allow users to show their full names enabled.


(Kris) #7

I was actually just talking about this with @sam earlier… Discourse supports 15 character usernames, but unless you use a _ or . or something that causes a simple logical breakpoint a single word username 12+ characters long breaks on to two lines… which isn’t pretty ( :arrow_left: look at my silly user name! )

One idea I had was to widen the space usernames get a bit, and take some of the padding out of the left of the topic content to eliminate any space “lost” to such an adjustment (the net loss to overall post content would end up being ~3px of width)

Here’s a gif that visualizes that change

It’s a bit of a fringe case, but I’ve seen it happen here and there across various discourse sites… so maybe it’s worth trying out.

Anyone have any other thoughts/objections/ideas?


(cpradio) #8

Try it with a username of 15 W’s to be sure that is all you need to take out :smile:


(Kris) #9

It definitely doesn’t support 15 W’s - I just took the handful of “too long” usernames as my sample and tried to find something that seemed reasonable.

The available options seem to be:

  1. Keep it as is, some awkward breaks occasionally [easy]
  2. Let long usernames stay on one line and truncate the end [easy]
  3. Add some space to help support most long usernames, but not people who use a lot of w’s [mild]
  4. Drastically change the layout like Hummingbird’s forums do [difficult]

(Allen - Watchman Monitoring) #10

I don’t know how to create a Poll here, but I’m all about #3

But what I really want to know is: Why does the length of my name effect the display of my username

See these two screencaps

short name, good break

Long name, bad break

Note that I’m changing the Name, which isn’t displayed at all, effects how my username breaks.


(Kane York) #11

I think that a text match is occuring against the full name, then it sees that there’s a space in the full name, so it inserts a break at that point in your username.

Try changing it to Watchmanmo Nitoring and see what happens.


(Allen - Watchman Monitoring) #12

I didn’t expect it would work, and sure enough, it didn’t :wink:

How do you like me now:


(Allen - Watchman Monitoring) #13

It seems that the decision on where to break the username is being calculated on the name.

Plausible?


(Kris) #14

oddly enough, I just tried to change my settings and it worked here

definitely seems to be the case?


(Sam Saffron) #15

yes exactly.

Either that or capitalisation changes. WatchmanMonitor as a username will split nicely as well.


(Jeff Atwood) #16

I like the hummingbird layout well enough, but I am unwilling to commit to such a large scale change at this time. Still thinking about it. We’re also adding more “stuff” to the left gutter with badges, potentially… and full name also goes there, if you’ve turned that on, as noted in this topic.


(Dave McClure) #17

whoa… for a second It thought someone implemented some dictionary magic and had your name automatically splitting just because ‘aweseome’ and ‘robot’ are both words…


(Jeff Atwood) #18

All this stuff is no longer an issue since usernames are on top now.


(Jeff Atwood) #19