Unread indicator/counter on a new line

(Bart) #1

Hardly world shattering, but the OCD part of me can’t handle things like this :wink:



(Michael Howell) #2

(Jeff Atwood) #3

What do you think @awesomerobot?

(Kane York) #4

Can you explain what the ~ in Handlebars does within the commit message?

(Kris) #5

I agree @bartv! this is a slight annoyance for me too.

@notriddle, I just tried this out and it’s not working for me.

.topic-post-badges {
  white-space: nowrap;

This is preventing wrapping within .topic-post-badges, whitespace between the badges and the title will still wrap.

As long as these two elements are siblings I don’t think we can avoid widowing the badges.

The only way I can think of to get this to work would be placing .topic-post-badges div inside the a.title.raw-link.raw-topic-link, and then use an   to put a space between the badges and the link text…

(Kris) #6

~ strips out whitespace (in this case the preceding whitespace), more examples: Handlebars.js: Minimal Templating on Steroids

(Michael Howell) #7

I added a mention of what the ~ syntax does.

That’s why I tried to strip all the whitespace between the badges and the link text itself. I’m guessing that something’s getting rendered between them, and it contains whitespace on the particular topic that you’re looking at.

(Kris) #8

Strange that it works for you… I even tried to remove any additional whitespace manually from the inspector just to test it

I can just merge it and see what happens, worst case scenario is nothing changes.

(Kris) #9

Changes are live here and I’m still seeing widowing… are you seeing the same @notriddle? I can’t imagine this would be a browser/OS difference… so I’m back to thinking:

(Michael Howell) #10

It has to be dependent on the browser version (I’m a Firefox, you’re a Chrome).

Maybe we should change discourse/topic-post-badges.raw.hbs at master · discourse/discourse · GitHub to start with a  ? I notice that the space that’s supposed to be between the badge and the topic title is present in my browser, but absent in yours, meaning there’s probably some whitespace collapsing difference that’s influencing where the line break is (or, in my case, would be) happening.

(Michael Howell) #11

Okay, I tried it in another browser (MS Edge, actually) and it’s behaving like your browser is. I managed to fix it so that it works right in both Edge and Firefox. But before opening another PR, let’s try iterating in Theme Creator:


Does that work in your browser, @awesomerobot?

(Kris) #12

:tada: that did it! thanks for figuring it out, this fix is much simpler than what the alternative would have been. If you make a PR I can merge it in.

(Michael Howell) #13

(Michael Howell) #14

There was one minor problem still there

(Kris) closed #15

This topic was automatically closed after 3 days. New replies are no longer allowed.